x86_64 assembler with Intel syntax
Documentation | Architecture | Contributing | Changelog | Security | CoC | To-Do List | NOTICE | Third-Party Licenses | License | The Book | Site
RASM (Red Assembler) — x86_64 assembler with Intel syntax.
-
Cross-platform: ELF64 for Linux, Mach-O for macOS, and PE32+ & COFF64 for Windows.
-
Native emitter: RASM does not require an external linker to create executable files.
Most popular assemblers generate object files and require a separate linking step:
- NASM → ld / lld / link.exe
- GAS → ld / lld / link.exe
- MASM → link.exe
- YASM → ld / lld / link.exe
RASM performs the entire process on its own.
-
JIT compilation: RASM has JIT compilation, which means that you can run your code without compiling it into an executable file.
- Library: You can connect librasm to your Cargo.toml, and use RASM through simple function calls!
- Minimum dependencies: The entire workspace uses only 3 external dependencies.
- Errors and Diagnostics: Errors look in rustc/clang style.
Let's write a simple program that outputs "Hello, world!" to the terminal.
Save this code to main.s:
.import kernel32.dll GetStdHandle
.import kernel32.dll WriteFile
.data
msg:
.ascii "Hello, world!\r\n"
written:
dd 0
.text
_start:
sub rsp, 40
mov rcx, -11
call GetStdHandle
mov rcx, rax
lea rdx, [rip + msg]
mov r8, 15
lea r9, [rip + written]
mov qword [rsp + 32], 0
call WriteFile
add rsp, 40
mov rax, 0
ret
Next, run the program:
# Using the JIT compiler:
rasm run main.s
# Using the AOT compiler:
rasm build main.s
# Then run the compiled file:
./main.exeSave the code below to a file named main.s:
_start:
jmp print
msg:
.ascii "Hello, world!\n"
print:
mov rax, 1
mov rdi, 1
lea rsi, [rip + msg]
mov rdx, 14
syscall
mov rax, 60
xor rdi, rdi
syscall
Next, run the program:
# Using the JIT compiler:
rasm run main.s
# Using the AOT compiler:
rasm build main.s
# Then run the compiled file:
./mainSupported formats for executable files.
| Format | Platform |
|---|---|
| ELF64 | Linux |
| Mach-O | macOS |
| PE32+ | Windows |
| Opportunity | RASM | NASM | FASM | MASM |
|---|---|---|---|---|
| Intel syntax | ✅ | ✅ | ✅ | ✅ |
| Direct generation of ELF64 executable files | ✅ | ❌ | ✅ | ❌ |
| Direct generation of PE32+ executable files | ✅ | ❌ | ✅ | ❌ |
| Built-in emitter | ✅ | ❌ | ✅ | ❌ |
| JIT execution | ✅ | ❌ | ❌ | ❌ |
| The official library API | ✅ | ❌ | ✅ | ❌ |
The main difference between RASM and NASM, FASM and MASM is built-in emitter, JIT execution and the ability to use as libraries.
The development of RASM is actively continuing.
Download Options RASM:
Download the latest RASM version for your OS from Github Releases.
If you have Linux/macOS, make the file executable:
chmod +x rasm
./rasm -v-
Clone the repository (you need git) and go to the working directory
git clone https://github.com/dev-er1/rasm.git cd rasm -
Compile the workspace and remove the RASM from the
targetcargo build --release # Here you need to get the binary to your current directory so that the following command will work for you. ./rasm -v -
Add to the PATH (optional)
So that you can run RASM from any folder by simply writing
rasm, add the binary file to the environment variables of your OS:-
If you have Linux/macOS:
Add a line to your configuration file (for example,
~/.bashrcor~/.zshrc):export PATH="$PATH:/path/to/folder/with/rasm"
-
For Windows:
Run the command in PowerShell as an Administrator:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";С:\path\to\rаѕm ", "User")
(After that, restart the terminal)
-
Documentation— documentation.Contributing— the rules of contributing.CoC— standards of behavior in the Issue/Discussions.Architecture— architecture documentation.Security policy— security policy.ChangelogNOTICE— third-party attributions and license references.Third-Party Licenses— license texts of bundled dependencies.To Do list

