As a result of their late addition to the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: nt forms of this instruction format are: Load signed byte, signed half-word or unsigned half-word. Store half-word. An unsigned value is zero-extended to 32 bits when loaded; a signed value is extended to 32 bits by replicating the most significant bit of the data. Assembler formats The pre-indexed form: LDR|STR{<cond>}H|SHI SB Rd, [Rn, <offset>] { ! } The post-indexed form: LDRlSTR{<cond>}H|SHlSB Rd, [Rn], <offset> where <of fset> is # + /-<8-bit immediate> or +/-Rm and HI SHI SB selects the data type; otherwise the assembler format is as for words and unsigned byte transfers. 130 The ARM Instruction Set Examples To expand an array of signed half-words into an array of words: ADR ADR ADR LDRSH STR CMP BLT r1, ARRAYl r2, ARRAY2 r3, ENDARR1 r0, [r1], #2 r0, [r2], #4 r1, r3 LOOP ; half-word array start ; word array start ; ARRAYl end + 2 ; get signed half-word ; save word ; check for end of array ; if not finished, loop LOOP Notes 1. Similar limitations to those on the word and unsigned byte transfers described in the previous section apply on the use of r15 and the register operands. 2. All half-word transfers should use half-word aligned addresses. 5.12 Multiple register transfer instructions The ARM multiple register transfer instructions allow any subset (or all) of the 16 registers visible in the current operating mode to be loaded from or stored to memory. A form of the instruction also allows the operating system to load or store the user-mode registers to save or restore the user process state, and another form allows the CPSR to be restored from the SPSR as part of a return from an exception handler. These instructions are used on procedure entry and return to save and restore workspace registers and are useful for high-bandwidth memory block copy routines. Figure 5.11 Multiple register data transfer instruction binary encoding. Binary encoding Multiple register transfer instructions 131 Description The register list in the bottom 16 bits of the instructi...
View Full Document

This document was uploaded on 10/30/2011 for the course CSE 378 380 at SUNY Buffalo.

Ask a homework question - tutors are online