ARM Cortex-M branch instruction encoding

Publisher:EnchantedBreezeLatest update time:2020-01-07 Source: eefocusKeywords:ARM  Cortex-M Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

B.  -- Branch causes a branch to a target address

if ConditionPassed(cond) then
{

  EncodingSpecificOperations(PC, lable);

  BranchWritePC(PC + imm32);

}

// All versions of the Thumb instruction set

T1 : B : not allowed in IT block

T2 : B : outside or last in IT block

// All versions of the Thumb instruction set from Thumb-2 onwards.

T3 : B.W : not allowed in IT block

T4 : B.W : outside or last in IT block

Specifies the label of the instruction that is to be branched to.

The assembler calculates the required value of the offset 
from the PC value of the B instruction to this label, 
then selects an encoding that will set imm32 to that offset.

Allowed offsets are even numbers in the range

T1 : -256 to 254 : imm8

T2 : -2048 to 2046 : imm11

T3 : -1048576 to 1048574 : imm6 +  imm11 

T4 : -16777216 to 16777214 : imm10 +  imm11 

BX  -- Branch and Exchange causes a branch to an address and instruction set specified by a register.

T1 : BX  // Outside or last in IT block

BLX (register) -- Branch and Exchange calls a subroutine at an address and instruction set specified by a register.

T1 : BLX  // Outside or last in IT block

BL, BLX (immediate) -- Branch with Link (immediate) calls a subroutine at a PC-relative address.

T1 : BL

T2 : BLX

 

Keywords:ARM  Cortex-M Reference address:ARM Cortex-M branch instruction encoding

Previous article:Cortex-M3 and Cortex-M4 Memory Organization
Next article:IAR cortex-M3 + ucos-III problem set

Recommended ReadingLatest update time:2024-11-15 16:39

When Apple iPhone 5 ARM processor was sued by a troll patent lawsuit
Beijing time, November 24th, according to Apple's patent blog PatentlyApple, a company called Vantage Point Technology (hereinafter referred to as "Vantage") recently filed a lawsuit with the Eastern District Court of Texas, accusing Apple of infringing a patent technology held by it with multiple iPhone and iPad devi
[Analog Electronics]
S3c2440ARM exception and interrupt system detailed explanation 5---_swi exception model program example
In this section we will demonstrate the processing flow of swi swi software interrupt: software interrupt In the previous video, we talked about ARMCPU has 7 modes (the figure below shows 7 modes). Except for user mode, the other 6 are privileged modes. These privileged modes can directly modify CPSR to enter othe
[Microcontroller]
S3c2440ARM exception and interrupt system detailed explanation 5---_swi exception model program example
ARMv8 instruction learning (2)
1. UXTB ---- Unsigned extend byte     UXTB Wd , Wn is equivalent to UBFM Wd , Wn ,#0,#7     即:Wd = ZeroExtend(Wn 7:0 )             Take a byte from Wn, assign it to Wd, and fill the upper 3 bytes of Wd with 0. 2. UXTH ---- Unsigned extend halfword     UXTB Wd , Wn is equivalent to UBFM Wd , Wn ,#0,#15     即:
[Microcontroller]
To ensure the security of trillions of IoT, Arm is playing a big game
In October 2017, Arm launched the PSA (Platform Security Architecture) platform security architecture for IoT security, with the vision of protecting the security of trillions of connected devices in the future. Rob Coombs, director of Arm's emerging business unit, said at the Arm PSA Security Architecture Technology
[Internet of Things]
To ensure the security of trillions of IoT, Arm is playing a big game
Design of wireless audio and video intercom system based on ARM Linux
With the advent of the digital and networking era, especially the development of broadband wireless networks, it provides an opportunity for the application of large data transmission services such as audio and video on wireless networks. At the same time, due to the unique sensory characteristics of audio and video, t
[Microcontroller]
Design of wireless audio and video intercom system based on ARM Linux
What is the difference between PowerPC and X86 and ARM processor general architecture
In the embedded field, there are three common processor architectures: PowerPC, X86, and ARM. This article will compare and analyze these three architectures. The origin of PowerPC In 1975, IMB's 801 minicomputer project conducted many pioneering experiments in RISC machine architecture. The 801 computer and Berkele
[Microcontroller]
What is the difference between PowerPC and X86 and ARM processor general architecture
ARM embedded automotive digital virtual instrument design solution
This article mainly introduces the working mechanism of Fujitsu's system LSI chip MB86R01, as well as the functional characteristics of the ARM926EJ-S core, the image display controller (GDC), the in-vehicle communication function, and various media interfaces integrated on a single chip. The chip can process data fro
[Microcontroller]
ARM embedded automotive digital virtual instrument design solution
ARM Basics Tutorial 2: ARM Processor Registers
In the ARM system, there are usually three ways to control the execution flow of the program: During normal execution, the value of the program counter (PC) increases by 4 bytes for each ARM instruction executed; and the value of the program counter register (PC) increases by 2 bytes for each Thumb instruction execute
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号