From ceae04d57483f811a08b360f28aaf58c0bcb0319 Mon Sep 17 00:00:00 2001 From: Matt Hunter Date: Wed, 17 Sep 2025 07:56:52 -0400 Subject: Move exit call exit is now only called from one place, so move the syscall to that location to avoid the extra unconditional jump. There is now no longer an exit label. mov al, 1 is replaced with inc eax, as this overall saves 1 byte. Since lace's exit status is no longer defined, drop the instruction to zero ebx before exiting. Now that explicit error checking is removed, there is no need to use this value for anything. Signed-off-by: Matt Hunter --- lace_x86.asm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lace_x86.asm b/lace_x86.asm index 77e8ce9..1cf1e85 100644 --- a/lace_x86.asm +++ b/lace_x86.asm @@ -94,8 +94,9 @@ _start: xchg edi, esi call pipe - xor ebx, ebx ; exit(0) - jmp exit + xor eax, eax ; exit() + inc eax + int 0x80 pipe: mov dl, 0xff ; read(src, buff, sizeof(buff)) @@ -114,8 +115,3 @@ pipe_cont: mov al, 4 int 0x80 jmp pipe ; loop - -exit: - xor eax, eax - mov al, 1 - int 0x80 -- cgit v1.2.3