调用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
本文介绍了一个简单的Linux程序示例,该程序通过直接调用系统调用和服务库函数(如printf)来显示“Hello, World”。两种实现方式分别展示了如何在不依赖标准库的情况下使用汇编指令进行系统调用,以及如何利用C语言的标准输出函数。
2125

被折叠的 条评论
为什么被折叠?



