summaryrefslogtreecommitdiff
path: root/tnslc/simple.tnsl
blob: 29113b7406272a3d5eebe028bd1e080099e7a9ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13

{}uint8 str1 = "abcd"

/; main (int argc, ~~uint argv) [int]
    # On windows, the first two arguments are passed in RCX and RDX, so we need to
    # update their positions here or else tnsl will have garbage values in r8 and r9
    asm "mov r8, rcx"
    asm "mov r9, rdx"

    # return 3
    return argc + len str1
;/