Skip to content

EZasm is a asm tool to make it easier and intuitive to write asm code

License

Notifications You must be signed in to change notification settings

syntaxMORG0/EZasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

EZasm

A simplified and streamlined bash script to assemble and run x86-64 assembly programs with ease. Supports both NASM and GNU GAS assemblers.

Features

  • Quick assembly and execution of x86-64 programs
  • Support for both NASM and GNU GAS syntax
  • Organized output (object files in tmp/, executables in bin/)
  • Interactive setup wizard for easy configuration
  • Simple command-line interface

Quick Start

Download Without Cloning

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.bash

Or Clone the Repository

git clone https://github.com/syntaxMORG0/EZasm.git
cd EZasm

Usage

First Time Setup

Run the interactive setup wizard to configure your environment:

sh EZasm.bash -setup

This will:

  • Create necessary directories (tmp/ and bin/)
  • Let you choose your assembler (NASM or GAS)
  • Configure input/output file names
  • Optionally create a sample "Hello, World!" program
  • Set display preferences

Build and Run

After setup, simply run:

sh EZasm.bash

This will assemble, link, and execute your assembly program automatically.

Configuration

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)

Requirements

For NASM

# Ubuntu/Debian
sudo apt-get install nasm

# macOS
brew install nasm

For GNU GAS

# Ubuntu/Debian
sudo apt-get install binutils

# macOS (included by default)

Both options also require ld (GNU linker), which is typically included with binutils.

Example Programs

NASM Syntax (main.s)

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

GNU GAS Syntax (main.s)

.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
    syscall

Directory Structure

EZasm/
├── EZasm.bash          # Main script
├── main.s              # Your assembly source
├── bin/                # Output executables
│   └── rootexecuteble
└── tmp/                # Temporary object files
    └── rootfile.o

License

See LICENSE for details.

Author

Made by syntaxMORG0


Happy coding!

About

EZasm is a asm tool to make it easier and intuitive to write asm code

Resources

License

Stars

Watchers

Forks

Languages