




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Introduction • The ARM processor is easy to program at theassembly level
Memory system • Memory is a linear array ofbytes addressed from 0 to
00
0x
10 20
0x000000010x
30 FF
0x000000030x
FF FF 0x00000004 0x000000050x
00
0x00000006 0 FFFFFFFD
00 00 0xFFFFFFFD0xFFFFFFFE0xFFFFFFFF
Byte ordering • Big Endian
Least significant byte has
00
0x
00 10 20
0x00000000 0x000000010 00000002
20 30 FF
0 x000000020x
FF FF FF
0x000000040x
Word address 0x00000000Value: 30201000
FF 00
0x
00 00
0xFFFFFFFD 0xFFFFFFFE
00
0xFFFFFFFE 0xFFFFFFFF
Instruction set ARM instructionsare all 32 bit longare all 32-bit long(except forThumb mode)Thumb mode).There are 2
32
Features of ARM instruction set • Load-store architecture^3
Data processing • They are move, arithmetic, logical, comparisonand multiply instructionsand multiply instructions.• Most data processing instructions can process
ti^ f
l^
g^ lti l
exception for long multiplywhich produces a 64-bit result)3 address format– 3-address format
Instruction set MOV
Rd,
@^ if
carry
is^
set
@^ then
V^ unaffected
Register movement
immediate,register,shift
-^ MOV
-^ MVN
t d move negated
Addressing modes • Register operands^ ADD
a literal; most can be represented ADD^
a literal; most can be represented
by (0..255)x
2n^ 0<n<
#0xff
a hexadecimal literalThis is assembler dependent syntaxThis is assembler dependent syntax.
Shifted register operands
Logical shift left^ CC^
0
register
unchanged
g
Example:
Before
R2=0x Before
0x After
R0=0x000000C0R2=0x00000030R2=0x
Arithmetic shift right
MSB^
register
C
unchanged
g
Example:
Before
R2=0xA Before
0xA After
R0=0xE800000CR2=0xA0000030R2=0xA
Rotate right
register
rotate @^ R
unchanged
g
Example:
Before
R2=0x Before
0x After
R0=0x4000000CR2=0x00000031R2=0x