现在的位置: 首页 > 综合 > 正文

汇编的hello world

2014年01月01日 ⁄ 综合 ⁄ 共 426字 ⁄ 字号 评论关闭

调用linux system call

.section .rodata

output:

        .string  "Hello, World/n"

.section .text

.globl _start

       nop

       movl $4, %eax

       movl $1, %ebx

       movl $output, %ecx

       movl $13, %edx

       int $0x80

       movl $1, %eax

       movl $0, %ebx

       int $0x80

使用c的函数printf

.section .rodata

output:

        .string "Hello, World/n"

.section .text

.globl _start

         nop

         pushl $output

         call printf

         addl $4, %esp

         pushl $0

         call exit

【上篇】
【下篇】

抱歉!评论已关闭.