aboutsummaryrefslogtreecommitdiff
path: root/src/test_if.tpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/test_if.tpc')
-rw-r--r--src/test_if.tpc43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/test_if.tpc b/src/test_if.tpc
new file mode 100644
index 0000000..356061f
--- /dev/null
+++ b/src/test_if.tpc
@@ -0,0 +1,43 @@
1extern printf
2section .data
3format_int db "%d",10,0
4
5section .bss
6section .text
7
8global _start
9print: ;print needs an argument in rax
10push rbp
11mov rbp, rsp
12push rsi
13mov rsi, rax
14mov rdi, format_int
15mov rax, 0
16call printf WRT ..plt
17pop rsi
18pop rbp
19ret
20
21_start:
22push rbp
23mov rbp, rsp
24
25push 0
26push 1
27pop QWORD [rbp - 0] ;bool
28push QWORD [rbp - 0] ;bool
29pop rax
30cmp rax,0
31jz .end_if0
32push QWORD [rbp - 0] ;bool
33pop rax
34call print
35.end_if0
36mov rax,60
37mov rdi,0
38syscall
39;global table
40
41;local table
42;entier: bool, pos: 0
43