From 0a55ef2da41f74c77dd26682cab2faba45e2c3a3 Mon Sep 17 00:00:00 2001 From: xolatile Date: Tue, 16 Jul 2024 12:25:29 -0400 Subject: [PATCH] Simple procedure... --- test/simple_procedure.eax | 34 ++++++++++++++++++++++++++++++++++ tool/xia32e.c | 1 + tool/xia32e_test.asm | 9 ++++++--- 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 test/simple_procedure.eax diff --git a/test/simple_procedure.eax b/test/simple_procedure.eax new file mode 100644 index 0000000..9655f2c --- /dev/null +++ b/test/simple_procedure.eax @@ -0,0 +1,34 @@ +fastcall procedure heyo + s8 <> h = "Heyo world!\n" +begin + nop mov rax 1 + nop mov rdi 1 + nop mov rsi h + nop mov rdx 12 + nop syscall +end procedure + +fastcall procedure cyaa + s8 <> c = "Cyaa world!\n" +begin + nop mov rax 1 + nop mov rdi 1 + nop mov rsi c + nop mov rdx 12 + nop syscall +end procedure + +unix program main + s8 <> m = "Meme world!\n" +begin + nop fastcall heyo + nop mov rax 1 + nop mov rdi 1 + nop mov rsi m + nop mov rdx 12 + nop syscall + nop fastcall cyaa + nop mov rax 60 + nop mov rdi 60 + nop syscall +end program diff --git a/tool/xia32e.c b/tool/xia32e.c index 270a84e..9336053 100644 --- a/tool/xia32e.c +++ b/tool/xia32e.c @@ -162,6 +162,7 @@ int main (void) { scope_label = 1; } else if ((index >= token_add) && (index <= token_fldz)) { tokenize (index + ADD); + if (index == token_call) tokenize (REL); scope_instruction = 1; } else if ((index >= token_al) && (index <= token_r15)) { if (scope_instruction) { diff --git a/tool/xia32e_test.asm b/tool/xia32e_test.asm index b83fbb2..b3f9b98 100644 --- a/tool/xia32e_test.asm +++ b/tool/xia32e_test.asm @@ -3,14 +3,17 @@ nop mov edi 1 nop mov esi heyo nop mov edx 5 nop syscall +call c +nop mov eax 60 +nop mov edi 60 +nop syscall +. c nop mov eax 1 nop mov edi 1 nop mov esi cyaa nop mov edx 5 nop syscall -nop mov eax 60 -nop mov edi 60 -nop syscall +nop retn nop . heyo db 5 72 69 89 79 10 . cyaa db 5 67 89 65 65 10