(19)--3-1-4 ARM内部寄存器嵌入式系统原理.ppt
3C H A P T E R嵌入式微处理器嵌入式微处理器 在ARM9TDMI处理器内部有37个用户可见的寄存器。在不同的工作模式和处理器状态下,程序员可以访问的寄存器也不尽相同。3.1.4 ARM9的寄存器寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiq*R9(SB,v6)R9R9_fiq*R10(SL,v7)R10R10_fiq*R11(FP,v8)R11R11_fiq*R12(IP)R12R12_fiq*R13(SP)R13R13_svc*R13_abt*R13_und*R13_irq*R13_fiq*R14(LR)R14R14_svc*R14_abt*R14_und*R14_irq*R14_fiq*R15(PC)R15状态寄存器R16(CPSR)CPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiqARM状态各模式下的寄存器寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiqARM状态各模式下的寄存器SPSR_fiqSPSR_irqSPSR_undSPSR_abtSPSR_abtCPSRR15R14_fiqR14_irqR14_undR14_abtR14_svcR14R13_fiqR13_irqR13_undR13_abtR13_svcR13R12_fiqR12R11_fiqR11R10_fiqR10R9_fiqR9R8_fiqR8R7R6R5R4R3R2R1R0所有的37个寄存器,分成两大类:31个通用32位寄存器;6个状态寄存器。寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq无CPSRR15R14R13R12R11R10R9R8R7R6R5R4R3R2R1R0用户用户无CPSRR15R14R13R12R11R10R9R8R7R6R5R4R3R2R1R0系统系统SPSR_abtCPSRR15R14_svcR13_svcR12R11R10R9R8R7R6R5R4R3R2R1R0管理管理SPSR_abtCPSRR15R14_abtR13_abtR12R11R10R9R8R7R6R5R4R3R2R1R0中止中止SPSR_undCPSRR15R14_undR13_undR12R11R10R9R8R7R6R5R4R3R2R1R0未定义未定义SPSR_irqCPSRR15R14_irqR13_irqR12R11R10R9R8R7R6R5R4R3R2R1R0中断中断SPSR_fiqCPSRR15R14_fiqR13_fiqR12_fiqR11_fiqR10_fiqR9_fiqR8_fiqR7R6R5R4R3R2R1R0快中断快中断ARM状态各模式下可以访问的寄存器寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq一般的通用寄存器R13_fiqR13_irqR13_undR13_abtR13_svcR13R12_fiqR12R11_fiqR11R10_fiqR10R9_fiqR9R8_fiqR8R7R6R5R4R3R2R1R0 在汇编语言中寄存器R0R13为保存数据或地址值的通用寄存器。它们是完全通用的寄存器,不会被体系结构作为特殊用途,并且可用于任何使用通用寄存器的指令。寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq一般的通用寄存器R13_fiqR13_irqR13_undR13_abtR13_svcR13R12_fiqR12R11_fiqR11R10_fiqR10R9_fiqR9R8_fiqR8R7R6R5R4R3R2R1R0R7R6R5R4R3R2R1R0 其中R0R7为未分组的寄存器,也就是说对于任何处理器模式,这些寄存器都对应于相同的32位物理寄存器。寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq一般的通用寄存器R14_fiqR14_irqR14_undR14_abtR14_svcR14R13_fiqR13_irqR13_undR13_abtR13_svcR13R12_fiqR12R11_fiqR11R10_fiqR10R9_fiqR9R8_fiqR8 寄存器R8R14为分组寄存器。它们所对应的物理寄存器取决于当前的处理器模式,几乎所有允许使用通用寄存器的指令都允许使用分组寄存器寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq一般的通用寄存器R12_fiqR12R11_fiqR11R10_fiqR10R9_fiqR9R8_fiqR8 寄存器R8R12有两个分组的物理寄存器。一个用于除FIQ模式之外的所有寄存器模式,另一个用于FIQ模式。这样在发生FIQ中断后,可以加速FIQ的处理速度。寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq一般的通用寄存器 寄存器R13、R14分别有6个分组的物理寄存器。一个用于用户和系统模式,其余5个分别用于5种异常模式。R14_fiqR14_irqR14_undR14_abtR14_svcR14R13_fiqR13_irqR13_undR13_abtR13_svcR13寄存器类别寄存器在汇编中的名称各模式下实际访问的寄存器用户系统管理中止未定义中断快中断通用寄存器和程序计数器R0(a1)R0R1(a2)R1R2(a3)R2R3(a4)R3R4(v1)R4R5(v2)R5R6(v3)R6R7(v4)R7R8(v5)R8R8_fiqR9(SB,v6)R9R9_fiqR10(SL,v7)R10R10_fiqR11(FP,v8)R11R11_fiqR12(IP)R12R12_fiqR13(SP)R13R13_svcR13_abtR13_undR13_irqR13_fiqR14(LR)R14R14_svcR14_abtR14_undR14_irqR14_fiqR15(PC)R15状态寄存器CPSRCPSRSPSR无SPSR_abtSPSR_abtSPSR_undSPSR_irqSPSR_fiq堆栈指针寄存器R13(SP)寄存器R13常作为堆栈指针(SP)。在ARM指令集当中,没有以特殊方式使用R13的指令或其它功能,只是习惯上都这样使用。但是在Thumb指令集中存在使用R13的指令。