summaryrefslogtreecommitdiff
path: root/tnslc/dummy.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-10-09 15:15:39 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-10-09 15:15:39 -0400
commit51494729997b457251a62506b87af1635cd19802 (patch)
tree37d9a669363bda813d56b93497e53c20cb17dc50 /tnslc/dummy.tnsl
parentb819cbb3b0ff492024b72d9ea9c9e28e1023b9c3 (diff)
Basic asm helpers
Diffstat (limited to 'tnslc/dummy.tnsl')
-rw-r--r--tnslc/dummy.tnsl21
1 files changed, 5 insertions, 16 deletions
diff --git a/tnslc/dummy.tnsl b/tnslc/dummy.tnsl
index 003e428..60fe913 100644
--- a/tnslc/dummy.tnsl
+++ b/tnslc/dummy.tnsl
@@ -1,28 +1,17 @@
-/; raw _alloc
+/; _alloc (uint bytes) [~void]
;asm "mov %rax, %rdi"
- ;asm "push %r8"
- ;asm "push %r9"
- ;asm "push %r10"
;asm "mov $0, %r10"
;asm "call malloc"
- ;asm "pop %r10"
- ;asm "pop %r9"
- ;asm "pop %r8"
;/
-/; raw _delete
+/; _delete (~void ptr)
;asm "mov %rax, %rdi"
- ;asm "push %r9"
- ;asm "push %r10"
;asm "mov $0, %r10"
;asm "call free"
- ;asm "pop %r10"
- ;asm "pop %r9"
;/
/; main [int]
- ;asm "mov $10, %rax"
- ;asm "call _alloc"
- ;asm "call _delete"
- ;asm "mov $0, %rax"
+ ;~void ptr = _alloc(10)
+ ;_delete(ptr)
+ ;return 0
;/