I've used arm-none-eabi-objdump
to look at the internals of a crt0.o
file. To be specific, this is is one of the crt0.o
files that came packaged with the arm-none-eabi
toolchain.
I'm confused by the use of the beq
opcode near the start of the .text
section:
Disassembly of section .text:
00000000 <_stack_init>:
0: e10f4000 mrs r4, CPSR
4: e314000f tst r4, #15
8: 0a00001c beq 80 <_stack_init+0x80>
From the "Using as" manual (for as
, the GNU assembler) that came with the same toolchain:
beq *label*
:A polymorph instruction which is
jeq label
in case if jump distance within allowed range for cpu's jump instruction. If not, this unrolls into a sequence of
jne $+6
br label
jeq
is defined thus:
jeq %d,(%s|imm32),disp16
Jump if equal.
So the above use of beq
appears to result in jeq
being called with two opcodes instead of three, and one of those opcodes does not have a comma between it and its predecessor!
Can someone explain to me how this line of code is actually working, and what the jump is actually conditional on here?