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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.0 Instruction Set Overview (Continued)<br />

In addition to the above jump, call and return program flow<br />

instructions, the BCP is capable of generating software interrupts<br />

via the TRAP instruction. This instruction generates<br />

a call to anyone of 64 possible interrupt table addresses<br />

based on its vector number operand. This allows both the<br />

simulation of hardware interrupts and the construction of<br />

special software interrupts, if desired. The actual interrupt<br />

table entry address is determined by concatenating the Interrupt<br />

Base Register, {lBR l, to an 8-bit representation of<br />

the vector number operand in the TRAP instruction. This<br />

instruction may also clear the [GIE] bit, if desired. Table XX<br />

shows the syntax and operation of the TRAP instruction.<br />

Miscellaneous Instructions<br />

As stated in the "CPU Register Set" section, the BCP has<br />

44 registers with 24 of them arranged into four register<br />

banks: Main Bank A, <strong>Al</strong>ternate Bank A, Main Bank B, and<br />

<strong>Al</strong>ternate Bank B. The exchange instruction, EXX, selects<br />

which register banks are currently available to the CPU, for<br />

example either Main Bank A or <strong>Al</strong>ternate Bank A. The deselected<br />

register banks retain their current values. The EXX<br />

instruction can also alter the state of [GIEI. if desired. Table<br />

XXI shows the EXX instruction syntax and operation.<br />

TABLE XX. TRAP Instruction<br />

Syntax<br />

TRAP v (, g'l<br />

Instruction Operation<br />

PC & [GIE] & ALU flags &<br />

reg. Bank selection _ Address Stack<br />

If "g'" = 1 then clear [GIE]<br />

Form PC address as shown below:<br />

I i i i i i i i 10 i 0 I i i i<br />

{IBRl<br />

v<br />

15 7 5<br />

Note: PC ~ Program Counter; contents in~ially pOints to instruction following call.<br />

[GIE] ~ Global Interrupt Enable bit<br />

IBR ~ Interrupt Base Register<br />

i i<br />

& = concatenation operator, combines operands together forming one long operand.<br />

I I ~ surrounds optional operands; not part of the instruction syntax.<br />

Optional operands may either be specified or omitted.<br />

0<br />

~PC<br />

Operand Range<br />

0,63<br />

Syntax<br />

EXX ba, bb (, gl<br />

TABLE XXI. EXX Instruction<br />

Instruction Operation<br />

Case "ba" of<br />

0: activate Main Bank A<br />

1 : activate <strong>Al</strong>ternate Bank A<br />

End case<br />

Case "bb" of<br />

0: activate Main Bank B<br />

1: activate <strong>Al</strong>ternate Bank B<br />

End case<br />

Case "g" of<br />

0: leave [GIE] unaffected, (default)<br />

1: (reserved)<br />

2: set [GIE]<br />

3: clear [GIE]<br />

End case<br />

Note: [GIE] ~ Global Interrupt Enable bit<br />

I I ~ surrounds optional operands; not part of the instruction syntax.<br />

Optional operands may either be specified or omitted.<br />

2-98

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

Saved successfully!

Ooh no, something went wrong!