S3C84E5/C84E9/P84E9

ADDRESSING MODES

 

 

RELATIVE ADDRESS MODE (RA)

In Relative Address (RA) mode, a twos-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.

Several program control instructions use the Relative Address mode to perform conditional jumps. The instructions that support RA addressing are BTJRF, BTJRT, DJNZ, CPIJE, CPIJNE, and JR.

Program Memory

Next OPCODE

Displacement

Current Instruction

 

OPCODE

 

Program Memory Address Used

Current

PC Value +

Signed Displacement Value

Sample Instructions:

JR

ULT,$+OFFSET

; Where OFFSET is a value in the range +127 to -128

Figure 3-13. Relative Addressing

3-13

Page 68
Image 68
Samsung S3C84E5 user manual Relative Address Mode RA, Ult,$+Offset