A simplified and streamlined bash script to assemble and run x86-64 assembly programs with ease. Supports both NASM and GNU GAS assemblers.
- Quick assembly and execution of x86-64 programs
- Support for both NASM and GNU GAS syntax
- Organized output (object files in
tmp/, executables inbin/) - Interactive setup wizard for easy configuration
- Simple command-line interface
You can download just the script without cloning the entire repository:
curl -O https://raw.githubusercontent.com/syntaxMORG0/EZasm/main/EZasm.bash
chmod +x EZasm.bashgit clone https://github.com/syntaxMORG0/EZasm.git
cd EZasmRun the interactive setup wizard to configure your environment:
sh EZasm.bash -setupThis will:
- Create necessary directories (
tmp/andbin/) - Let you choose your assembler (NASM or GAS)
- Configure input/output file names
- Optionally create a sample "Hello, World!" program
- Set display preferences
After setup, simply run:
sh EZasm.bashThis will assemble, link, and execute your assembly program automatically.
You can manually edit the configuration at the top of EZasm.bash:
inputFile="main.s" # Your assembly source file
asmFlavor="nasm" # Options: nasm, gas
displayASMver=false # Show assembler version
displayDebug=true # Show build process messages
OutputfileName="" # Leave empty for default (rootexecuteble)# Ubuntu/Debian
sudo apt-get install nasm
# macOS
brew install nasm# Ubuntu/Debian
sudo apt-get install binutils
# macOS (included by default)Both options also require ld (GNU linker), which is typically included with binutils.
section .data
msg db 'Hello, world!', 0xa
len equ $ - msg
section .text
global _start
_start:
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, len
syscall
mov rax, 60
xor rdi, rdi
syscall.section .data
msg:
.ascii "Hello, world!\n"
len = . - msg
.section .text
.globl _start
_start:
movq $1, %rax
movq $1, %rdi
movq $msg, %rsi
movq $len, %rdx
syscall
movq $60, %rax
xorq %rdi, %rdi
syscallEZasm/
├── EZasm.bash # Main script
├── main.s # Your assembly source
├── bin/ # Output executables
│ └── rootexecuteble
└── tmp/ # Temporary object files
└── rootfile.o
See LICENSE for details.
Made by syntaxMORG0
Happy coding!