Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does `b .` mean in this ASSEMBLY code?

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.

like image 229
UndercoverCoder Avatar asked Jan 03 '18 20:01

UndercoverCoder


People also ask

What does b mean in assembly code?

The B instruction causes a branchto label . The BL instruction copies the address of the next instruction into r14 (lr, the link register), and causes a branch to label . Machine-level B and BL instructions have a range of ±32Mb from the address of the current instruction.

What does b mean in ARM?

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.

What does b mean in MIPS?

b label Branch instruction Unconditionally branch to the instruction at the label. beq Rsrc1, Src2, label Branch on Equal Conditionally branch to the instruction at the label if the contents of register Rsrc1 equals Src2.

What is symbol in assembly language?

Symbol definition. An ordinary symbol is defined in: The name entry in a machine or assembler instruction of the assembler language. One of the operands of an EXTRN or WXTRN instruction.


1 Answers

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
like image 103
Martin Rosenau Avatar answered Nov 07 '22 19:11

Martin Rosenau