aboutsummaryrefslogtreecommitdiffstats
path: root/src/x86_64/postlude.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/x86_64/postlude.asm')
-rw-r--r--src/x86_64/postlude.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/x86_64/postlude.asm b/src/x86_64/postlude.asm
index 139c4e1..5c8e56f 100644
--- a/src/x86_64/postlude.asm
+++ b/src/x86_64/postlude.asm
@@ -1,7 +1,32 @@
1
2_start_return:
1 ;; return the last value in the stack 3 ;; return the last value in the stack
2 pop rdi 4 pop rdi
5
6 ;; is nil?
7 mov rax, rdi
8 cmp rax, NIL_VAL
9 je exit
10
11 ;; is boolean?
12 mov rax, rdi
13 and rax, BOOL_MASK
14 cmp rax, BOOL_TAG
15 jne not_bool
16 call printbool
17 jmp exit
18not_bool:
19
20 ;; is fixnum?
21 mov rax, rdi
22 and rax, FIXNUM_MASK
23 cmp rax, FIXNUM_TAG
24 jne not_fixnum
3 call printdln 25 call printdln
26 jmp exit
27not_fixnum:
4 28
29exit:
5 ; exit syscall 30 ; exit syscall
6 mov rax, 60 31 mov rax, 60
7 xor rdi, rdi 32 xor rdi, rdi