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

// (7 * 6) / 5 = 8 with a value-expression multiply and a non-rax division,
// returned as the exit status.
const SYS_EXIT = 60

proc main
{
    rbx = 7
    rcx = 6
    rbx = rbx * rcx   // 42

    rcx = 5
    rbx /= rcx        // 8

    rdi = rbx
    rax = SYS_EXIT
    syscall
}