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
|
:import "c_wrap_linux.tnsl"
:import "vector.tnsl"
/; push_char(Vector` a, uint8 c)
a.push(~c)
;/
/; main (int argc, ~~uint8 argv) [int]
asm "mov r10, rdi"
asm "mov r11, rsi"
_print_num(PUSH_STR, argc)
Vector a
a.init(1)
push_char(~a, 'h')
push_char(~a, 'e')
push_char(~a, 'l')
push_char(~a, 'l')
push_char(~a, 'o')
push_char(~a, ' ')
push_char(~a, 'w')
push_char(~a, 'o')
push_char(~a, 'r')
push_char(~a, 'l')
push_char(~a, 'd')
push_char(~a, '\n')
push_char(~a, 0)
_printf(a.data)
a.end()
return 0
;/
|