-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add io.inc includes similar to the nasm's one for other compilers #37
Comments
You can find a description of the library on the site http://dman95.github.io/SASM/english.html |
I've already seen the docs from the link you given. format ELF
extrn _printf
section '.text' executable
public _main
_main:
push message
call _printf
xor eax, eax
ret
message db 'Hello!', 0 It is compiled successfully with fasm from sasm, but when I try to run it, it prints nothing. |
I've finally found helloworld for fasm in the directory of sasm, it works fine, so I will try to use it as a reference. |
printf, puts are working, but I failed to make work scanf - it just passes through it without waiting of input. format ELF
section '.data' writeable
num dd 0
format_str db "%d", 0
section '.text' executable
public _main
extrn _printf
extrn _scanf
_main:
mov ebp, esp; for correct debugging
push num
push format_str
call _scanf
add esp, 8
push [num]
push format_str
call _printf
add esp, 8
xor eax, eax
ret |
It is not a bug, it is a feature. To perform input in a program you should enter a text before running a program. |
There are many libraries that have already been made for other assemblers. Look up FreshLib for a fasm macro library. |
@ThomasThelen, the request was not about libraries for fasm in general. It was limited to rewriting existing io.inc file, which works with nasm, to the syntax of fasm. |
I think I can implement io.inc for fasm if you describe in brief how io.inc for nasm works (I don't understand nasm's macros syntax).
The text was updated successfully, but these errors were encountered: