hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/examples/records.hdass
blob: a6d5659243536ff754ffcf1d642405cd244deac4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[entry: main]

enum Status
{
    Ok,
    Warn,
    Fail
}

struct Pair
{
    a: qword
    b: qword
}

const SYS_EXIT = 60

proc main
{
    stack pair[Pair.size]

    rsi = pair
    rsi += Pair.a
    rbx = 40
    ^rsi = rbx

    rsi = pair
    rsi += Pair.b
    rcx = Status.Fail
    ^rsi = rcx

    rsi = pair
    rsi += Pair.a
    rdi = ^rsi
    rsi = pair
    rsi += Pair.b
    rax = ^rsi
    rdi += rax

    rax = SYS_EXIT
    syscall
}