GNU汇编 伪指令

伪指令 本身并没有所对应的机器码

它只是在编译的时候起作用,或者转换为其他的实际指令来运行

global

ascii

byte

word

data

equ

align

@ 下面的例子是在数据段存放数据

.section .data

            hello:

            .ascii "helloworld"

           bh:

           .byte 0x1

           ADD

          .word 0xff

.section .bss

       <未初始化的数据>

.section .text

.globl  _start

_start:

     <汇编代码>

.equ  DA, 0x89

mov r0,#DA

操作类伪指令

nop

反汇编看实质:mov r0,r0

ldr

mov 指令的立即数不能超过8位 (shift 12 位,其中4位作为左移右移的位)

ldr r0, =0x1ff

ldr 反汇编后,会发现其实是在内存里面定义了一个.word 的变量

然后通过 ldr r0, [PC,#-4]

反汇编: arm-linux-objdump -O -S xxx.elf

原文地址:https://www.cnblogs.com/qifei-liu/p/10176770.html