Professional Documents
Culture Documents
2
Data Transfer Instruction: STR
3
How to add two 32-bit numbers
stored in memory ?
4
32-bit addition program with assembler
directives and instructions
LDR R0 , NUM1
LDR R1 , NUM2
ADR R3, R0, R1
LDR R5, =RESULT
STR R3, [R5]
Program continues ….
5 SWI &11
32-bit addition program –
remaining code
6
What about adding 16-bit numbers ?
8
64-bit addition program (assuming no
carry out of MSB after ADC)
11
AND, ORR, EOR and BIC
ENTRY
stop
B stop
16 END
Second case: What will be the
leftmost hex digit in CPSR now ?
ENTRY
stop
B stop
17
END
Third case: What will be the
leftmost hex digit in CPSR now ?
ENTRY
stop
B stop
18
END
MUL instruction
4 x2 + 3 x
22
How to realize 7 x2 + 4 x using
shifts (assuming x = 6) ?
23
Another feature of the ARM instruction set
24
Format of LDMIA and STMIA
25
64-bit addition program with
LDMIA and STMIA instructions
LDR R0 , =Result
STMIA R0 , {R5, R6}
SWI &11
31
What is Little-Endian ?
big-endian little-endian