Online Assembly Compiler
Assemble and run x86-64 assembly online with NASM 2.16. Press Run and your file is assembled with nasm -f elf64, linked with ld and started on Linux, with assembler errors shown by line if something is wrong. Programs talk to Linux directly through system calls, so they can read the input you type and write output.
How to run Assembly code online
- This page opens with Assembly selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
NASM 2.16 on Online IDE
- Your file is assembled with NASM for 64-bit Linux (nasm -f elf64) and linked with ld, without the C library.
- The program starts at _start, declared with global _start in section .text.
- Call Linux with syscall: the call number goes in rax (read is 0, write is 1, exit is 60) and the arguments in rdi, rsi and rdx.
- End with the exit call, or the processor runs on past your last instruction and the program crashes.
Example: an Assembly program that reads input
; Reads a line and writes it back, using Linux system calls.
section .data
prompt db "Type something: "
prompt_len equ $ - prompt
reply db "You typed: "
reply_len equ $ - reply
section .bss
buffer resb 256
section .text
global _start
_start:
mov rax, 1 ; write(1, prompt, prompt_len)
mov rdi, 1
mov rsi, prompt
mov rdx, prompt_len
syscall
mov rax, 0 ; read(0, buffer, 256)
mov rdi, 0
mov rsi, buffer
mov rdx, 256
syscall
mov rbx, rax ; the number of bytes read
cmp rbx, 0
jle done ; nothing read
mov rax, 1 ; write(1, reply, reply_len)
mov rdi, 1
mov rsi, reply
mov rdx, reply_len
syscall
mov rax, 1 ; write(1, buffer, rbx)
mov rdi, 1
mov rsi, buffer
mov rdx, rbx
syscall
done:
mov rax, 60 ; exit(0)
mov rdi, 0
syscall
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which assembler does Online IDE use?
NASM 2.16, assembling x86-64 code for Linux with nasm -f elf64. The object file is linked with ld.
Can I call printf or scanf?
No. The program is linked without the C library, so read and write with Linux system calls: put the call number in rax, the file descriptor in rdi, the buffer in rsi and the length in rdx, then use syscall.
Can I run MASM, TASM or 8086 code?
No. Only NASM syntax for 64-bit Linux works. DOS programs that use int 21h and Windows programs cannot run here, and MASM or TASM code has to be converted to NASM syntax.
How does an assembly program read input?
With the read system call: 0 in rax, file descriptor 0 in rdi, a buffer in rsi and its size in rdx. Type the input in the output panel and press Enter; rax then holds the number of bytes read, newline included.
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.