Skip to content

neso-hiroshi/FasmMacroLib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FasmMacroLib

License Version Downloads
FasmMacroLib is a macro library for simplifying FASM programming on 64-bit Linux.

Dependencies

Works only on Linux x86_64 (64-bit).

Installation

Just include the macros file at the beginning of your .asm file:

include 'macroslib.inc'

Usage

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
make

clr

Clears the specified register (sets it to zero).

clr rax

exit

Terminates the program with a specified exit code.

exit 0         ; exit with code 0
exit 1         ; exit with code 1

time

Stores the current time (seconds since January 1, 1970) in register rax.

time

mkdir

Creates a directory with the given name and permissions (octal format).
Returns error code in rax.

mkdir "test", 777o

rmdir

Removes the specified directory.
Returns error code in rax.

rmdir "test"

printnum

Prints the given number in decimal.
Returns the number of bytes printed in rax.

printnum 244939252

print

Prints the string at the given address with the specified length.
Returns the number of bytes printed in rax.

print "test", 4

printtim

Prints the given string a specified number of times.
Returns the number of bytes printed in rax.

printtim 2, "test", 4

run

Executes the specified shell command.

run "echo test"

push / pop

Pushes or pops multiple registers on/from the stack (like multiple push/pop instructions combined).

push rax, rdi, rsi, rdx
...
pop rdx, rsi, rdi, rax

Contributing

Contributions are welcome!
Feel free to open pull requests to improve the library.

Author

Developed by Lina Torovoltas — © 2025 All rights reserved.

About

Macro library for FASM (Flat Assembler) for Linux

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Assembly 96.0%
  • Makefile 4.0%