Linux下最简单的汇编程序
2008-06-30 21:13
295 查看
.data
msg :.string "Hello World!"
len = . - msg
.text
.global _start
_start:
movl $len, %edx
movl $msg, %ecx
movl $1, %ebx
movl $4, %eax
int $0x80
movl $0,%ebx
movl $1,%eax
int $0x80
存为hello.s
然后:as -o hello.o hello.s(汇编成.o文件)
然后:ld -s -o hello hello.o(链接成可执行文件)
然后运行:./hello
呵,OK了!
msg :.string "Hello World!"
len = . - msg
.text
.global _start
_start:
movl $len, %edx
movl $msg, %ecx
movl $1, %ebx
movl $4, %eax
int $0x80
movl $0,%ebx
movl $1,%eax
int $0x80
存为hello.s
然后:as -o hello.o hello.s(汇编成.o文件)
然后:ld -s -o hello hello.o(链接成可执行文件)
然后运行:./hello
呵,OK了!
相关文章推荐
- Linux操作系统的简单指令及如何使用vim编写一个程序,然后使用gcc查看【预处理】、【编译】、【汇编】、【链接】各阶段文件的内容。
- Linux下最简单的汇编程序
- Linux下的一个简单汇编程序, .long声明数据的长度问题!
- Linux下的一个简单汇编程序, .long声明数据的长度问题!
- Linux内核分析课程--通过反汇编一个简单的c程序,分析汇编代码并理解计算机如何工作的
- Linux下简单的取点阵字模程序
- 一个简单的linux下c语言的计时程序(供新手参考)
- 反汇编一个简单的C程序
- 个简单C++程序反汇编解析 (Rev. 3)
- Linux上简单的meego开发QT程序
- linux下java程序与C语言程序通过SOCKET通信的简单例子
- 和菜鸟一起学linux之GCC内嵌汇编简单实例
- 学习笔记:linux下java 程序打包成jar简单hello world
- linux汇编之——(1)ELF:Linux可执行程序文件格式
- 简单的STM32 汇编程序—闪烁LED
- linux平台学x86汇编(五):使用gdb调试汇编程序
- linux程序设计之线程、进程和程序的简单比较
- 深入理解计算机系统读书笔记之一个简单汇编程序的调试分析
- 深入了解汇编的第一个简单程序(对初学者很重要)
- linux 下简单的ftp客户端程序