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 />

LCALL Conditional Long Call<br />

Syntax<br />

LCALL Rs, p, s, nn -register, absolute<br />

Affected Flags<br />

None<br />

Description<br />

If the bit in position p of register Rs is equal to the bit s, then<br />

push the Program Counter, the ALU flags, the Global Interrupt<br />

Enable bit [GIE], and the current register bank selections<br />

onto the internal Address Stack. Following the push,<br />

transfer control to the instruction at the absolute memory<br />

address nn. The operand Rs may specify any active CPU<br />

register. The value of p may be from 0 to 7, where 0 corresponds<br />

to the LSB of Rs and 7 corresponds to the MSB of<br />

Rs. The absolute value nn is 16 bits long, (range: 0 to 64k),<br />

therefore, all of instruction memory can be addressed.<br />

Example<br />

Call the "Load.Xmit" subroutine when the Transmitter FIFO<br />

Empty flag, [TFE], of the Network Command Flag register<br />

(NCF) is "1".<br />

EXX 0,0<br />

LCALL NCF,7,1, Load.Xmit<br />

Instruction Format<br />

1 10 10 I 0 11 11 11 I 1<br />

1<br />

. Opcode .s. p<br />

15 8 7<br />

1 L<br />

15<br />

T-states<br />

(2 + 2)<br />

Bus Timing<br />

Figure 9<br />

Operation<br />

;select main A, alt B<br />

;If [TFE] = 1 call<br />

If Rs[p] = s then<br />

PC & [GIE] & ALU flags & register bank selections<br />

- Address Stack<br />

nn-PC<br />

End if<br />

4<br />

Rs<br />

o<br />

o<br />

LCALL Unconditional Long Call<br />

Syntax<br />

LCALL<br />

nn<br />

Affected Flags<br />

None<br />

Description<br />

-absolute<br />

Pushes the Program Counter, the ALU flags, the Global Interrupt<br />

Enable bit [GIE], and the current register bank selections<br />

onto the internal Address Stack; then unconditionally<br />

transfers control to the instruction at the absolute memory<br />

address nn. The value of nn is 16 bits long, (range: 0 to<br />

64k), therefore, all of instruction memory can be addressed.<br />

Example<br />

Transfer control to the subroutine "Send.it.all", which could<br />

be located anywhere in instruction memory.<br />

LCALL<br />

Send.it.all<br />

Instruction Format<br />

111110101111111011101010101010101<br />

Opcode<br />

15<br />

15<br />

T-states<br />

(2 + 2)<br />

Bus Timing<br />

Figure 9<br />

Operation<br />

PC & [GIE] & ALU flags & register bank selections<br />

- Address Stack<br />

nn-PC<br />

nn<br />

o<br />

o<br />

2-112

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

Saved successfully!

Ooh no, something went wrong!