Created
November 26, 2023 07:53
-
-
Save pacifiquem/095e7a755d16bce969ce41a620e388e2 to your computer and use it in GitHub Desktop.
Hello World in 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
section .data | |
hello db 'Hello, World!',0 | |
section .text | |
global _start | |
_start: | |
; write the string to stdout | |
mov eax, 4 ; system call number for sys_write | |
mov ebx, 1 ; file descriptor 1 is stdout | |
mov ecx, hello ; pointer to the string | |
mov edx, 13 ; length of the string | |
int 0x80 ; call kernel | |
; exit the program | |
mov eax, 1 ; system call number for sys_exit | |
xor ebx, ebx ; exit code 0 | |
int 0x80 ; call kernel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment