June 8th Friday (六月 八日 金曜日)

   The purpose of R14 in ARM chip.  The R13 register usually is used to save a stack point.
The R14 register is used to save a copy of content of R15 which is PC register.

  Before calling a subroutine R14 save the return address of a subroutine, the content of R15
is saved to R14 -- LR.

  MOV PC, LR
  BX LR

  Now, the content of R14 saved is just the return address of a routine.  When returning from
a subroutine, restore the address from R14 into R15.

  The ARM chip has 37 registers.  R0 ~ R7, there 8 registers, they are used to common registers.
From R8 to R12, there are twenty register.  Why?  When being at 'fiq' mode, from R8 to R12, every
register must use R8_fiq ... register.  As matter of a fact, each register has two register,
Rx or Rx_fiq.

  The R13 and R14 is also similar to R8.  However, each of them has more brother registers.  At
'usr' and 'sys' mode, R13 and R14 is still R13, R14.  Except for those two modes, there are R13_<mode>,
R14_<mode>, <mode> includes 'usr', 'fiq', 'irq', 'svc', 'abt' or 'und' modes.

  At every mode, ARM chip has respectively R13 as SP register.  So, R13 usually is initialized
to save the address of a stack for an application.

  The SPSR also has own five mode registers.  They are SPSR_fiq, SPSR_abt, SPSR_abt, SPSR_irq,
SPSR_und.  The SPSR abbreviate for "Saved Program Status Register".  It is used to save a copy of
the content of CPSR -- Current Program Status Register.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值