This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembler Branch instruction?

b .+2
B is Branch instruction but I don not understant what is .+2 and how many cycle use this instruciton.
I was looking for a book, but we can not tell anything nicely, you can recommend something

Parents
  • Dot '.' means the current address, similar to $ in x86 (jmp $+2)

    "B ." would be an infinite loop.

    "B .+2" would be a near branch on a 16-bit Thumb ISA, to the next instruction, probably for alignment purposes.

    How many cycles? On what architecture?

    The Cortex-M3/4 processors have a DWT_CYCCNT register in many implementations for the exact purpose of tuning and benchmarking code as written.

    Consider also RAM vs FLASH, wait states, caching, and prefetch paths.

    Start with the ARM TRM for the core/architecture in question

Reply
  • Dot '.' means the current address, similar to $ in x86 (jmp $+2)

    "B ." would be an infinite loop.

    "B .+2" would be a near branch on a 16-bit Thumb ISA, to the next instruction, probably for alignment purposes.

    How many cycles? On what architecture?

    The Cortex-M3/4 processors have a DWT_CYCCNT register in many implementations for the exact purpose of tuning and benchmarking code as written.

    Consider also RAM vs FLASH, wait states, caching, and prefetch paths.

    Start with the ARM TRM for the core/architecture in question

Children