Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the jump range of ARM instructions?

Shulou Source: shulou.com Published: 2022-06-01 22:31:39 10月03日 Update

This article mainly introduces the ARM instruction jump range, has a certain reference value, interested friends can refer to, I hope you read this article after a lot of gains, the following let Xiaobian take you to understand.

ARM instruction jump range

We know that ARM jump instructions (B) are range-limited (±32MB), but in many cases there is no guarantee that all exception handling functions are located within 32MB of the vector table, requiring long jumps greater than 32MB, and because of vector table space constraints can only be completed by one instruction. This can be done in two ways.

a) Immediate Jump (a) MOV PC, #imme_value

Assign the destination address directly to the PC register.

However, this instruction is limited by format and cannot handle arbitrary immediate numbers; it is legal only if the immediate number can be represented as an 8-bit value obtained by rotating right by even digits. For example:

MOV PC,#0x3000000;//is legal because 0x3000000 can be obtained by rotating 0x03 to the right by 4 bits. MOV PC, #30003000 ;//is an illegal command. b) Relative address jump (b) LDR PC, [PC+offset]

The target address is stored in a suitable address space, and then the 32-bit data on this memory unit is transferred to the PC to realize the jump.

This method does not require the destination address value, and can be any valid address. But the memory location storing the target address must be within ±4KB of the current instruction.

Note that when calculating offset values referenced in instructions, consider the effect of instruction prefetching on PC values in the processor pipeline.

Thank you for reading this article carefully. I hope that the article "How big is the ARM instruction jump range" shared by Xiaobian will help everyone. At the same time, I hope everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Tags: Instruction address range goal article storage space processing restriction legal unit can pass vector memory numerical value method loop appropriate effective middle finger Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Redmi Shulou Tech Info Shulou Information MariaDB