diff options
| author | Arslaan Pathan <[email protected]> | 2026-06-06 10:47:26 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-06-06 10:47:26 +1200 |
| commit | d02fff2ba2faede9e68661a398b44ca2a7e14f17 (patch) | |
| tree | 06dd0b7dc3da2ccb86fff6dcf9ab64f0aec9b8cb | |
| parent | 0076647c2d5eb420a27527c5b4fd2201181789bc (diff) | |
| download | x86-asm-d02fff2ba2faede9e68661a398b44ca2a7e14f17.tar.xz x86-asm-d02fff2ba2faede9e68661a398b44ca2a7e14f17.zip | |
Hello world
| -rw-r--r-- | main.asm | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,6 +1,17 @@ global _start +section .data ; defines a section + msg db "Hello, x86 Assembly Language!", 0x0a + len equ $ - msg ; subtract the location before the message (msg) from the location after the message ($) to get the length + +section .text _start: - mov eax, 1 - mov ebx, 42 - int 0x80 + mov eax, 4 ; sys_write syscall + mov ebx, 1 ; stdout file descriptor + mov ecx, msg ; bytes to write + mov edx, len ; number of bytes to write + int 0x80 ; perform syscall + + mov eax, 1 ; sys_exit syscall + mov ebx, 0 ; exit status 0 + int 0x80 ; perform syscall |
