aboutsummaryrefslogtreecommitdiffstats
path: root/src/x86_64
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-11-04 11:58:53 +0100
committerBad Diode <bd@badd10de.dev>2021-11-04 11:58:53 +0100
commit7cbef14e8393475b1e569fdbfff2c46db859d43f (patch)
treec7a25a997fae700f5f7a952a9550d6ee74bea240 /src/x86_64
parent84c2bf292ddcb91543715951805ebc2335c46567 (diff)
downloadbdl-7cbef14e8393475b1e569fdbfff2c46db859d43f.tar.gz
bdl-7cbef14e8393475b1e569fdbfff2c46db859d43f.zip
Add `cons`, `car` and `cdr` primitives
Diffstat (limited to 'src/x86_64')
-rw-r--r--src/x86_64/postlude.asm4
-rw-r--r--src/x86_64/prelude.asm7
2 files changed, 10 insertions, 1 deletions
diff --git a/src/x86_64/postlude.asm b/src/x86_64/postlude.asm
index 3355286..37f9df1 100644
--- a/src/x86_64/postlude.asm
+++ b/src/x86_64/postlude.asm
@@ -9,3 +9,7 @@ exit:
9 mov rax, 60 9 mov rax, 60
10 xor rdi, rdi 10 xor rdi, rdi
11 syscall 11 syscall
12
13section .bss
14bdl_heap:
15 resb HEAP_SIZE
diff --git a/src/x86_64/prelude.asm b/src/x86_64/prelude.asm
index 6bb6627..e57e820 100644
--- a/src/x86_64/prelude.asm
+++ b/src/x86_64/prelude.asm
@@ -1,3 +1,4 @@
1section .text
1printdln: 2printdln:
2 sar rdi, FIXNUM_SHIFT 3 sar rdi, FIXNUM_SHIFT
3 sub rsp, 40 4 sub rsp, 40
@@ -98,4 +99,8 @@ display_end:
98 99
99global _start 100global _start
100_start: 101_start:
101 push NIL_VAL 102 ;; point `rdi` to the start of the heap.
103 mov rsi, bdl_heap
104
105 ;; make sure the last element in the stack is the nil value.
106 push NIL_VAL