指令 | 描述 | 示例 | |
---|---|---|---|
数据交换指令 | xchg | ||
bswap | |||
xadd | |||
cmpxchg8b |
gcc -pg test.c -o test ./test (产生gmon.out简档文件) gprof test > result.txt (gprof自动调用gmon.out,产生报告result.txt)
as --32 $^ -o obj.o ld --dynamic-linker /lib/ld-linux.so.2 -L/usr/lib32 -lc -m elf_i386 obj.o
;示例1(数据段) .section .data output: .ascii "The processor Vendor ID is 'xxxxxxxxxxxx'\n" pi: .float 3.1415926 sizes: .long 100, 150, 30, 100 ;示例2(只读数据段) .section .rodata output: .ascii "The processor Vendor ID is 'xxxxxxxxxxxx'\n"
命令 | 数据类型 | 示例 |
---|---|---|
.ascii | 文本字符串 | |
.asciz | 以空字符结尾的文本字符串 | |
.byte | 字节值 | |
.double | 双精度浮点数 | |
.float | 单精度浮点数 | |
.int | 32位整数 | |
.long | 32位整数(同.int) | |
.octa | 16字节整数 | |
.quad | 8字节整数 | |
.short | 16位整数 | |
.single | 单精度浮点数(同.float) | |
.fill | 拷贝填充类型 | .fill repeat, size(1), value(0) |
;定义 .equ LINUX_SYS_CALL, 0x80 ;使用 movl $LINUX_SYS_CALL, %eax
;定义 .section .bss .comm buffer, 1024 .lcomm lbuffer, 1024
movl:32位长字值 movw:16位宽字值 movb:8位字节值 movs:字符串内存之间传送 movm: cmov:
eax: ebx: ecx: edx: edi: esi: ebp: esp: