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

// Writes a fixed string to stdout, then exits cleanly.
const SYS_WRITE = 1
const SYS_EXIT = 60

const STDOUT = 1

data greeting = "hdass works!\n"

proc main
{
    rax = SYS_WRITE
    rdi = STDOUT
    rsi = greeting
    rdx = greeting.len
    syscall

    rax = SYS_EXIT
    rdi = 0
    syscall
}