A Modern, Multi-Arch, Flat-Binary Assembly → Intel HEX Converter
asm2hex is a cross-platform, multi-threaded tool that converts assembly (.asm) files into Intel HEX (.hex) format using a flat-binary approach (nasm -f bin + objcopy -I binary -O ihex). It features a modern GUI (via egui & eframe), auto-insert [bits X], color-coded logs, and multi-file concurrency.
- Flat-Binary (no OS-specific linking)
- Bits Mode (16/32/64)
- Auto Insert
[bits X]if missing - Multi-File concurrency + real-time progress bar
- Color-Coded Logs (Errors, Warnings, Success)
- Full
.hexPreview (no line cutoff) - Dark/Light Theme toggle
- Cross-Platform (Windows, Linux, macOS)
1) Install Rust
2) Install nasm + objcopy
- Windows:
scoop install nasm binutils(or Chocolatey) - Linux (Debian/Ubuntu):
sudo apt-get install nasm binutils - macOS:
brew install nasm binutils
git clone https://github.com/YourGitHubUser/asm2hex.git
cd asm2hex
cargo build --release``
This creates a binary in:
target/release/asm2hex(.exe)
You can run this tool in two ways:
# Windows:
target\release\asm2hex.exe
# Linux/Mac:
./target/release/asm2hexA GUI window opens. From there, you add .asm files, choose bits mode, select output folder, and click "Convert to HEX".
Currently, this tool is primarily GUI-based, but if you'd like to run it in a terminal (for testing or scripts):
# (Not actively maintained, but you could pass arguments if implemented.)
# Example:
target\release\asm2hex --help(If you want a full CLI, you'd add argument handling in main.rs. By default, the code runs as a GUI.)
- Launch the Tool: Double-click the
.exe(on Windows) or run./asm2hexon Linux/macOS. - Add
.asmFiles: Click "Add .asm Files" in the side panel. - Choose Bits Mode: 16, 32, or 64.
- Check "Auto-insert [bits X]" if your
.asmlacks a[bits ...]line. - Select Output Folder: Where
.bin&.hexwill be saved. - Convert: Click "⚡ Convert to HEX". See:
- Progress Bar for multi-file concurrency.
- Color-coded Logs for errors or success messages.
- Full
.hexcontent in the central panel.
Below is a sample 64-bit code (hello.asm):
[bits 64]
section .text
global _start
_start:
mov rax, 1 ; sys_write
mov rdi, 1 ; stdout
mov rsi, message
mov rdx, message_len
syscall
mov rax, 60 ; sys_exit
xor rdi, rdi
syscall
section .data
message db "Hello, asm2hex!", 0xA
message_len equ $ - messageAfter building, Add hello.asm in the GUI, pick 64-bit, choose an output folder, and click "Convert to HEX". The logs panel will show:
🔍 Processing hello.asm
✅ Success! HEX saved at ...
The central panel displays the entire Intel HEX output.
-
Does it support ARM instructions?
- Yes, as long as
nasmcan assemble them in flat-binary mode. Typically x86/AMD64 is best supported.
- Yes, as long as
-
Why no OS Linking?
- We use
-f binfor a pure flat-binary approach. No PE/ELF, so no high memory addresses or out-of-range issues.
- We use
-
Where do the
.binand.hexfiles go?- Inside the output folder you chose in the GUI side panel.
-
Can I run it headlessly?
- Currently, we provide a GUI. If you want a pure CLI, you can adapt
main.rsto parse arguments.
- Currently, we provide a GUI. If you want a pure CLI, you can adapt
We welcome PRs for:
- New Features (CLI mode, custom linker flags, advanced logs, etc.)
- Bug Fixes or UI Enhancements
- Fork the repo and create a branch.
- Commit & push changes.
- Submit a pull request with details.
This project is released under the MIT License.
Enjoy a frictionless Assembly → HEX workflow! Contributions & feedback are welcome.