aboutsummaryrefslogtreecommitdiff
path: root/examples/arithmetic.hdass
blob: 359653e38abfabd63fbdb1c7eb10398989bae168 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Computes (5 + 3) * 2 - 1 = 15 and returns it as the exit status.
const SYS_EXIT = 60

proc main
{
    rdi = 5
    rdi += 3
    rdi *= 2
    rdi -= 1

    rax = SYS_EXIT
    syscall
}