Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
72 CHAPTER 4 Instruction Sets HereisanexampleofITuse: if (R0 equal R1) then { R3 = R4 + R5 R3 = R3/2 } else { R3 = R6 + R7 R3 = R3/2 } Thiscanbewrittenasfollows: CMP R0, R1 ITTEE EQ ADDEQ R3, R4, ASREQ R3, R3, ADDNE R3, R6, ASRNE R3, R3, ; ; ; ; ; ; Compare R0 and R1 If R0 equal R1, Then-Then-Else-Else Add if equal Arithmetic shift right if equal Add if not equal Arithmetic shift right if not equal R5 #1 R7 #1 AsidefromusingtheITinstructiondirectly,theITinstructionalsohelpsportingofassemblyappli- cation codes from ARM7TDMI to Cortex-M3. When ARM assembler (including KEIL RealView MicrocontrollerDevelopmentKit,whichiscoveredinChapter20)isused,andifaconditionalexecu-