Samsung S3C9228/P9228 user manual JR Jump Relative, Bytes Cycles Opcode Addr Mode Hex Dst CcB

Models: S3C9228/P9228 8-Bit CMOS Microcontroller

1 462
Download 462 pages 42.12 Kb
Page 122
Image 122

SAM88RI INSTRUCTION SETS3C9228/P9228

JR — Jump Relative

JRcc,dst

Operation: If cc is true, PC ¨ PC + dst

If the condition specified by the condition code (cc) is true, the relative address is added to the program counter and control passes to the statement whose address is now in the program counter; otherwise, the instruction following the JR instruction is executed (See list of condition codes).

The range of the relative address is +127, –128, and the original value of the program counter is taken to be the address of the first instruction byte following the JR statement.

Flags: No flags are affected.

Format:

(1)

cc opc

dst

 

 

Bytes

Cycles

Opcode

Addr Mode

 

 

(Hex)

dst

2

6 (2)

ccB

RA

cc = 0 to F

NOTE: In the first byte of the two-byte instruction format, the condition code and the opcode are each four bits.

Example: Given: The carry flag = "1" and LABEL_X = 1FF7H:

JR

C,LABEL_X

PC = 1FF7H

If the carry flag is set (that is, if the condition code is true), the statement "JR C,LABEL_X" will pass control to the statement whose address is now in the PC. Otherwise, the program instruction following the JR would be executed.

6-26

Page 122
Image 122
Samsung S3C9228/P9228, 8-Bit CMOS Microcontroller user manual JR Jump Relative, Bytes Cycles Opcode Addr Mode Hex Dst CcB