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 ...
随机推荐
- CF3A 【Shortest path of the king】
一句话题意:在8 * 8的棋盘上,输出用最少步数从起点走到终点的方案 数据很小,可以广搜无脑解决 定义数据结构体 struct pos{ int x,y,s; //x.y表示横纵坐标,s表示步数 ]; ...
- python图片处理(一)
在matlab中有相应的图像进行二值化处理,并且标记连通区域 L = bwlabel(BW,n) 返回一个和BW大小相同的L矩阵,包含了标记连BW中每个连通区域的类别标签,标签的值是1.2.num(连 ...
- springMVC源码分析--HttpMessageConverter写write操作(三)
上一篇博客springMVC源码分析--HttpMessageConverter参数read操作中我们已经简单介绍了参数值转换的read操作,接下来我们介绍一下返回值的处理操作.同样返回值的操作操作也 ...
- 使用T-SQL导入多个文件数据到SQL Server中
在我们的工作中,经常需要连续输入多个文件的数据到SQL Server的表中,有时需要从相同或者不同的目录中,同时将文件中的数据倒入.在这篇文章中,我们将讨论如何同时把一个目录中的文件的数据倒入到SQL ...
- [新手]在macOS环境下安装xdebug
使用环境 masOS 10.12 使用MAMP安装的PHP环境 在新安装的系统中,安装xdebug,遇到了一些小问题; P.S. 重新按照xdebug官网的指南安装了一次,把上次安装失败的xd ...
- 什么是 CLR(转)
CLR(公用语言运行时)和Java虚拟机一样也是一个运行时环境,它负责资源管理(内存分配和垃圾收集),并保证应用和底层操作系统之间必要的分离..NET提供了一个运行时环境,叫做公用语言运行时(Comm ...
- ffmpeg 添加filter步骤
a). 自己写一个XXX.c文件,比如vf_transform.c,放在libavfilter目录下.代码可以参考其他filter: b) 在libavfilter/allfilters.c添加一行: ...
- C# 中从网络上下载文件保存到本地文件
下面是C#中常用的从Internet上下载文件保存到本地的一些方法,没有太多的技巧. 1.通过 WebClient 类下载文件 WebClient webClient = new WebClien ...
- 洛谷P2525 Uim的情人节礼物·其之壱 [康托展开]
题目传送门 Uim的情人节礼物·其之壱 题目描述 情人节到了,Uim打算给他的后宫们准备情人节礼物.UIm一共有N(1<=N<=9)个后宫妹子(现充去死 挫骨扬灰!). 为了维护他的后宫的 ...
- 2333: [SCOI2011]棘手的操作[我不玩了]
2333: [SCOI2011]棘手的操作 Time Limit: 10 Sec Memory Limit: 128 MBSubmit: 1979 Solved: 772[Submit][Stat ...