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

// Stores 7 into a stack cell, loads it back through a pointer, and exits with it.
const SYS_EXIT = 60

proc main
{
    stack cell[8]

    rbx = 7
    rsi = cell // address of the cell
    ^rsi = rbx // store
    rdi = ^rsi // load it back

    rax = SYS_EXIT
    syscall
}