Skip to content

Instantly share code, notes, and snippets.

@typewriter
Created June 13, 2021 13:27
Show Gist options
  • Save typewriter/fb4e5f257aec0787aead76c395c4d1aa to your computer and use it in GitHub Desktop.
Save typewriter/fb4e5f257aec0787aead76c395c4d1aa to your computer and use it in GitHub Desktop.
x86 Linux Assembly
; NASM x86
global _start
_start:
mov eax, 2
mov edx, 1
add edx, eax ; 3
add edx, '0' ; '3'
mov [sum], edx
; write system call
mov eax, 4 ; write
mov ebx, 1 ; fd (STDOUT)
lea ecx, [sum] ; *buf
mov edx, 1 ; count (1 byte)
int 0x80
; exit system call
mov eax, 1 ; exit
mov ebx, 0 ; status (0)
int 0x80
section .bss
sum resb 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment