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

hello.s — first linesAssembly
# 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
        syscall

File details

Size
610 B (610 bytes)
MIME type
text/plain
SHA-256
ea08d32b296b5335e73a9499f4508891a7bfc4237d230aaca2ef0e84295a909b
MD5
8c4cd6f4e82c3464eb0a90a60575b04f

Download from the command line

curl -L -o hello.s https://files.samplefiles.com/code/asm/hello.s

Or check the download in your browser with the checksum calculator.