Samsung S3C84E5 Btjrt Bit Test, Jump Relative on True, If srcb is a 1, then PC ← PC + dst

Models: S3C84E5

1 316
Download 316 pages 61.65 Kb
Page 151
Image 151

INSTRUCTION SET

S3C84E5/C84E9/P84E9

 

 

BTJRT — Bit Test, Jump Relative on True

BTJRT

dst,src.b

Operation:

If src(b) is a "1", then PC PC + dst

 

The specified bit within the source operand is tested. If it is a "1", 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 BTJRT instruction is executed.

Flags: No flags are affected.

Format:

(note)

opc

src b 1

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:

BTJRT SKIP,R1.1

If the working register R1 contains the value 07H (00000111B), the statement "BTJRT SKIP,R1.1" tests bit one in the source register (R1). Because it is a "1", 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 addressed by the BTJRT instruction must be within the allowed range of + 127 to – 128.

6-24

Page 151
Image 151
Samsung S3C84E5 user manual Btjrt Bit Test, Jump Relative on True, If srcb is a 1, then PC ← PC + dst, Btjrt SKIP,R1.1