From dedd1d1e4bcc2607a626776507ef1136ef44af8d Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Wed, 28 Sep 2022 12:19:04 -0400 Subject: malloc hooks --- tnslc/dummy.tnsl | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'tnslc') diff --git a/tnslc/dummy.tnsl b/tnslc/dummy.tnsl index f53a658..2a624a2 100644 --- a/tnslc/dummy.tnsl +++ b/tnslc/dummy.tnsl @@ -1,8 +1,28 @@ -/; main - ;asm "mov $0, %eax" - ;asm "call doug" +/; _alloc + ;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" ;/ -/; doug +/; _delete + ;asm "mov %rax, %rdi" + ;asm "push %r9" + ;asm "push %r10" + ;asm "mov $0, %r10" + ;asm "call free" + ;asm "pop %r10" + ;asm "pop %r9" +;/ -;/ \ No newline at end of file +/; main + ;asm "mov $10, %rax" + ;asm "call _alloc" + ;asm "call _delete" + ;asm "mov $0, %rax" +;/ -- cgit v1.2.3