as 汇编器
[root@localhost ~]# cat .s
.file "write.s"
.section .rodata
hello: .string "hello, world!\n" .section .text
.global _start _start:
movl $, %eax # syscall number for write function
movl $, %ebx # standand for stdout
movl $hello, %ecx # the second argument of write function
movl $, %edx # the third argument of write function
int $0x80 # interrupt to call write
movl $, %eax # syscall number for sys_exit function
xorl %ebx, %ebx # the argument for sys_exit function
int $0x80 # interrupt to call sys_exit ret # return to the caller of the function
编绎:
as -o 1.o 1.s
链接:
ld -o 1 1.o
执行:
[root@localhost ~]# ./1
hello, world!
Usage: objdump <option(s)> <file(s)>
Display information from object <file(s)>.
At least one of the following switches must be given:
-a, --archive-headers Display archive header information
-f, --file-headers Display the contents of the overall file header
-p, --private-headers Display object format specific file header contents
-h, --[section-]headers Display the contents of the section headers
-x, --all-headers Display the contents of all headers
-d, --disassemble Display assembler contents of executable sections
-D, --disassemble-all Display assembler contents of all sections
-S, --source Intermix source code with disassembly
-s, --full-contents Display the full contents of all sections requested
-g, --debugging Display debug information in object file
-e, --debugging-tags Display debug information using ctags style
-G, --stabs Display (in raw form) any STABS info in the file
-W, --dwarf Display DWARF info in the file
-t, --syms Display the contents of the symbol table(s)
-T, --dynamic-syms Display the contents of the dynamic symbol table
-r, --reloc Display the relocation entries in the file
-R, --dynamic-reloc Display the dynamic relocation entries in the file
@<file> Read options from <file>
-v, --version Display this program's version number
-i, --info List object formats and architectures supported
-H, --help Display this information
[root@localhost ~]# objdump -D ./.o ./.o: file format elf64-x86- Disassembly of section .text: <_start>:
: b8 mov $0x4,%eax
: bb mov $0x1,%ebx
a: b9 mov $0x0,%ecx
f: ba 0e mov $0xe,%edx
: cd int $0x80
: b8 mov $0x1,%eax
1b: db xor %ebx,%ebx
1d: cd int $0x80
1f: c3 retq
Disassembly of section .rodata: <hello>:
: 6c 6c 6f pushq $0x6f6c6c65
: 2c sub $0x20,%al
: 6f ja <_start+0x78>
: 6c jb <_start+0x77>
b: 0a and %ecx,%fs:(%rdx)
...
http://blog.csdn.net/geekcome/article/details/6216634
as 汇编器的更多相关文章
- CSAPP读书随笔之一:为什么汇编器会将call指令中的引用的初始值设置为-4
CSAPP,即<深入理解计算机系统:程序员视角>第三版,是一本好书,但读起来确需要具备相当的基本功.而且,有的表述(中译文)还不太直白. 比如,第463页提到,(对于32位系统)为什么汇编 ...
- 3.1 as86汇编器
在开始讲述as86汇编器前,这本书引用内核中bootsect.s框架程序汇编代码来解释,记录下这一小段代码中不理解的地方,下面是这段实例代码: .globl begtext, begdata, beg ...
- A51汇编器的解释
A51汇编器是运行于IBM PC系列及其兼容机上的交叉汇编软件,其主要功能是将MCS-51系列单片机汇编语言源程序翻译成符合Intel目标文件格式的可再定位的目标代码,经过L51连接器的连接和装配,产 ...
- KEIL的宏汇编器A51介绍
A51是一种具有通用特性和用法的重定位宏汇编器.它与Intel公司的MASM51宏汇编器具有很好兼容性,支持模块化编程,可以方便地与高级语言接口.A51宏汇编器支持汇编伪指令.宏处理指令以及汇编控制命 ...
- 29 A Quick Guide to Go's Assembler 快速指南汇编程序:使用go语言的汇编器简介
A Quick Guide to Go's Assembler 快速指南汇编程序:使用go语言的汇编器简介 A Quick Guide to Go's Assembler Constants Symb ...
- 【原创】NES第一波:如何用通用型6502宏汇编器,制用NES/FC游戏。
在163的博客关了呀.在这边重新开张了. 以后若网友有什么要长篇解答的问题,也在这儿作答. 作为第一波原创文章,我打算做一次小白示范.那就是一步一步的展示某个汇编编译器的用法. 一.科普 很多人认为程 ...
- 基于ARM处理器的反汇编器软件简单设计及实现
写在前面 2012年写的毕业设计,仅供参考 反汇编的目的 缺乏某些必要的说明资料的情况下, 想获得某些软件系统的源代码.设计思想及理念, 以便复制, 改造.移植和发展: 从源码上对软件的可靠性和安全性 ...
- ARM 汇编器对C的扩展
__swi void ledtest(); //:声明 edtest 是个软中断. __asm 内嵌汇编 //:通常在C程序里面需要嵌入汇编代码,这是就可以用__asm关键字 ...
- ARM的ADS汇编器和GCC汇编器
一:ads下的一段汇编程序: __main EXPORT BootReset BootReset B resetvec_reqset ...
随机推荐
- manacher模板
转自:http://blog.csdn.net/zzkksunboy/article/details/72600679 作用 线性时间解决最长回文子串问题. 思想 Manacher充分利用了回文的性质 ...
- Mysql建表语句
create table messages( id int unsigned primary key auto_increment, sender varchar(64) not null, gett ...
- Java工程师知识图谱
一.Java工程师知识图谱(思维导图版) 二.Java工程师知识图谱(图文版) 三.Java工程师知识图谱(文字版) http://note.youdao.com/noteshare?id=615da ...
- 20155225 2006-2007-2 《Java程序设计》第3周学习总结
20155225 2006-2007-2 <Java程序设计>第3周学习总结 教材学习内容总结 封装对象内部数据:使用private关键字定义类的私有成员 如果不使用private定义的话 ...
- Asp.net Vnext 自定义日志
概述 本文已经同步到<Asp.net Vnext 系列教程 >中] 可以通过自定义日志,把错误消息记录到数据库 实现 在启动文件Startup Configure方法中加入自定义的日志提供 ...
- WangSql 3.0源码共享(WangSql 1.0重大升级到3.0)
WangSql 1.0博文阅读: http://www.cnblogs.com/deeround/p/6204610.html 基于1.0做了以下重大改动: 1.多数据实现方式调整 2.使用EmitM ...
- wow.js中各种特效对应的类名(滚动效果)
1.wow.js依赖于animate.css,首先在头部引用animate.css或者animate.min.css. <link rel="stylesheet" type ...
- iconfont 在项目中的简单使用
font-class引用 font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题. 与unicode使用方式相比,具有如下特点: 兼容性良好,支持 ...
- 004 Ajax中传输格式为JSON
一: 1.介绍 2.嵌套 3.json解析 4.优缺点 二:json功能程序测试 1.设计 2.程序 <!DOCTYPE html> <html> <head> & ...
- CSU - 2062 Z‘s Array
Description Z likes to play with array. One day his teacher gave him an array of n elements, and ask ...