Created
June 13, 2021 13:27
-
-
Save typewriter/fb4e5f257aec0787aead76c395c4d1aa to your computer and use it in GitHub Desktop.
x86 Linux Assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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