17.05.2015 Views

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.0 Instruction Set Reference (Continued)<br />

JRMK Relative Jump with Rotate and Mask on<br />

Register<br />

Syntax<br />

JRMK<br />

Rs, b, m<br />

Affected Flags<br />

None<br />

Description<br />

-Register<br />

Transfers control to the instruction at the memory address<br />

calculated by adding the contents of the Program Counter<br />

to a specially formed displacement. The displacement is<br />

formed by rotating a copy of the source register Rs the value<br />

of b bits to the right, masking (setting to zero) the most<br />

significant m bits, masking the least significant bit, and then<br />

sign extending the result to 16 bits. Typically, the JRMK<br />

instruction transfers control into a jump table. The LSB of<br />

the displacement is always set to zero so that the jump table<br />

may contain two word instructions, (e.g., LJMP). The range<br />

of JRMK is from + 126 to ~128 relative to the Program<br />

Counter. Note that the Program Counter initially contains<br />

the memory address of the next instruction following JRMK.<br />

The source register Rs may specify any active CPU register.<br />

The rotate value b may be from 0 to 7, where 0 causes no<br />

bit rotation to occur. The mask value m may be from 0 to 7;<br />

where m = 0 causes only the LSB of the displacement to be<br />

masked, m = 1 causes the MSB and the LSB to be masked,<br />

m = 2 causes bits 7 -6 and the LSB to be masked, etc ...<br />

Example<br />

This example demonstrates the decoding of the address<br />

frame of the 3299 Terminal Multiplexer protocol. In the address<br />

frame, only the bits 4-2 contain the address of the<br />

Logical Unit.<br />

EXX 0,1<br />

JRMK RTR,1,4<br />

LJMP ADDR.O<br />

LJMP ADDR.l<br />

LJMP ADDR.2<br />

;select main A, alt B<br />

;decode device address<br />

;jump to device handler #0<br />

;jump to device handler # 1<br />

;jump to device handler # 2<br />

Rotate the register b bits to the right:<br />

~L===:::;:;::~~<br />

register<br />

Mask the most significant m bits and the LSB:<br />

m<br />

~<br />

register AND 0 ... 0 1 ... 1 0 -+ register<br />

Modify the Program Counter:<br />

PC + register(sign extended) -+ PC<br />

TL/F/9336-8<br />

LJMP ADDR.7 ;jump to device handler #7<br />

Instruction Format<br />

1 1101010101<br />

. Opcode .<br />

15<br />

T-states<br />

4<br />

Bus Timing<br />

Figure 10<br />

Operation<br />

10<br />

m<br />

Copy Rs to a temporary register:<br />

Rs -+ register<br />

7<br />

1 1<br />

b<br />

Rs<br />

4 o<br />

2-111

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!