Samsung S3F80JB Btjrf Bit Test, Jump Relative on False, Example Given R1 = 07H, Btjrf SKIP,R1.3

Models: S3F80JB

1 346
Download 346 pages 34.13 Kb
Page 151
Image 151

S3F80JBINSTRUCTION SET

BTJRF — Bit Test, Jump Relative on False

BTJRF dst,src.b

Operation: If src(b) is a "0", then PC PC + dst

The specified bit within the source operand is tested. If it is a "0", the relative address is added to the program counter and control passes to the statement whose address is now in the PC; otherwise, the instruction following the BTJRF instruction is executed.

Flags: No flags are affected.

Format:

(Note 1)

opc

src b 0

dst

Bytes

Cycles

Opcode

Addr Mode

 

 

(Hex)

dst

src

3

10

37

RA

rb

NOTE: In the second byte of the instruction format, the source address is four bits, the bit address 'b' is three bits, and the LSB address value is one bit in length.

Example: Given: R1 = 07H:

BTJRF SKIP,R1.3

PC jumps to SKIP location

If working register R1 contains the value 07H (00000111B), the statement "BTJRF SKIP,R1.3" tests bit 3. Because it is "0", the relative address is added to the PC and the PC jumps to the memory location pointed to by the SKIP. (Remember that the memory location must be within the allowed range of + 127 to – 128.)

6-23

Page 151
Image 151
Samsung S3F80JB manual Btjrf Bit Test, Jump Relative on False, Example Given R1 = 07H, Btjrf SKIP,R1.3