Difference between revisions of "CP1610"

From Intellivision Wiki
Jump to: navigation, search
(Flags: Make D description more accurate by being less precise)
(Instruction Set)
Line 85: Line 85:
  
 
==Instruction Set==
 
==Instruction Set==
Below is a detailed breakdown of all the opcodes available as a part of the CP1610 instruction set.  This information is somewhat incomplete at the moment, but will be filled out a bit more in the near future.<br/><br/>
+
Below is a detailed breakdown of all the opcodes available as a part of the CP1610 instruction set.  Click on each opcode for more information.<br/><br/>
 +
 
 
<table border width=100%>
 
<table border width=100%>
<tr><th width=1%>Range</th><th width=1%>Instruction</th><th width=1%>Mnemonic</th><th width=1%>Opcode</th><th>Flags</th></tr>
+
<tr><th width=1%>Range</th><th width=1%>Instruction</th><th width=1%>Mnemonic</th><th width=1%>Cycles</th><th>Interruptible</th><th>Input Flags</th><th>Output Flags</th></tr>
<tr><td>$0000</td><td>[[HLT|Halt]]</td><td>[[HLT]]</td><td>0000:0000:0000:0000</td><td>&#160;</td></tr>
+
<tr><td>$0000</td><td>[[HLT|Halt]]</td><td>[[HLT]]</td><td>NA</td><td>No</td><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td>$0001</td><td>[[SDBD|Set Double Byte Data]]</td><td>[[SDBD]]</td><td>0000:0000:0000:0001</td><td></td></tr>
+
<tr><td>$0001</td><td>[[SDBD|Set Double Byte Data]]</td><td>[[SDBD]]</td><td>4</td><td>No</td><td>&nbsp;</td><td>D</td></tr>
<tr><td>$0002</td><td>[[EIS|Enable Interrupt System]]</td><td>[[EIS]]</td><td>0000:0000:0000:0010</td><td></td></tr>
+
<tr><td>$0002</td><td>[[EIS|Enable Interrupt System]]</td><td>[[EIS]]</td><td>4</td><td>No</td><td>&nbsp;</td><td>I</td></tr>
<tr><td>$0003</td><td>[[DIS|Disable Interrupt System]]</td><td>[[DIS]]</td><td>0000:0000:0000:0011</td><td></td></tr>
+
<tr><td>$0003</td><td>[[DIS|Disable Interrupt System]]</td><td>[[DIS]]</td><td>4</td><td>No</td><td>&nbsp;</td><td>I</td></tr>
<tr><td>$0004</td><td>[[Jump]]</td><td>[[J]]/[[JD]]/[[JE]]<br/>[[JSR]]/[[JSRD]]/[[JSRE]]</td><td>0000:0000:0000:0100</td><td></td></tr>
+
<tr><td>$0004</td><td>[[Jump]]</td><td>[[J]]/[[JD]]/[[JE]]<br/>[[JSR]]/[[JSRD]]/[[JSRE]]</td><td>7/9</td><td>Yes</td><td>&nbsp;</td><td>I</td></tr>
<tr><td>$0005</td><td>[[TCI|Terminate Current Interrupt]]</td><td>[[TCI]]</td><td>0000:0000:0000:0101</td><td></td></tr>
+
<tr><td>$0005</td><td>[[TCI|Terminate Current Interrupt]]</td><td>[[TCI]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0006</td><td>[[CLRC|Clear Carry]]</td><td>[[CLRC]]</td><td>0000:0000:0000:0110</td><td></td></tr>
+
<tr><td>$0006</td><td>[[CLRC|Clear Carry]]</td><td>[[CLRC]]</td><td>4</td><td>No</td><td>&nbsp;</td><td>C</td></tr>
<tr><td>$0007</td><td>[[SETC|Set Carry]]</td><td>[[SETC]]</td><td>0000:0000:0000:0111</td><td></td></tr>
+
<tr><td>$0007</td><td>[[SETC|Set Carry]]</td><td>[[SETC]]</td><td>4</td><td>No</td><td>&nbsp;</td><td>C</td></tr>
<tr><td nowrap>$0008-$000F</td><td>[[INCR|Increment Register]]</td><td>[[INCR]]</td><td>0000:0000:0000:1rrr<br/>rrr = target register</td><td></td></tr>
+
<tr><td nowrap>$0008-$000F</td><td>[[INCR|Increment Register]]</td><td>[[INCR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0010-$0017</td><td>[[DECR|Decrement Register]]</td><td>[[DECR]]</td><td>0000:0000:0001:0rrr<br/>rrr = target register</td><td></td></tr>
+
<tr><td>$0010-$0017</td><td>[[DECR|Decrement Register]]</td><td>[[DECR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0018-$001F</td><td>[[COMR|Complement Register]]</td><td>[[COMR]]</td><td>0000:0000:0001:1rrr<br/>rrr = target register</td><td></td></tr>
+
<tr><td>$0018-$001F</td><td>[[COMR|Complement Register]]</td><td>[[COMR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0020-$0027</td><td>[[NEGR|Negate Register]]</td><td>[[NEGR]]</td><td>0000:0000:0010:0rrr<br/>rrr = target register</td><td></td></tr>
+
<tr><td>$0020-$0027</td><td>[[NEGR|Negate Register]]</td><td>[[NEGR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0028-$002F</td><td>[[ADCR|Add Carry to Register]]</td><td>[[ADCR]]</td><td>0000:0000:0010:1rrr<br/>rrr = target register</td><td></td></tr>
+
<tr><td>$0028-$002F</td><td>[[ADCR|Add Carry to Register]]</td><td>[[ADCR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0030-$0033</td><td>[[GSWD|Get the Status Word]]</td><td>[[GSWD]]</td><td>0000:0000:0011:00rr<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0030-$0033</td><td>[[GSWD|Get the Status Word]]</td><td>[[GSWD]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0034-$0035</td><td>[[NOP|No Operation]]</td><td>[[NOP]]</td><td>0000:0000:0011:010x<br/>x = ignored</td><td></td></tr>
+
<tr><td>$0034-$0035</td><td>[[NOP|No Operation]]</td><td>[[NOP]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0036-$0037</td><td>[[SIN|Software Interrupt]]</td><td>[[SIN]]</td><td>0000:0000:0011:011x<br/>x = ignored</td><td></td></tr>
+
<tr><td>$0036-$0037</td><td>[[SIN|Software Interrupt]]</td><td>[[SIN]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0038-$003F</td><td>[[RSWD|Return Status Word]]</td><td>[[RSWD]]</td><td>0000:0000:0011:1rrr<br/>rrr = target register</td><td></td></tr>
+
<tr><td>$0038-$003F</td><td>[[RSWD|Return Status Word]]</td><td>[[RSWD]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0040-$0047</td><td>[[SWAP|Swap Bytes]]</td><td>[[SWAP]]</td><td>0000:0000:0100:0srr<br/>s: 0 = swap once, 1 = swap twice<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0040-$0047</td><td>[[SWAP|Swap Bytes]]</td><td>[[SWAP]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0048-$004F</td><td>[[SLL|Shift Logical Left]]</td><td>[[SLL]]</td><td>0000:0000:0100:1srr<br/>s = shift count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0048-$004F</td><td>[[SLL|Shift Logical Left]]</td><td>[[SLL]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0050-$0057</td><td>[[RLC|Rotate Left through Carry]]</td><td>[[RLC]]</td><td>0000:0000:0101:0srr<br/>s = rotate count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0050-$0057</td><td>[[RLC|Rotate Left through Carry]]</td><td>[[RLC]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0058-$005F</td><td>[[SLLC|Shift Logical Left through Carry]]</td><td>[[SLLC]]</td><td>0000:0000:0101:1srr<br/>s = shift count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0058-$005F</td><td>[[SLLC|Shift Logical Left through Carry]]</td><td>[[SLLC]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0060-$0067</td><td>[[SLR|Shift Logical Right]]</td><td>[[SLR]]</td><td>0000:0000:0110:0srr<br/>s = shift count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0060-$0067</td><td>[[SLR|Shift Logical Right]]</td><td>[[SLR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0068-$006F</td><td>[[SAR|Shift Arithmetic Right]]</td><td>[[SAR]]</td><td>0000:0000:0110:1srr<br/>s = shift count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0068-$006F</td><td>[[SAR|Shift Arithmetic Right]]</td><td>[[SAR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0070-$0077</td><td>[[RRC|Rotate Right through Carry]]</td><td>[[RRC]]</td><td>0000:0000:0111:0srr<br/>s = rotate count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0070-$0077</td><td>[[RRC|Rotate Right through Carry]]</td><td>[[RRC]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0078-$007F</td><td>[[Shift Arithmetic Right through Carry]]</td><td>[[SARC]]</td><td>0000:0000:0111:1srr<br/>s = shift count<br/>rr = target register</td><td></td></tr>
+
<tr><td>$0078-$007F</td><td>[[Shift Arithmetic Right through Carry]]</td><td>[[SARC]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0080-$00BF</td><td>[[MOVR|Move Register]]</td><td>[[MOVR]]</td><td>0000:0000:10ss:sddd<br/>sss = source register<br/>ddd = destination register</td><td></td></tr>
+
<tr><td>$0080-$00BF</td><td>[[MOVR|Move Register]]</td><td>[[MOVR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$00C0-$00FF</td><td>[[ADDR|Add Registers]]</td><td>[[ADDR]]</td><td>0000:0000:11ss:sddd<br/>sss = source register<br/>ddd = destination register</td><td></td></tr>
+
<tr><td>$00C0-$00FF</td><td>[[ADDR|Add Registers]]</td><td>[[ADDR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0100-$013F</td><td>[[SUBR|Subtract Registers]]</td><td>[[SUBR]]</td><td>0000:0001:00ss:sddd<br/>sss = source register<br/>ddd = destination register</td><td></td></tr>
+
<tr><td>$0100-$013F</td><td>[[SUBR|Subtract Registers]]</td><td>[[SUBR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0140-$017F</td><td>[[CMPR|Compare Registers]]</td><td>[[CMPR]]</td><td>0000:0001:01ss:sddd<br/>sss = source register<br/>ddd = destination register</td><td></td></tr>
+
<tr><td>$0140-$017F</td><td>[[CMPR|Compare Registers]]</td><td>[[CMPR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0180-$01BF</td><td>[[ANDR|And Registers]]</td><td>[[ANDR]]</td><td>0000:0001:10ss:sddd<br/>sss = source register<br/>ddd = destination register</td><td></td></tr>
+
<tr><td>$0180-$01BF</td><td>[[ANDR|And Registers]]</td><td>[[ANDR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$01C0-$01FF</td><td>[[XORR|Xor Registers]]</td><td>[[XORR]]</td><td>0000:0001:11ss:sddd<br/>sss = source register<br/>ddd = destination register</td><td></td></tr>
+
<tr><td>$01C0-$01FF</td><td>[[XORR|Xor Registers]]</td><td>[[XORR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0200-$021F</td><td rowspan=2>[[Branch]]</td><td>[[B]]/[[BC]]/[[BOV]]/[[BPL]]<br/>[[BEQ]]/[[BLT]]/[[BLE]]/[[BUSC]]<br/>[[NOPP]]/[[BNC]]/[[BNOV]]/[[BMI]]<br/>[[BNEQ]]/[[BGE]]/[[BGT]]/[[BESC]]</td><td>0000:0010:00d0:nccc<br/>d = direction<br/>n = negation<br/>ccc = condition</td><td></td></tr>
+
<tr><td>$0200-$021F</td><td rowspan=2>[[Branch]]</td><td>[[B]]/[[BC]]/[[BOV]]/[[BPL]]<br/>[[BEQ]]/[[BLT]]/[[BLE]]/[[BUSC]]<br/>[[NOPP]]/[[BNC]]/[[BNOV]]/[[BMI]]<br/>[[BNEQ]]/[[BGE]]/[[BGT]]/[[BESC]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0220-$023F</td><td>[[BEXT]]</td><td>0000:0010:00d1:ebca<br/>d = direction<br/>ebca = asserted to EBCA0-3 pins</td><td></td></tr>
+
<tr><td>$0220-$023F</td><td>[[BEXT]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0240-$0247</td><td>[[MVO|Move Out]]</td><td>[[MVO]]</td><td>0000:0010:0100:0rrr<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0240-$0247</td><td>[[MVO|Move Out]]</td><td>[[MVO]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0248-$027F</td><td>[[MVO@|Move Out Indirect]]</td><td>[[MVO@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0248-$027F</td><td>[[MVO@|Move Out Indirect]]</td><td>[[MVO@]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0280-$0287</td><td>[[MVI|Move In]]</td><td>[[MVI]]</td><td>0000:0010:1000:0rrr<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0280-$0287</td><td>[[MVI|Move In]]</td><td>[[MVI]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0288-$02BF</td><td>[[MVI@|Move In Indirect]]</td><td>[[MVI@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0288-$02BF</td><td>[[MVI@|Move In Indirect]]</td><td>[[MVI@]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$02C0-$02C7</td><td>[[ADD|Add]]</td><td>[[ADD]]</td><td>0000:0010:0100:0rrr<br/>rrr = register to store result</td><td></td></tr>
+
<tr><td>$02C0-$02C7</td><td>[[ADD|Add]]</td><td>[[ADD]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$02C8-$02FF</td><td>[[ADD@|Add Indirect]]</td><td>[[ADD@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$02C8-$02FF</td><td>[[ADD@|Add Indirect]]</td><td>[[ADD@]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0300-$0307</td><td>[[SUB|Subtract]]</td><td>[[SUB]]</td><td>0000:0010:0100:0rrr<br/>rrr = register to store result</td><td></td></tr>
+
<tr><td>$0300-$0307</td><td>[[SUB|Subtract]]</td><td>[[SUB]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0308-$033F</td><td>[[SUB@|Subtract Indirect]]</td><td>[[SUB@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0308-$033F</td><td>[[SUB@|Subtract Indirect]]</td><td>[[SUB@]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0340-$0347</td><td>[[CMP|Compare]]</td><td>[[CMP]]</td><td>0000:0010:0100:0rrr<br/>rrr = register to store result</td><td></td></tr>
+
<tr><td>$0340-$0347</td><td>[[CMP|Compare]]</td><td>[[CMP]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0348-$037F</td><td>[[CMP@|Compare Indirect]]</td><td>[[CMP@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0348-$037F</td><td>[[CMP@|Compare Indirect]]</td><td>[[CMP@]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0380-$0387</td><td>[[AND|And]]</td><td>[[AND]]</td><td>0000:0010:0100:0rrr<br/>rrr = register to store result</td><td></td></tr>
+
<tr><td>$0380-$0387</td><td>[[AND|And]]</td><td>[[AND]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$0388-$03BF</td><td>[[AND|And Indirect]]</td><td>[[AND@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to move</td><td></td></tr>
+
<tr><td>$0388-$03BF</td><td>[[AND|And Indirect]]</td><td>[[AND@]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$03C0-$03C7</td><td>[[XOR|Xor]]</td><td>[[XOR]]</td><td>0000:0010:0100:0rrr<br/>rrr = register to store result</td><td></td></tr>
+
<tr><td>$03C0-$03C7</td><td>[[XOR|Xor]]</td><td>[[XOR]]</td><td></td><td></td><td></td><td></td></tr>
<tr><td>$03C8-$03FF</td><td>[[XOR@|Xor Indirect]]</td><td>[[XOR@]]</td><td>0000:0010:01ss:srrr<br/>sss = register with address (not zero)<br/>rrr = register to store result</td><td></td></tr>
+
<tr><td>$03C8-$03FF</td><td>[[XOR@|Xor Indirect]]</td><td>[[XOR@]]</td><td></td><td></td><td></td><td></td></tr>
 
</table>
 
</table>

Revision as of 18:58, 12 January 2005

The CPU used in the Intellivision Master Component is a General Instruments CP1610. The CP1610 is a general purpose microprocessor capable of supporting 16-bit addresses and 10-bit instructions.

Overview

Clock Speed894,886.25 Hz
Address Width16-bit
Instruction Width10-bit
Reset Address$1000
Interrupt Address$1004
FlagsS, Z, O, C, I, D
RegistersEight 16-bit Registers, R0-R7


General Behavior

The R7 register behaves as program counter for the CP1610. On the Intellivision, the CP1610 initializes R7 to the value $1000. The CP1610 then reads, decodes, and executes the opcode at the location reference by R7 and the increments R7 to the next instruction. Although most opcodes are only one memory location in length (one 10-bit value or "decle"), a few opcodes stretch to two or three memory locations, causing R7 to increment by more than a single value in order to find the next instruction to execute. The CP1610 repeats this behavior indefinitely, or until a HLT instruction is read.

The processor also receives hardware interrupts from the STIC which occur once per screen refresh and cause the CP1610 to jump to the interrupt subroutine located at $1004 in the Executive ROM. The STIC may also request the CP1610 temporarily halt processing to allow the STIC to perform direct memory accesses.

Flags

SSign FlagIf set, indicates that the previous operation resulted in negative value, which is determined by a one (1) in bit 15 of the result.
CCarry FlagIf set, indicates that the previous operation resulted in unsigned integer overflow.
ZZero FlagIf set, indicates that the previous operation resulted in zero.
OOverflow FlagIf set, indicates that the previous operation gave a signed result that is inconsistent with the signs of the source operands. (Signed overflow.)
IInterrupt Enable FlagIf set, allows the INTRM line to trigger an interrupt, causing the CPU to jump to the interrupt subroutine located in the Executive ROM at $1004.
DDouble Byte Data FlagIf set, it causes the next instruction to read a 16-bit operand with two 8-bit memory accesses, if it supports it.

Special notes:

  • The S, C, Z, and O flags are directly visible to the programmer via the GSWD instruction. The I and D flags are internal to the CPU, and not visible directly visible to the programmer.
  • The C and O flags serve a secondary purpose for the shift and rotate instructions. The SLLC, SARC, RLC and RRC use the C and O flags to store bits that get "shifted away." Also, the RLC and RRC instructions "shift in" the bits stored in C and O.
  • The S flag takes on a special role also with the shift instructions. The SWAP, SLR, SAR, SARC and RRC instructions set the S flag based on bit 7 of the result, rather than bit 15.

Signal Pins

SignalNameDirectionPurposeUse on Intellivision
INTRMINTerrupt Request, Masked.Input A high-to-low transition on this pin causes the CPU to take an interrupt if interrupts are enabled. If the signal transitions back to the "high" state prior to taking the interrupt, the CPU will ignore the interrupt.Connects to the SR1 output pin on the STIC. The STIC signals VBlank Interrupt to the CP1610 on this pin, and the CP1610 jumps to the interrupt vector at $1004 after the next interruptible instruction.
INTRINTerrupt Request.Input A high-to-low transition on this pin causes the CPU to take an interrupt, regardles of whether interrupts are enabled.The Intellivision leaves this signal tied to +5v (deasserted).
BUSRQBUS ReQuest.Input A high-to-low transition on this pin requests that the CPU halt so that something else may access the bus. Connects to the SR2 output pin on the STIC. The STIC signals the CP1610 on this pin at points during active display when it needs to access System RAM. The CP1610 halts after the next interruptible instruction, regardless of whether interrupts are enabled.
BUSAKBUS AcKnowledge.Output Asserted (active-low output) when the CPU has yielded the bus. Connects to the SST input pins on the System RAM and the GROM. The CP1610 acknowledges the STIC's bus request by signaling to the System RAM and GROM that it halted by request of the STIC.
MSYNCMaster SYNC.Input Asserting this signal (active low) resets the CPU and synchronizes it to its clocks. Connects to the MSYNC output of the STIC. The STIC generates this signal shortly after powerup after the clock stabilizes, or whenever someone releases the reset button or asserts RESET on the cartridge port.
EBCA0 - EBCA3External Branch Condition Address.Output The four outputs EBCA0 through EBCA3, along with the single input ECBI provide a mechanism for external hardware to generate branch control inputs to the CPU. The BEXT instruction includes a 4-bit field that the CP1610 asserts on EBCA0 - EBCA3. External hardware then asserts a 0 or 1 on EBCI to indicate whether to take the branch. This allows up to 16 different branch conditions to be asserted to the CPU. These pins are not connected in the Intellivision, so the BEXT instruction is typically never used.
EBCIExternal Branch Condition Input.Input
TCITerminate Current Interrupt.Output TCI is both an instruction as well as a pin on the device. The TCI instruction pulses the TCI pin on the CP1610. The Intellivision leaves this signal unconnected, and so the TCI instruction is effectively a NOP.
PCITProgram Counter Inhibit/Trap.Bidirectional. External hardware can prevent the CPU from incrementing the program counter by asserting this signal. The SIN instruction generates a pulse on this line. The Intellivision leaves this signal tied to +5v (deasserted) through a resistor.
STPSTSToP-STart.InputStops or starts the execution of the CPU whenever it sees a high-to-low transition.The Intellivision leaves this signal tied to +5v.
HALTHALTed.OutputIndicates the CPU halted.The Intellvision leaves this signal unconnected.
BDRDYBus Data ReaDY.InputWhen deasserted, it causes the CPU to wait for data to become available on the bus, effectively inserting wait states.The Intellivision leaves this signal unconnected, and thus has no notion of wait states.


Interruptibility

Each CP1610 opcode is considered either "interruptible" or "not interruptible". The interruptibility of an opcode determines whether or not the CP1610 checks the status of INTRM and BUSRQ after executing that instruction, and prior to executing the next. The CP1610 will check for an interrupt request signaled via INTRM only if both the Interrupt Enable Flag flag is set and previous instruction was an interruptible instruction. It is important to understand that the Interrupt Enable Flag and the interruptibility of each opcode are completely separate functions and both work together to prevent or allow the CP1610 to accept interrupts on the INTRM line. For more information on interrupts, see the VBlank Interrupt topic.

Similarly, the CP1610 only receives a signal from the STIC via BUSRQ for a total of exactly 114 CP1610 clock cycles. Although unaffected by the status of the I flag, if the CP1610 nonetheless encounters a stream of uninterruptible instructions, it will miss the chance to halt altogether and will fail to signal back to the STIC on BUSAK. The STIC, in turn, will fail to perform the necessary direct memory accesses to fetch the next row of cards to display. The exact behavior of the Intellivision hardware is unknown if this occurs, but it is believed to likely render a duplicate of the previous row of cards.

Registers

There are eight 16-bit registers available in the CP1610, labelled R0-R7.

R0General Purpose.
R1General Purpose.
R2General Purpose.
R3General Purpose.
R4General Purpose. Auto-Incrementing.
R5General Purpose. Auto-Incrementing.
R6General Purpose. Auto-Incrementing. Auto-Decrementing.
R7Program Counter. Auto-Incrementing.


Instruction Set

Below is a detailed breakdown of all the opcodes available as a part of the CP1610 instruction set. Click on each opcode for more information.

RangeInstructionMnemonicCyclesInterruptibleInput FlagsOutput Flags
$0000HaltHLTNANo  
$0001Set Double Byte DataSDBD4No D
$0002Enable Interrupt SystemEIS4No I
$0003Disable Interrupt SystemDIS4No I
$0004JumpJ/JD/JE
JSR/JSRD/JSRE
7/9Yes I
$0005Terminate Current InterruptTCI
$0006Clear CarryCLRC4No C
$0007Set CarrySETC4No C
$0008-$000FIncrement RegisterINCR
$0010-$0017Decrement RegisterDECR
$0018-$001FComplement RegisterCOMR
$0020-$0027Negate RegisterNEGR
$0028-$002FAdd Carry to RegisterADCR
$0030-$0033Get the Status WordGSWD
$0034-$0035No OperationNOP
$0036-$0037Software InterruptSIN
$0038-$003FReturn Status WordRSWD
$0040-$0047Swap BytesSWAP
$0048-$004FShift Logical LeftSLL
$0050-$0057Rotate Left through CarryRLC
$0058-$005FShift Logical Left through CarrySLLC
$0060-$0067Shift Logical RightSLR
$0068-$006FShift Arithmetic RightSAR
$0070-$0077Rotate Right through CarryRRC
$0078-$007FShift Arithmetic Right through CarrySARC
$0080-$00BFMove RegisterMOVR
$00C0-$00FFAdd RegistersADDR
$0100-$013FSubtract RegistersSUBR
$0140-$017FCompare RegistersCMPR
$0180-$01BFAnd RegistersANDR
$01C0-$01FFXor RegistersXORR
$0200-$021FBranchB/BC/BOV/BPL
BEQ/BLT/BLE/BUSC
NOPP/BNC/BNOV/BMI
BNEQ/BGE/BGT/BESC
$0220-$023FBEXT
$0240-$0247Move OutMVO
$0248-$027FMove Out IndirectMVO@
$0280-$0287Move InMVI
$0288-$02BFMove In IndirectMVI@
$02C0-$02C7AddADD
$02C8-$02FFAdd IndirectADD@
$0300-$0307SubtractSUB
$0308-$033FSubtract IndirectSUB@
$0340-$0347CompareCMP
$0348-$037FCompare IndirectCMP@
$0380-$0387AndAND
$0388-$03BFAnd IndirectAND@
$03C0-$03C7XorXOR
$03C8-$03FFXor IndirectXOR@