hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/examples/loop_sum.hdass
blob: 7d9acdd1449ee3370af57b4ced8102136088c329 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[entry: main]

const SYS_EXIT = 60

proc main
{
    rbx = 0
    rcx = 5

    while .countdown rcx > 0
    {
        rbx += rcx
        rcx -= 1
    }

    rdi = rbx
    rax = SYS_EXIT
    syscall
}