ASM linux helloworld
来源:互联网 发布:淘宝买iphone7 店铺 编辑:程序博客网 时间:2024/05/19 19:43
Sourcecode:(NASM hello.asm)
section .data;section declarationmsg db "Hello, world!",0xa;our dear stringlen equ $ - msg ;length of our dear stringsection .text;section declaration;we must export the entry point to the ELF linker or global _start;loader. They conventionally recognize _start as their;entry point. Use ld -e foo to override the default._start:;write our string to stdout mov edx,len ;third argument: message length mov ecx,msg ;second argument: pointer to message to write mov ebx,1 ;first argument: file handle (stdout) mov eax,4 ;system call number (sys_write) int 0x80;call kernel;and exitmovebx,0;first syscall argument: exit code mov eax,1 ;system call number (sys_exit) int 0x80;call kernel
Ubuntu:编译执行:
nasm -f elf hello.asm
ld --oformat elf32-i386 -m elf_i386 -o hello hello.o
./hello
结果:Hello, world!
- ASM linux helloworld
- ASM第一篇【HelloWorld】
- asm (1) helloworld
- 16位汇编(asm) helloWorld
- linux asm
- unable to open input file:helloworld.asm
- linux-asm.s
- linux下asm创建
- Linux ASM debug
- 【Linux】asm文件夹在那里
- 【Linux】asm文件夹在那里
- linux asm汇编例子
- 用汇编写的第一个程序---helloworld.asm
- 编译asm形式的helloworld在android下运行
- linux java jni helloworld
- Linux设备驱动程序:HelloWorld
- linux设备驱动--HelloWorld
- linux之helloworld编写
- 【xinfanqie】从测试数据看出你的密码是否安全
- cocos2d(二) scenes, layers, and nodes
- 如何使用 Windows Phone 的后退堆栈导航
- 网站性能测试:页面测试工具 + Web服务器压力测试工具
- 【xinfanqie】不为人知的Win7右键菜单添加功能
- ASM linux helloworld
- KMP
- 网站运营的十二条盈利模式
- OpenCV学习_1和总结
- 数据库的范式:1NF,2NF,3NF
- 二叉树
- Mule 官方例子研究
- android跳转流程控制
- DEELX 正则引擎编程示例:连续查找