June 25th Monday (六月 二十五日 月曜日)

本文详细介绍了ARM架构中异常处理的优先级顺序,并解释了四种不同的指令跳转方式,包括简单的B指令、带有返回地址保存的BL指令、状态切换的BLX指令以及直接跳转到指定地址的BX指令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

   At ARM chip when more than one exception occur, how to deal with them? Or is there
a sequence of deal with exceptions?  Yes, there is a priority of deal with that similar
situtation.


  There is a table following.  It list the priority of exceptions.

1(the highest level)          reset
2                               abt (data)
3                               fiq
4                               iqr
5                               abt (instrucion)
6(the lowest level)             und, swi

  Jump Instructions

  There are two ways to implement a instruction flow jumping.
  1) to use specified instructions;
  2) to put a address into the PC register.

  In the second way, you can implement jump out any where in a 4GB space.  Before jumping
out, you can use the instructions, such as MOV LR, PC, to save a return address, in order
to implement invoke a sub-procedure in 4GB liner address space.

  ARM instruct set supplies 4 jump instructions:

1. B
   B{conditon} destination
   It is the simplest jumping instruction.  Meetting it, ARM chip immediately jump to the
"destination".  Notice that the value in the "B" instruction is not an absoluate addressing
but an relative addressing to PC register.

  B Label
  CMP R1, #0
  BEQ Label

2. BL
   BL{conditon} destination
   Before jumping, the content of PC can be saved into the R14 register.  So, it can be used
to implement invoking a sub procedure and return from that sub procedure.

3. BLX
   BLX destination
   Before jumping, change the status of chip from ARM into Thumb, at once the content of PC is
saved into the R14 register.  When a sub procedure use Thumb instructions, a caller use ARM
instructions, the "BLX" implement to switch the status between them.  It is a bridge between these
two statuses.

4. BX
   BX destination
   It just jump to a specified address at where is an ARM instruction or a Thumb instruction.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值