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