From d02fff2ba2faede9e68661a398b44ca2a7e14f17 Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Sat, 6 Jun 2026 10:47:26 +1200 Subject: Hello world --- main.asm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 5fd8f3e..7d824c1 100644 --- a/main.asm +++ b/main.asm @@ -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 -- cgit v1.2.3