aboutsummaryrefslogtreecommitdiff
path: root/examples/arithmetic.hdass
blob: 1534146b3b6015c5487465ddc57b0c880c5fccf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[entry: main]

// 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
}