SC32442B RISC MICROPROCESSOR
ARM INSTRUCTION SET
3-59
INSTRUCTION SET EXAMPLES
The following examples show ways in which the basic ARM920T instructions can combine to give efficient code.
None of these methods saves a great deal of execution time (although they may save some), mostly they just
save code.
USING THE CONDITIONAL INSTRUCTIONS
Using Conditionals for Logical OR
CMP
Rn,#p
; If Rn=p OR Rm=q THEN GOTO Label.
BEQ
Label
CMP
Rm,#q
BEQ
Label
This can be replaced by
CMP
Rn,#p
CMPNE
Rm,#q
; If condition not satisfied try other test.
BEQ
Label
Absolute Value
TEQ Rn,#0
;
Test
sign
RSBMI
Rn,Rn,#0
; and 2's complement if necessary.
Multiplication by 4, 5 or 6 (Run Time)
MOV
Rc,Ra,LSL#2
; Multiply by 4,
CMP
Rb,#5
;
Test
value,
ADDCS
Rc,Rc,Ra
; Complete multiply by 5,
ADDHI
Rc,Rc,Ra
; Complete multiply by 6.
Combining Discrete and Range Tests
TEQ
Rc,#127
;
Discrete
test,
CMPNE
Rc,# " "-1
; Range test
MOVLS
Rc,#
""
;
IF
Rc<= "" OR Rc=ASCII(127)
;
THEN
Rc:=
"."
Summary of Contents for SC32442B54
Page 1: ...SC32442B54 USER S MANUAL Revision 1 0 ...
Page 43: ...PRODUCT OVERVIEW SC32442B RISC MICROPROCESSOR 1 42 NOTES ...
Page 59: ...PROGRAMMER S MODEL SC32442B RISC MICROPROCESSOR 2 16 NOTES ...
Page 123: ...ARM INSTRUCTION SET SC32442B RISC MICROPROCESSOR 3 64 NOTES ...
Page 167: ...THUMB INSTRUCTION SET SC32442B RISC MICROPROCESSOR 4 44 NOTES ...
Page 187: ...MEMORY CONTROLLER SC32442B RISC MICROPROCESSOR 5 20 NOTES ...
Page 250: ...DMA SC32442B RISC MICROPROCESSOR 8 14 NOTES ...
Page 308: ...PWM TIMER SC32442B RISC MICROPROCESSOR 10 20 NOTES ...
Page 330: ...UART SC32442B RISC MICROPROCESSOR 11 22 NOTES ...
Page 417: ...SC32442B RISC MICROPROCESSOR LCD CONTROLLER 15 45 NOTES ...
Page 427: ...ADC AND TOUCH SCREEN INTERFACE SC32442B RISC MICROPROCESSOR 16 10 NOTES ...
Page 511: ...BUS PRIORITIES SC32442B RISC MICROPROCESSOR 24 2 NOTES ...
Page 562: ...K5D2G13ACM D075 Revision 1 0 December 2006 7 MCP MEMORY 2Gb 256Mb x8 NAND Flash Memory A Die ...
Page 599: ...K5D2G13ACM D075 Revision 1 0 December 2006 44 MCP MEMORY 512Mb 16Mb x32 Mobile SDRAM C Die ...