Greetings! I'm new here (first post) and I only recently started using fasm. Loving it so far!
I've been using the libc version of fasm and noticed a few small bugs:
1. Fasm doesn't return the correct exit code.
2. When using the -s option, fasm exits with an 'error: write failed' message.
Here's two patches that fix the above mentioned bugs (Apply with: patch -p1):
Edit: Oops! I forgot the mention that these patches are for version 1.69.32.
Exit code patch:
--- a/source/libc/system.inc
+++ b/source/libc/system.inc
@@ -45,7 +45,8 @@ exit_program:
movzx eax,al
push eax
ccall free,[additional_memory]
- ccall exit
+ pop eax
+ ccall exit,eax
mov esp,[stack_frame]
pop ebp
ret
-s option patch:
--- a/source/libc/system.inc
+++ b/source/libc/system.inc
@@ -120,9 +120,9 @@ read:
stc
ret
write:
- push ebx ecx edx esi edi
+ push ebx ecx edx esi edi ebp
ccall fwrite,edx,1,ecx,ebx
- pop edi esi edx ecx ebx
+ pop ebp edi esi edx ecx ebx
cmp eax,ecx
jne file_error
clc