Code · 1 file
Sample Assembly File
x86-64 assembly for Linux in GNU as (Intel syntax), making two system calls. The Assembly sample is a small program — a customer record, a VIP check and a formatted total — that is the same in every language we offer, so you can compare them side by side.
Assembly · 610 B
Sample x86-64 assembly file
An idiomatic x86-64 assembly example: a customer record type, a VIP check, a total and a formatted loop — the same program in every language we offer.
CC0 · free for any use · Verified by an independent tool · Report a problem
# Sample x86-64 Linux assembly (GNU as, Intel syntax) — samplefiles.com
# Build: as -o hello.o hello.s && ld -o hello hello.o
.intel_syntax noprefix
.section .data
msg: .ascii "Hello from samplefiles.com\n"
.set msglen, . - msg
.section .text
.globl _start
_start:
mov rax, 1 # sys_write
mov rdi, 1 # stdout
lea rsi, [rip + msg]
mov rdx, msglen
syscall
mov rax, 60 # sys_exit
xor rdi, rdi # status 0
syscallFile details
Download from the command line
curl -L -o hello.s https://files.samplefiles.com/code/asm/hello.swget https://files.samplefiles.com/code/asm/hello.shttps://files.samplefiles.com/code/asm/hello.sprintf '%s %s\n' ea08d32b296b5335e73a9499f4508891a7bfc4237d230aaca2ef0e84295a909b hello.s | shasum -a 256 -cOr check the download in your browser with the checksum calculator.