Mova - Hitachi SH7750 Programming Manual

High-performance risc engine superh (sh) 32-bit risc mcu/mpu series
Hide thumbs Also See for SH7750:
Table of Contents

Advertisement

10.60

MOVA

Effective Address
Transfer
Format
MOVA @(disp,PC),R0 disp×4+PC+4 → R0
Description
This instruction stores the source operand effective address in general register R0. The 8-bit
displacement is multiplied by four after zero-extension. The PC value is the address of this
instruction, but a value with the lower 2 bits adjusted to B'00 is used in address calculation.
Notes
If this instruction is executed in a delay slot, an illegal slot instruction exception will be generated.
Operation
MOVA(int d)
{
unsigned int disp;
disp=(unsigned int)(0x000000FF & d);
R[0]=(PC&0xFFFFFFFC)+4+(disp<<2);
PC+=2;
}
Example
Address .org
1006
MOVA
1008
MOV.B
100A
ADD
.align
100C
STR: .sdata
MOVe effective Address
Summary of Operation
/* MOVA @(disp,PC),R0 */
H'1006
;STR address → R0
STR,R0
;R1 = "X" ← Position after adjustment of lower 2 bits of PC
@R0,R1
;← Original PC position in MOVA instruction address calculation
R4,R5
4
"XYZP12"
Data Transfer Instruction
Instruction Code
11000111dddddddd 1
Rev. 2.0, 03/99, page 329 of 396
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents