summaryrefslogtreecommitdiff
path: root/tnslc/dummy.tnsl
blob: 741a0e0e5cd51d493c79a8bc3ae8872ccf0a3651 (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
;struct test {
    int8 i, j, k, l
}

;struct test2 {
    test a, b
}

/; add (int a, b) [int]
    ;return a + b - 9 - 30
;/

/; main (uint argc, ~~uint8 argv) [int]
    # Fix for main func
    ;asm "mov %rdi, %r8"
    ;asm "mov %rsi, %r9"
    # ;~void ptr = _alloc(10)
    # ;_delete(ptr)
    # ;return add(argc, 2)
;/


/; _alloc (uint bytes) [~void]
    ;asm "mov %rax, %rdi"
    ;asm "mov $0, %r10"
    ;asm "call malloc"
;/

/; _delete (~void ptr)
    ;asm "mov %rax, %rdi"
    ;asm "mov $0, %r10"
    ;asm "call free"
;/