ARM Register 구성 및 mode
1. ARM Register Set과 Mode
– ARM9, 11의 경우 32-bit 범용 Register가 31개, 상태 Register가 6개 존재합니다.
Mode는 총 7가지의 Mode(Supervisor, System, User, FIQ, IRQ, Abort, Undefined)를 갖는데,
System Mode와 User Mode는 같은 Register를 사용하기 때문에 상태 Register가 6개가 됩니다.
– Cortex A8의 경우는 기존 시스템에서 Monitor Mode가 하나 더 추가되어 해당 Mode를 위한
Register 3개(SPSR, SP, LR)가 추가되어 총 40개의 Register로 구성됩니다.
2. Program Status Register 구성
(※DNM(Do Not Modify) 영역은 소프트웨어로 수정해서는 안 되는 영역)
2.1 Condition code Flag
N: Negative/Less than / Z: Zero / C: Carry/Borrow/Extend / V: Sticky overflow
2.2 Q Flag: Set the Sticky Overflow, 특정한 곱셈과 분수 산술 명령에서 ‘1’로 Set
2.3 IT execution state bits:
IT[7:5] – 현재의 IT blcok의 기본 조건 코드(base condition code)를 encode,
활성화 IT block이 없을 때 b000
IT[4:0] – 조건적으로 수행될 명령의 수를 encode, 각각의 조건은 base condition code 또는
base condition code의 반전 값
* Processor가 IT 명령을 수행할 때 명령의 조건에 따라 값이 set 되고, IT block을 수행하는
동안 IT[4:0]의 값이 shift.
2.4 Java State bit:(T=1일 때) J=0; Thumb state / J=1; ThumbEE state
2.5 GE[3:0]: 수행 결과의 각각의 half word 도는 byte에 대해서 크거나 같음을 지시함.
2.6 E: Load/store Endianness를 제어하는 bit, ‘CFGEND0’ 입력을 사용해서 reset에서 초기화 할 수 있음.
2.7 A: 자동적으로 ‘1’로 set되고 Imprecise data aborts를 불가능하게 할 때 사용함.
2.8 Control Bits: I: Interrupt Disable bits / F: FIQ Disable bits / T: Thumb 동작 mode
M[4:0]: 동작 모드 값, b10000(User), b10001(FIQ), b10010(IRQ), b10011(SVC), b10111(ABT)
b11011(UND), b11111(SYS), b10110(MON)
3. Exception 우선순위
(높음) Reset(1) > Precise data Abort(2) > FIQ(3) > IRQ(4) > Prefetch Abort(5)
> Imprecise data Abort(6) > BKPT, Undefined Instruction, SVC, SMC(7) (낮음)
<참고자료>
– Cortex-A8 Technical Reference Manual – ARM Information Center(ARM DDI 0344J):
http://infocenter.arm.com/help/topic/com.arm.doc.ddi0344j/DDI0344J_cortex_a8_r3p2_trm.pdf
– ARM Developer Suite Version 1.2 Developer Guide(ARM DUI 0056D):
http://infocenter.arm.com/help/topic/com.arm.doc.dui0056d/DUI0056.pdf
– ARM Technical Support Knowledge Articles: Use of MRS and MSR instructions
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3724.html