So I'm looking into the source code for Redox OS (An operating system made with Rust) just to see if I can learn something.
I'm reading the assembly file start.s in the bootloader
folder. In the interrupt_vector_table
label we have:
interrupt_vector_table:
b . @ Reset
b .
b . @ SWI instruction
b .
b .
b .
b .
b .
What exactly is b .
?
I'm not a complete beginner in assembly, I just never came across this before.
The b
instruction for the ARM CPU is nearly the same as the jmp
instruction for the x86 CPU: A jump instruction
Using the GNU tool chain .
means: Address of the instruction itself.
So b .
is equal to:
temporaryLabel:
b temporaryLabel
or (for x86 CPUs):
temporaryLabel:
jmp temporaryLabel