Blog Archive

Which Mobile OS do you think will be the Ultimate Survivor?

Saturday, September 5, 2009

TUTORIALS: ARM REGISTERS

ARM processors can work in different modes depending on the state of program execution at that particular point of time.

During normal execution, ARM processor will work in what is called the "User Mode". In this mode, there are a total of 16 General Purpose Registers (r0-r15) and 2 additional Status Registers available.

Out of these 16 GP Registers, there are certain special functionalities for registers r13-r15.

Register r13 is used as a Stack Pointer (SP), which can point to memory locations where in local variables and parameters of a function call will be placed when entering a sub-routine.

Register r14 is a Link Register (LR), which is again a special purpose register which would hold the return address when a sub-routine function is called.

Register r15 is a Program Counter (PC), which holds the address of the currently executing instruction. While operating in ARM mode, where in all instructions are 32 bit wide and word aligned, bits [1:0] of PC are undefined/ignored.

But depending on the modes, r13 and r14 can also be used as a GP register, although that is not so common in practice.

In addition to above, there are 2 Status Registers:
- CPSR: Current Program Status Regsiter
- SPSR: Saved Program Status Register

Stumble Upon Toolbar

0 comments:

BlogUpp!

Blog Widget by LinkWithin
 
cell phones iphone virus mobile phone mobile nokia sony ericsson samsung htc android windows mobile Technorati blog directory