Merge branch 'master' of git://github.com/Shark64/hello-world

local sync
This commit is contained in:
Shark
2015-12-24 00:32:16 +01:00

View File

@@ -3,17 +3,18 @@ section .text
_start: ;tell linker entry point
xor ebx, ebx
xor ebx,ebx ;ebx=0
mov ecx,msg ;address of message to write
lea edx,[ebx+len] ;message length
mov ecx,msg ;message to write
lea eax,[ebx+4] ;system call number (sys_write)
inc ebx ;file descriptor (stdout)
int 0x80 ;call kernel
mov al,1 ;system call number (sys_exit)
xor eax, eax ;set eax=0
inc eax ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
section .rodata
msg db 'Hello, world!',0xa ;our string
len equ $ - msg ;length of our string