diff options
Diffstat (limited to 'examples/branch.hdass')
| -rw-r--r-- | examples/branch.hdass | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/branch.hdass b/examples/branch.hdass new file mode 100644 index 0000000..1218773 --- /dev/null +++ b/examples/branch.hdass @@ -0,0 +1,17 @@ +// Returns the larger of two values (max(3, 8) = 8) as the exit status. +const SYS_EXIT = 60 + +proc main +{ + rbx = 3 + rcx = 8 + + rdi = rbx + if rcx <= rbx + goto done + rdi = rcx + +done: + rax = SYS_EXIT + syscall +} |
