-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.asm
More file actions
24 lines (19 loc) · 830 Bytes
/
hello.asm
File metadata and controls
24 lines (19 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; ********************************************************************************
; "Hello, World!" Program
; ********************************************************************************
section .data
sMsg db "Hello, world!", 0xA ; message with newline character
lMsg equ $-sMsg ; length of the message
section .text
global _start
_start:
; write the message to stdout
mov eax, 4 ; system call for write
mov ebx, 1 ; file descriptor for stdout
mov ecx, msg ; pointer to message to write
mov edx, len ; length of message
int 0x80 ; invoke the system call
; exit with success status
mov eax, 1 ; system call for exit
xor ebx, ebx ; exit status of 0
int 0x80 ; invoke the system call