my first assembly program

作者在 2010-12-18 22:20:39 发布以下内容

#hello.s printf "hello world"
.data

#define string "hello world"
hw: .ascii "Hello world.\n"

.text
.global _start
_start:
#EAX contains the system call value
#EBX contains the file descriptor to write to
#ECX contains the start of the string
#EDX contains the length of the string
movl $4, %eax
movl $1, %ebx
movl $hw, %ecx
movl $14, %edx
int $0x80

#exit program
movl $1, %eax
movl $0, %ebx
int $0x80


汇编 | 阅读 946 次
文章评论,共0条
游客请输入验证码