Samsung 8-Bit CMOS Microcontroller Microcassette Recorder User Manual


 
ADDRESSING MODES S3C9228/P9228
3-12
RELATIVE ADDRESS MODE (RA)
In Relative Address (RA) mode, a two's-complement signed displacement between – 128 and + 127 is specified
in the instruction. The displacement value is then added to the current PC value. The result is the address of the
next instruction to be executed. Before this addition occurs, the PC contains the address of the instruction
immediately following the current instruction.
The instructions that support RA addressing is JR.
OPCODE
Program Memory
Displacement
Program Memory
Address Used
Sample Instructions:
JR ULT,$ + OFFSET ; Where OFFSET is a value in the range + 127 to - 128
Next OPCODE
+
Signed
Displacement Value
Current Instruction
Current
PC Value
Figure 3-12. Relative Addressing
IMMEDIATE MODE (IM)
In Immediate (IM) addressing mode, the operand value used in the instruction is the value supplied in the
operand field itself. Immediate addressing mode is useful for loading constant values into registers.
(The Operand value is in the instruction)
OPCODE
Sample Instruction:
LD R0,#0AAH
Program Memory
OPERAND
Figure 3-13. Immediate Addressing