天天看點

asm (1) helloworld

  section .data

hello: db 'hello','world'

len: equ $-hello      

section .text

global:  _start     ;_start for linker use  指定函數入口

_start:

mov eax , 4   ;  system call number (sys_write)

mov ebx , 1    ; file descriptor (stdout)

mov ecx  , hello   ;message to write

mov edx , len       ;message length

int  0x80               ;call kernel

mov eax , 1     ;system call exit

int 0x80