Discussion in "ARM Development" started by    shyam    Feb 7, 2008.
Thu Feb 07 2008, 02:03 AM
please do not post on this thread for doubts post on


chapter 1 ARM Architecture
This chapter outlines the ARM processor's architecture and describes the syntax rules of the ARM
assembler. Later chapters describe the ARM's stack and exception processing system
in more detail.
Figure 1.1 on the following page shows the internal structure of the ARM processor. The ARM
is a Reduced Instruction Set Computer (RISC) system and includes the attributes typical to that
type of system:
• A large array of uniform registers.
• A load/store model of data-processing where operations can only operate on registers and not
directly on memory. This requires that all data be loaded into registers before an operation
can be preformed, the result can then be used for further processing or stored back into
• A small number of addressing modes with all load/store addresses begin determined from
registers and instruction elds only.
• A uniform xed length instruction (32-bit).
In addition to these traditional features of a RISC system the ARM provides a number of additional
• Separate Arithmetic Logic Unit (ALU) and shifter giving additional control over data processing
to maximize execution speed.
• Auto-increment and Auto-decrement addressing modes to improve the operation of program
• Conditional execution of instructions to reduce pipeline ushing and thus increase execution

[ Edited Fri Feb 08 2008, 11:15 PM ]
 MATHIVANAN like this.
Thu Feb 07 2008, 02:58 AM
1.1 Processor modes
The ARM supports the seven processor modes shown in table1.1.
Mode changes can be made under software control, or can be caused by external interrupts or
exception processing.
Most application programs execute in User mode. While the processor is in User mode, the
program being executed is unable to access some protected system resources or to change mode,
other than by causing an exception to occur (see 1.4 ). This allows a suitably written
operating system to control the use of system resources.
 MATHIVANAN like this.
Thu Feb 07 2008, 03:16 AM

[ Edited Thu Feb 07 2008, 03:57 AM ]
Thu Feb 07 2008, 05:05 AM

The modes other than User mode are known as privileged modes. They have full access to system
resources and can change mode freely. Five of them are known as exception modes: FIQ (Fast
Interrupt), IRQ (Interrupt), Supervisor, Abort, and Undened. These are entered when specic
exceptions occur. Each of them has some additional registers to avoid corrupting User mode state
when the exception occurs (see 1.2 for details).
The remaining mode is System mode, it is not entered by any exception and has exactly the same
registers available as User mode. However, it is a privileged mode and is therefore not subject to
the User mode restrictions. It is intended for use by operating system tasks which need access to
system resources, but wish to avoid using the additional registers associated with the exception
modes. Avoiding such use ensures that the task state is not corrupted by the occurrence of any

Thu Feb 07 2008, 05:27 AM

1.2 Registers
The ARM has a total of 37 registers. These comprise 30 general purpose registers, 6 status registers
and a program counter. Figure 1.2 illustrates the registers of the ARM. Only fteen of the general
purpose registers are available at any one time depending on the processor mode.
There are a standard set of eight general purpose registers that are always available (R0  R7) no
matter which mode the processor is in. These registers are truly general-purpose, with no special
uses being placed on them by the processors' architecture.
A few registers (R8  R12) are common to all processor modes with the exception of the q
mode. This means that to all intent and purpose these are general registers and have no special
use. However, when the processor is in the fast interrupt mode these registers and replaced with
dierent set of registers (R8_q - R12_q). Although the processor does not give any special
purpose to these registers they can be used to hold information between fast interrupts. You can
consider they to be static registers. The idea is that you can make a fast interrupt even faster
by holding information in these registers.
The general purpose registers can be used to handle 8-bit bytes, 16-bit half-words1, or 32-bit
words. When we use a 32-bit register in a byte instruction only the least signicant 8 bits are
used. In a half-word instruction only the least signicant 16 bits are used. Figure 3.3 demonstrates
The remaining registers (R13  R15) are special purpose registers and have very specic roles:
R13 is also known as the Stack Pointer, while R14 is known as the Link Register, and R15 is
the Program Counter. The user (usr) and System (sys) modes share the same registers. The
exception modes all have their own version of these registers. Making a reference to register R14
will assume you are referring to the register for the current processor mode. If you wish to refer to the user mode version of this register you have refer to the R14_usr register. You may only
refer to register from other modes when the processor is in one of the privileged modes, i.e., any
mode other than user mode.
There are also one or two status registers depending on which mode the processor is in. The Current
Processor Status Register (CPSR) holds information about the current status of the processor
(including its current mode). In the exception modes there is an additional Saved Processor Status
Register (SPSR) which holds information on the processors state before the system changed into
this mode, i.e., the processor status just before an exception.

[ Edited Fri Feb 08 2008, 10:55 PM ]
Thu Feb 07 2008, 05:37 AM
Fri Feb 08 2008, 10:58 PM
1.2.1 The stack pointer, SP or R13
Register R13 is used as a stack pointer and is also known as the SP register. Each exception mode
has its own version of R13, which points to a stack dedicated to that exception mode.

1 .2.2 The Link Register, LR or R14
Register R14 is also known as the Link Register or LR.
It is used to hold the return address for a subroutine. When a subroutine call is performed via a
BL instruction, R14 is set to the address of the next instruction. To return from a subroutine you
need to copy the Link Register into the Program Counter. This is typically done in one of the two
• Execute either of these instructions:
• On entry to the subroutine store R14 to the stack with an instruction of the form:
STMFD SP!,{hregistersi, LR}
and use a matching instruction to return from the subroutine:
LDMFD SP!,{hregistersi, PC}
This saves the Link Register on the stack at the start of the subroutine. On exit from the
subroutine it collects all the values it placed on the stack, including the return address that
was in the Link Register, except it returns this address directly into the Program Counter

Get Social


Powered by e107 Forum System


Wed May 20 2020, 03:59 AM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sun May 03 2020, 01:08 AM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 07:09 PM
Sir kindly send the code file i2c for 8051
Sat Mar 14 2020, 04:06 AM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 06:25 PM
how can get hadwere of this project
Sat Mar 07 2020, 09:41 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 09:28 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 02:42 PM
Pearl Olin
Wed Jan 22 2020, 10:46 PM
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.
Tue Jan 14 2020, 11:38 AM
shubham kharade
when i am trying to simulate the program in Proteus 8 professional, I am getting some errors as cannot find module file dhtxx.md can u help me



Thu May 21 2020, 08:44 AM
Wed May 20 2020, 09:28 PM
Wed May 20 2020, 03:05 PM
Wed May 20 2020, 07:52 AM
Wed May 20 2020, 03:15 AM
Tue May 19 2020, 06:08 PM
Tue May 19 2020, 02:22 PM
Mon May 18 2020, 09:50 PM


Guests: 49, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 01:37 AM

Members: 38211
Newest member: Davidthils
Forum Activity
xrxx Avatar
Posted By xrxx
Thu Apr 30 2020, 06:59 AM
BCD MULTIPLICATIONAssume that you have to 2 BCD nu...
liqian Avatar
Posted By liqian
Tue Apr 28 2020, 05:26 AM
I happened to see your post and I got many useful ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Apr 28 2020, 04:21 AM
The code is hard to read.Please zip it and attach ...
rogermado Avatar
Posted By rogermado
Sun Apr 26 2020, 01:53 AM
@ExperimenterUK, thanks for your reply. You'll fin...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Apr 25 2020, 05:42 PM
Some simulators handle displays better than others...
rogermado Avatar
Posted By rogermado
Sat Apr 25 2020, 03:59 PM
Hello everyone, sorry in advance if i'm not in the...
PHANTOM28 Avatar
Posted By PHANTOM28
Fri Feb 28 2020, 10:25 AM
Hi.I hope you all can help me. I am relatively ne...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 21 2020, 05:05 PM
ajay_bhargav Avatar
Posted By ajay_bhargav
Fri Feb 21 2020, 04:45 AM
Yes you can do that.1. Create a channel @Thingspea...
ananyagupta Avatar
Posted By ananyagupta
Thu Feb 20 2020, 03:58 AM
With regards to the particular characters sent to ...