Format 10: Load/Store Half-Word; Operation; Instruction Cycle Times - Samsung S3C2500B User Manual

Table of Contents

Advertisement

S3C2500B

3.29 FORMAT 10: LOAD/STORE HALF-WORD

15
14
13
0
1
0

3.29.1 OPERATION

These instructions transfer half-word values between a Lo register and memory. Addresses are pre-indexed,
using a 6-bit immediate value. The THUMB assembler syntax is shown in Table 3-17.
L
THUMB Assembler
0
STRH Rd, [Rb, #Imm] STRH Rd, [Rb, #Imm] Add #Imm to base address in Rb and store bits 0–15 of
1
LDRH Rd, [Rb, #Imm] LDRH Rd, [Rb, #Imm] Add #Imm to base address in Rb. Load bits 0–15 from the
NOTE: #Imm is a full 6-bit address but must be half-word-aligned (ie with bit 0 set to 0),
since the assembler places #Imm >> 1 in the Offset5 field.

3.29.2 INSTRUCTION CYCLE TIMES

All instructions in this format have an equivalent ARM instruction as shown in Table 3-17. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
Examples
STRH
LDRH
11
10
12
0
L
[2:0] Source/Destination Register
[5:3] Base Register
[10:6] Immediate Value
[11] Load/Store Flag
0 = Store to memory
1 = Load from memory
Figure 3-39. Format 10
Table 3-17. Half-word Data Transfer Instructions
ARM Equivalent
R6, [R1, #56]
R4, [R7, #4]
6
5
Offset5
Rd at the resulting address.
resulting address into Rd and set bits 16-31 to zero.
; Store the lower 16 bits of R4 at the address formed by
; adding 56 R1. Note that the THUMB opcode will contain
; 28 as the Offset5 value.
; Load into R4 the half-word found at the address formed
by
; adding 4 to R7. Note that the THUMB opcode will
; contain 2 as the Offset5 value.
INSTRUCTION SET
3
2
Rb
Rd
Action
0
3-83

Advertisement

Table of Contents
loading

Table of Contents