Working and commented.
This commit is contained in:
parent
4a7fa5a427
commit
f1328af5d6
10
hello32.s
10
hello32.s
|
@ -3,7 +3,7 @@
|
|||
;; Link with: ld -m elf_i386 -o hello hello.o
|
||||
;; Run with: ./hello
|
||||
|
||||
;; sys/syscall.h
|
||||
;; sys/unistd_32.h
|
||||
%define SYS_write 4
|
||||
%define SYS_exit 1
|
||||
|
||||
|
@ -17,14 +17,14 @@ section .text
|
|||
global _start
|
||||
|
||||
_start:
|
||||
mov edx, 26d ; Length of the message
|
||||
mov ecx, msg ; Address of the message
|
||||
mov edx, 26d ; Length of the message. The 'd' means 'decimal'
|
||||
mov ecx, msg ; Address of the message (not the content)
|
||||
mov ebx, STDOUT ; using STDOUT (see definition above)
|
||||
mov eax, SYS_write ; Using WRITE in 32-bit mode?
|
||||
int 80h
|
||||
int 80h ; Interrupt target. The 'h' means 'hexidecimal'
|
||||
|
||||
mov ebx, 0
|
||||
mov eax, SYS_exit
|
||||
int 80h
|
||||
int 80h
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue