summaryrefslogtreecommitdiff
path: root/tnslc/c_wrap.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-03-18 18:50:47 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-03-18 18:50:47 -0400
commit80b6af60eb8b9d971b9710ae9d91c2639a9e875f (patch)
treeea1afd7ac7125163e4f987bc43a9ec8af4ac7796 /tnslc/c_wrap.tnsl
parentd21c66af96878e5efff081ec861af4350d37bffe (diff)
File level ASM + Change scope naming
Diffstat (limited to 'tnslc/c_wrap.tnsl')
-rw-r--r--tnslc/c_wrap.tnsl10
1 files changed, 7 insertions, 3 deletions
diff --git a/tnslc/c_wrap.tnsl b/tnslc/c_wrap.tnsl
index d1004bb..93ea3e4 100644
--- a/tnslc/c_wrap.tnsl
+++ b/tnslc/c_wrap.tnsl
@@ -1,3 +1,7 @@
+asm "extern malloc"
+asm "extern realloc"
+asm "extern free"
+
/; _alloc (uint size) [~void]
~void out
# Mov size into proper register, and set all extras to zero
@@ -8,7 +12,7 @@
asm "mov r8, 0"
asm "mov r9, 0"
asm "mov r10, 0"
- asm "call malloc wrt ..got"
+ asm "call malloc"
# Set out to the returned value
# (The compiler assignes spaces sequentially, and we have a uint in r8)
asm "mov r9, rax"
@@ -26,7 +30,7 @@
asm "mov r9, 0"
asm "mov r10, 0"
# Do call
- asm "call realloc wrt ..got"
+ asm "call realloc"
# Set out to the returned value
# (The compiler assignes spaces sequentially. We have a ptr in r8, and a uint in r9)
asm "mov r10, rax"
@@ -43,7 +47,7 @@
asm "mov r9, 0"
asm "mov r10, 0"
# do call
- asm "call free wrt ..got"
+ asm "call free"
# there's no more to do 'cause free returns nothing
;/