as 汇编器
2024-10-01 04:03:21
[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
最新文章
- SqlServer基础之(触发器)
- 史上最详细“截图”搭建Hexo博客——For Windows
- javascript向上向下取整
- 引水入城(codevs 1066)
- SQL中的事物【转】
- identifier not found error on function call
- 一句话解释JVM中空间分配担保的问题
- mac github工具将命令当下来的代码拖入macgithub中就可以
- BS4爬取糗百
- BZOJ 3787: Gty的文艺妹子序列 [分块 树状数组!]
- List转换成JSON对象报错(三)
- Kong(V1.0.2) Securing the Admin API
- Spark sql 在yarn-cluster模式下找不到表
- 【mmall】mybatis三剑客
- .NET 常用ORM之Gentle.Net
- zabbix 监控项(key)
- 【java编程】格式化字符串
- VirtualBox虚拟机安装ubuntu系统(图文详解)
- sqlserver 统计信息自动更新 ----trace flag 2371
- [LeetCode] Remove Element题解