summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2025-09-17 07:56:52 -0400
committerMatt Hunter <m@lfurio.us>2025-09-28 22:45:59 -0400
commitceae04d57483f811a08b360f28aaf58c0bcb0319 (patch)
treecab9e3f96ec0017f628a5b63bb0270d73cbaf1e2
parent2d6d14a87afdb0eb4a4d81fd981cd825cd2c7824 (diff)
downloadlace-ceae04d57483f811a08b360f28aaf58c0bcb0319.tar.gz
lace-ceae04d57483f811a08b360f28aaf58c0bcb0319.zip
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 <m@lfurio.us>
-rw-r--r--lace_x86.asm10
1 files 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