Documente Academic
Documente Profesional
Documente Cultură
ARM is intended for applications that require power efficient processors such as
portable computer, smart card, data communication etc..
ARM uses two types of instructions called Thumb(16-bit instructions) and
Thumb-2(32-bit instructions).
ARM is a load store reducing instruction set computer architecture
i.e core cannot directly operate with the memory
ARM uses 7 processing modes that are used to run the user tasks
User: for normal operations
IRQ: for handling interrupt operations
FIQ: for fast interrupt mode
Supervisory: used by operating system
Undefined: when undefined instruction executes
Abort: this mode indicates that current memroy access cannot be
completed such as unavailability of data in memory
User Vs System: Most applications perform in user mode and hence there
is no availability of system resources, other than causing an exception to
occur. This allows a customized OS to control the use of resources. System
mode, it is intended for use by OS tasks that need access to system
resources not depending upon exceptions.
ARM Nomenclature:
There are different versions of ARM, like ARMTDMI, ARM10XE, the meaning of
TDMI and XE is given below:
ARM {X} {Y} {Z} {T} {D} {M} {I} {E} {J} {F} {S}
X Family
Y Memory management
Z Cache
T THUMB 16-bit decoder
D JTAG Debug
M Fast multiplier
I Embedded ICE macro cell
E Enhanced Instruction
J Jazelle (Java)
F Vector floating point unit
S Synthesizable version
At User mode, only 16 registers (R0-R15) and one Program Status Register
are available to programmers.
Out of which: R15 PC
R14 Link Register
R13 SP
Note: link register is also a special purpose register which holds the address to
return to when a function call completes. Hence the name, Sub-Routine
Link Register.
Program Status Registers:
Current Program Status Register (CPSR) and Saved Program Status Register
(SPSR)
*** SPSR is the exact replica of CPSR. Used only while exceptions. ****
CPSR is accessible in all processor modes. Showed in fig below.
Every exception mode has SPSR, which is used to preserve the value of the
CPSR when the associated exception occurs.
Mode bits (M[4:0]): These bits determine the mode processor is operating
T & J bits:
R0 R7: are called Low Registers. These can be accessed by both 16-bit
Thumb Instructions and 32-bit Thumb2 Instructions
R8 - R12: are called High Registers. These can be accessed only by 32-bit
Thumb2 Instructions but not 16-bit Thumb Instructions
R13(SP): In cortex-M3 there are two SPs. Main Stack and the Processor
Stack. Used for stack operations in each mode. In Thread mode, bit1 of
control register controls which stack register is used. In Handler mode, the
processor always uses the main stack.
EPSR: contains the Thumb state bit (T) and the execution state bits for either IT
(If-Then)instruction or ICI(Interruptible-Continuable Instructions) instructions.
This EPSR is only effected when dealing with ICI related instructions(LDM,
STM, PUSH, POP) and IT instruction.
If 0th bit is 1- prevents the activation of all exceptions except for NMI.
0- No effect
BASEPRI Register:
Bits 0 to 7: If not zero, then it defines the base priority for exception
processing.
If zero, no effect.
Control Register: