Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
x86-64 assembly is what actually runs on virtually every modern laptop and server, and NASM is the assembler most tutorials, university courses, and security training use to write it. In 64-bit Linux you invoke the kernel with the dedicated syscall instruction, pass arguments in rdi, rsi, and rdx per the System V AMD64 ABI, and work with sixteen general-purpose registers instead of eight. Understanding this layer pays off in debugging, performance work, and reverse engineering. This page assembles and links your 64-bit NASM source and runs the binary in a live terminal, so you can iterate on register logic and syscalls in seconds without configuring ld or a Linux VM.
section .data
banner db "Hello from 64-bit assembly!", 0xA
blen equ $ - banner
ask db "Type something and press Enter: ", 0
asklen equ $ - ask
section .bss
buf resb 64
section .text
global _start
_start:
mov rax, 1 ; sys_write
mov rdi, 1 ; stdout
mov rsi, banner
mov rdx, blen
syscall
mov rax, 1
mov rdi, 1
mov rsi, ask
mov rdx, asklen
syscall
mov rax, 0 ; sys_read
mov rdi, 0 ; stdin
mov rsi, buf
mov rdx, 64
syscall
mov rdx, rax ; bytes read
mov rax, 1 ; echo it back
mov rdi, 1
mov rsi, buf
syscall
mov rax, 60 ; sys_exit
xor rdi, rdi
syscall
64-bit NASM is the working dialect for modern systems courses, OS development from tutorials like the osdev wiki, and binary exploitation practice where CTF challenges assume the System V calling convention. Performance engineers read compiler output in this syntax when tuning hot loops, and malware analysts and reverse engineers drill on register usage patterns here before opening a disassembler. It is also the natural next step after the 32-bit page for students comparing int 0x80 against the faster syscall instruction and the changed syscall numbering.
Call sys_read: rax set to 0, rdi to 0 for stdin, rsi pointing at a .bss buffer, rdx holding the maximum byte count, then syscall. The live terminal keeps the call blocked until you press Enter, and rax returns the number of bytes read, which the example above reuses to echo your input back.
The x86-64 Linux ABI was renumbered from scratch: write is 1, read is 0, and exit is 60, versus 4, 3, and 1 under int 0x80. Arguments also move from ebx/ecx/edx to rdi/rsi/rdx, and you use the syscall instruction rather than a software interrupt. Mixing the two conventions is the most frequent porting bug.
This environment links your object standalone with _start as the entry point, so raw kernel syscalls are the supported I/O path and libc symbols are not linked in. That constraint is actually clarifying for learning: everything your program does is visible in the source, with no runtime initialization happening behind your back.
main.asmgassys_read syscall; NASM 64-bit Assembly
section .data
msg db "Hello from NASM 64-bit!", 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