This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ions 195 Equivalent ARM instruction The equivalent ARM instruction has an identical assembler syntax; the 8-bit immediate is zero-extended to fill the 24-bit field in the ARM instruction. Clearly, this limits the SWIs available to Thumb code to the first 256 of the 16 million potential ARM SWIs. 7.5 Thumb data processing instructions
Thumb data processing instructions comprise a highly optimized set of fairly complex formats covering the operations most commonly required by a compiler. The functions of these instructions are clear enough. The selection of those to include and those to leave out is far less obvious, but is based on a detailed understanding of the needs of typical application programs. Binary encodings Figure 7.4 Thumb data processing instruction binary encodings. 196 The Thumb Instruction Set Description These instructions all map onto ARM data processing (including multiply) instructions. Although ARM supports a generalized shift on one operand together with an ALU operation in a single instruction, the Thumb instruction set separates shift and ALU operations into separate instructions, so here the shift operation is presented as an opcode rather than as an operand modifier.
The various instruction formats are: Assembler format Equivalent ARM instructions The ARM data processing instructions that have equivalents in the Thumb instruction set are listed below, with their Thumb equivalents in the comment field. Instructions that use the 'Lo', general-purpose registers (r0 to r7):
MOVS MVNS CMP CMP CMN TST ADDS ADDS ADDS ADCS SUBS SUBS SUBS SBCS RSBS MOVS Rd, Rd, Rn, Rn, Rn, Rn, Rd, Rd, Rd, Rd, Rd, Rd, Rd, Rd, Rd, Rd, #<#imm8> Rm #<#imm8> Rm Rm Rm Rn, #<#imm3> Rd, #<#imm8> Rn, Rm Rd, Rm Rn, #<#imm3> Rd, #<#imm8> Rn, Rm Rd, Rm Rn, #0 Rm, LSL #<#sh> Thumb instruction
; MOV ; MVN ; CMP ; CMP ; CMN ; TST ; ADD ; ADD ; ADD ; ADC ; SUB ; SUB ; SUB ; SBC ; NEC ; LSL Rd, Rd, Rn, Rn, Rn, Rn, Rd, Rd, Rd, Rd, Rd, Rd, Rd, Rd, Rd, Rd, #<#imm8> Rm #<#imm8> Rm Rm Rm Rn, #<#imm3> #<#imm8> Rn, Rm Rm Rn, #<#imm3> #<#imm8...
View Full Document
This document was uploaded on 10/30/2011 for the course CSE 378 380 at SUNY Buffalo.
- Spring '09