FasmMacroLib is a macro library for simplifying FASM programming on 64-bit Linux.
Works only on Linux x86_64 (64-bit).
Just include the macros file at the beginning of your .asm file:
include 'macroslib.inc'Below is a detailed list of available macros and their usage.
For practical examples, see examples folder.
Compiled binaries of these examples are available in the releases section.
Alternatively, you can compile them yourself by running:
cd FasmMacroLib
makeClears the specified register (sets it to zero).
clr raxTerminates the program with a specified exit code.
exit 0 ; exit with code 0
exit 1 ; exit with code 1Stores the current time (seconds since January 1, 1970) in register rax.
timeCreates a directory with the given name and permissions (octal format).
Returns error code in rax.
mkdir "test", 777oRemoves the specified directory.
Returns error code in rax.
rmdir "test"Prints the given number in decimal.
Returns the number of bytes printed in rax.
printnum 244939252Prints the string at the given address with the specified length.
Returns the number of bytes printed in rax.
print "test", 4Prints the given string a specified number of times.
Returns the number of bytes printed in rax.
printtim 2, "test", 4Executes the specified shell command.
run "echo test"Pushes or pops multiple registers on/from the stack (like multiple push/pop instructions combined).
push rax, rdi, rsi, rdx
...
pop rdx, rsi, rdi, raxContributions are welcome!
Feel free to open pull requests to improve the library.
Developed by Lina Torovoltas — © 2025 All rights reserved.