asm (1) helloworld

来源:互联网 发布:怎样用mysql创建数据库 编辑:程序博客网 时间:2024/06/06 03:07

  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



0 0
原创粉丝点击