m (→Listing) |
(→ISA) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 5: | Line 5: | ||
| developer 2 = Datapoint Corporation | | developer 2 = Datapoint Corporation | ||
| implementation = 8008 | | implementation = 8008 | ||
− | | dev model = | + | | dev model = Proprietary |
− | | design = Von Neumann | + | | design = Von Neumann |
| data size = 8 bit | | data size = 8 bit | ||
| inst size = 8 bit | | inst size = 8 bit | ||
Line 12: | Line 12: | ||
| introduction = 1972 | | introduction = 1972 | ||
| version = 1 | | version = 1 | ||
− | | format = | + | | format = Register-Memory |
− | | endianness = | + | | endianness = Bi-endian |
− | | registers = | + | | registers = 7 |
| gprs = 7 | | gprs = 7 | ||
| gprs info = scratchpad | | gprs info = scratchpad | ||
Line 68: | Line 68: | ||
* [[#machine|Machine Instructions]] | * [[#machine|Machine Instructions]] | ||
− | In 1972, Intel | + | In 1972, Intel introduced their first set of mnemonics for their instructions. This original set consists of three characters which meant it could easily be encoded into a lookup table. A few years later, when they released their {{intel|8080}} and its instruction set, they also revamped the 8008 mnemonics to match the 8080's ones more closely. The newer mnemonics resemble a primitive version of modern x86 mnemonics. Since 8008 programs can be found using bother mnemonics, both the "old" and the "new" mnemonics are listed below. Both mnemonics results in identical binary values. |
{{isa | {{isa | ||
| title = 8008 ISA | | title = 8008 ISA | ||
| mn title = Mnemonic (old) | | mn title = Mnemonic (old) | ||
− | | | + | | Mnemonic (new) |
− | | | + | | Len |
+ | | Opcode | ||
+ | | Action | ||
+ | | cols = 5 | ||
| listing = | | listing = | ||
Line 80: | Line 83: | ||
{{inst|mn=LR<sub>d</sub>R<sub>s</sub> |col 1=MOV R<sub>d</sub>, R<sub>s</sub> |col 2=1 |op={{bin|11 DDD SSS}} |act=R<sub>d</sub> = R<sub>s</sub>}} | {{inst|mn=LR<sub>d</sub>R<sub>s</sub> |col 1=MOV R<sub>d</sub>, R<sub>s</sub> |col 2=1 |op={{bin|11 DDD SSS}} |act=R<sub>d</sub> = R<sub>s</sub>}} | ||
{{inst|mn=LR<sub>d</sub>M |col 1=MOV R<sub>d</sub>, M |col 2=1 |op={{bin|11 DDD 111}} |act=R<sub>d</sub> = Mem}} | {{inst|mn=LR<sub>d</sub>M |col 1=MOV R<sub>d</sub>, M |col 2=1 |op={{bin|11 DDD 111}} |act=R<sub>d</sub> = Mem}} | ||
− | {{inst|mn=LMR<sub>s</sub> |col 1=MOV R<sub>s</sub> | + | {{inst|mn=LMR<sub>s</sub> |col 1=MOV M, R<sub>s</sub> |col 2=1 |op={{bin|11 111 SSS}} |act=Mem = R<sub>s</sub>}} |
{{inst|mn=LR<sub>d</sub>I |col 1=MVI R<sub>d</sub>, Imm |col 2=2 |op={{bin|00 DDD 110}} |act=R<sub>d</sub> = Immed Value}} | {{inst|mn=LR<sub>d</sub>I |col 1=MVI R<sub>d</sub>, Imm |col 2=2 |op={{bin|00 DDD 110}} |act=R<sub>d</sub> = Immed Value}} | ||
{{inst|mn=LMI |col 1=MVI M, Imm |col 2=2 |op={{bin|00 111 110}} |act=Mem = Immed Value}} | {{inst|mn=LMI |col 1=MVI M, Imm |col 2=2 |op={{bin|00 111 110}} |act=Mem = Immed Value}} | ||
Line 87: | Line 90: | ||
{{inst|cols=5|section=<span id="accumulator_group">'''Accumulator Group Instructions'''</span><br><small>The result of an ALU instruction affect all flags. The rotation instructions only affect the carry flag.</small>}} | {{inst|cols=5|section=<span id="accumulator_group">'''Accumulator Group Instructions'''</span><br><small>The result of an ALU instruction affect all flags. The rotation instructions only affect the carry flag.</small>}} | ||
− | {{inst|mn=ADR<sub>s</sub> |col 1=ADD R<sub>s</sub> |col 2=1 |op={{bin| | + | {{inst|mn=ADR<sub>s</sub> |col 1=ADD R<sub>s</sub> |col 2=1 |op={{bin|10 000 SSS}} |act=A = A + R<sub>s</sub>}} |
− | {{inst|mn=ADM |col 1=ADD M |col 2=1 |op={{bin| | + | {{inst|mn=ADM |col 1=ADD M |col 2=1 |op={{bin|10 000 111}} |act=A = A + Mem}} |
− | {{inst|mn=ADI |col 1=ADI |col 2=2 |op={{bin| | + | {{inst|mn=ADI |col 1=ADI |col 2=2 |op={{bin|00 000 100}} |act=A = A + Immed Value}} |
− | {{inst|mn=ACR<sub>s</sub> |col 1=ADC R<sub>s</sub> |col 2=1 |op={{bin| | + | {{inst|mn=ACR<sub>s</sub> |col 1=ADC R<sub>s</sub> |col 2=1 |op={{bin|10 001 SSS}} |act=A = Carry + R<sub>s</sub>}} |
− | {{inst|mn=ACM |col 1=ADC M |col 2=1 |op={{bin| | + | {{inst|mn=ACM |col 1=ADC M |col 2=1 |op={{bin|10 001 111}} |act=A = Carry + Mem}} |
{{inst|mn=ACI |col 1=ACI |col 2=2 |op={{bin|00 001 100}} |act=A = Carry + Immed Value}} | {{inst|mn=ACI |col 1=ACI |col 2=2 |op={{bin|00 001 100}} |act=A = Carry + Immed Value}} | ||
{{inst|mn=SUR<sub>s</sub> |col 1=SUB R<sub>s</sub> |col 2=1 |op={{bin|10 010 SSS}} |act=A = A - R<sub>s</sub>}} | {{inst|mn=SUR<sub>s</sub> |col 1=SUB R<sub>s</sub> |col 2=1 |op={{bin|10 010 SSS}} |act=A = A - R<sub>s</sub>}} | ||
{{inst|mn=SUM |col 1=SUB M |col 2=1 |op={{bin|10 010 111}} |act=A = A - Mem}} | {{inst|mn=SUM |col 1=SUB M |col 2=1 |op={{bin|10 010 111}} |act=A = A - Mem}} | ||
{{inst|mn=SUI |col 1=SUI |col 2=2 |op={{bin|00 010 100}} |act=A = A - Immed Value}} | {{inst|mn=SUI |col 1=SUI |col 2=2 |op={{bin|00 010 100}} |act=A = A - Immed Value}} | ||
− | {{inst|mn= | + | {{inst|mn=SBR<sub>s</sub> |col 1=SBB R<sub>s</sub> |col 2=1 |op={{bin|10 011 SSS}} |act=A = A - (Carry + R<sub>s</sub>)}} |
{{inst|mn=SBM |col 1=SBB M |col 2=1 |op={{bin|10 011 111}} |act=A = A - (Carry + Mem)}} | {{inst|mn=SBM |col 1=SBB M |col 2=1 |op={{bin|10 011 111}} |act=A = A - (Carry + Mem)}} | ||
− | {{inst|mn=SBI |col 1= | + | {{inst|mn=SBI |col 1=SCI |col 2=2 |op={{bin|00 011 100}} |act=A = A - (Carry + Immed Value)}} |
{{inst|mn=NDR<sub>s</sub> |col 1=ANA R<sub>s</sub> |col 2=1 |op={{bin|10 100 SSS}} |act=A = {{l|land|A|R<sub>s</sub>}}}} | {{inst|mn=NDR<sub>s</sub> |col 1=ANA R<sub>s</sub> |col 2=1 |op={{bin|10 100 SSS}} |act=A = {{l|land|A|R<sub>s</sub>}}}} | ||
{{inst|mn=NDM |col 1=ANA M |col 2=1 |op={{bin|10 100 111}} |act=A = {{l|land|A|Mem}}}} | {{inst|mn=NDM |col 1=ANA M |col 2=1 |op={{bin|10 100 111}} |act=A = {{l|land|A|Mem}}}} | ||
Line 122: | Line 125: | ||
{{inst|mn=JFS |col 1=JP |col 2=3 |op={{bin|01 010 000}} |act=If sign = 0 (positive), jump to immed address}} | {{inst|mn=JFS |col 1=JP |col 2=3 |op={{bin|01 010 000}} |act=If sign = 0 (positive), jump to immed address}} | ||
{{inst|mn=JFP |col 1=JPO |col 2=3 |op={{bin|01 011 000}} |act=If parity = 0 (odd), jump to immed address}} | {{inst|mn=JFP |col 1=JPO |col 2=3 |op={{bin|01 011 000}} |act=If parity = 0 (odd), jump to immed address}} | ||
− | {{inst|mn= | + | {{inst|mn=JTC |col 1=JC |col 2=3 |op={{bin|01 100 000}} |act=If carry = 1, jump to immed address}} |
− | {{inst|mn= | + | {{inst|mn=JTZ |col 1=JZ |col 2=3 |op={{bin|01 101 000}} |act=If result = 0, jump to immed address}} |
− | {{inst|mn= | + | {{inst|mn=JTS |col 1=JM |col 2=3 |op={{bin|01 110 000}} |act=If sign = 1 (negative), jump to immed address}} |
− | {{inst|mn= | + | {{inst|mn=JTP |col 1=JPE |col 2=3 |op={{bin|01 111 000}} |act=If parity = 1 (even), jump to immed address}} |
{{inst|mn=CAL |col 1=CALL |col 2=3 |op={{bin|01 XXX 110}} |act=Save current address onto the stack and jump to immed address}} | {{inst|mn=CAL |col 1=CALL |col 2=3 |op={{bin|01 XXX 110}} |act=Save current address onto the stack and jump to immed address}} | ||
{{inst|mn=CFC |col 1=CNC |col 2=3 |op={{bin|01 000 010}} |act=If carry = 0, save current address and jump to immed address}} | {{inst|mn=CFC |col 1=CNC |col 2=3 |op={{bin|01 000 010}} |act=If carry = 0, save current address and jump to immed address}} | ||
Line 131: | Line 134: | ||
{{inst|mn=CFS |col 1=CP |col 2=3 |op={{bin|01 010 010}} |act=If sign = 0 (positive), save current address and jump to immed address}} | {{inst|mn=CFS |col 1=CP |col 2=3 |op={{bin|01 010 010}} |act=If sign = 0 (positive), save current address and jump to immed address}} | ||
{{inst|mn=CFP |col 1=CPO |col 2=3 |op={{bin|01 011 010}} |act=If parity = 0 (odd), save current address and jump to immed address}} | {{inst|mn=CFP |col 1=CPO |col 2=3 |op={{bin|01 011 010}} |act=If parity = 0 (odd), save current address and jump to immed address}} | ||
− | {{inst|mn= | + | {{inst|mn=CTC |col 1=CC |col 2=3 |op={{bin|01 100 010}} |act=If carry = 1, save current address and jump to immed address}} |
− | {{inst|mn= | + | {{inst|mn=CTZ |col 1=CZ |col 2=3 |op={{bin|01 101 010}} |act=If result = 0, save current address and jump to immed address}} |
− | {{inst|mn= | + | {{inst|mn=CTS |col 1=CM |col 2=3 |op={{bin|01 110 010}} |act=If sign = 1 (negative), save current address and jump to immed address}} |
− | {{inst|mn= | + | {{inst|mn=CTP |col 1=CPE |col 2=3 |op={{bin|01 111 010}} |act=If parity = 1 (even), save current address and jump to immed address}} |
{{inst|mn=RET |col 1=RET |col 2=1 |op={{bin|00 XXX 111}} |act=Unconditionally return, down one stack level}} | {{inst|mn=RET |col 1=RET |col 2=1 |op={{bin|00 XXX 111}} |act=Unconditionally return, down one stack level}} | ||
{{inst|mn=RFC |col 1=RNC |col 2=1 |op={{bin|00 000 011}} |act=If carry = 0, return, down one stack level}} | {{inst|mn=RFC |col 1=RNC |col 2=1 |op={{bin|00 000 011}} |act=If carry = 0, return, down one stack level}} | ||
Line 140: | Line 143: | ||
{{inst|mn=RFS |col 1=RP |col 2=1 |op={{bin|00 010 011}} |act=If sign = 0 (positive), return, down one stack level}} | {{inst|mn=RFS |col 1=RP |col 2=1 |op={{bin|00 010 011}} |act=If sign = 0 (positive), return, down one stack level}} | ||
{{inst|mn=RFP |col 1=RPO |col 2=1 |op={{bin|00 011 011}} |act=If parity = 0 (odd), return, down one stack level}} | {{inst|mn=RFP |col 1=RPO |col 2=1 |op={{bin|00 011 011}} |act=If parity = 0 (odd), return, down one stack level}} | ||
− | {{inst|mn= | + | {{inst|mn=RTC |col 1=RC |col 2=1 |op={{bin|00 100 011}} |act=If carry = 1, return, down one stack level}} |
− | {{inst|mn= | + | {{inst|mn=RTZ |col 1=RZ |col 2=1 |op={{bin|00 101 011}} |act=If result = 0, return, down one stack level}} |
− | {{inst|mn= | + | {{inst|mn=RTS |col 1=RM |col 2=1 |op={{bin|00 110 011}} |act=If sign = 1 (negative), return, down one stack level}} |
− | {{inst|mn= | + | {{inst|mn=RTP |col 1=RPE |col 2=1 |op={{bin|00 111 011}} |act=If parity = 1 (even), return, down one stack level}} |
{{inst|mn=RST |col 1=RST |col 2=1 |op={{bin|00 AAA 101}} |act=Call the subroutine at memory AAA000 (up one stack level)}} | {{inst|mn=RST |col 1=RST |col 2=1 |op={{bin|00 AAA 101}} |act=Call the subroutine at memory AAA000 (up one stack level)}} | ||
Latest revision as of 09:11, 29 September 2019
8008 ISA | |
Developer | Intel Datapoint Corporation |
Implementation | 8008 |
Dev model | Proprietary |
Design | Von Neumann |
Data word size | 8 bit 1 octets
2 nibbles |
Instruction word size | 8 bit 1 octets
|
Instructions | 48 |
Introduction | 1972 |
Version | 1 |
Format | Register-Memory |
Endianness | Bi-endian |
Registers | 7 |
GPRs | 7 (scratchpad) |
ISAs • By Company • By Inst • By Data |
The 8008 ISA (or MCS-8 ISA) was an instruction set architecture introduced by Intel in 1972 and was used in the 8008 and 8008-1 microprocessors.
This ISA has an 8-bit data and address bus. This architecture included seven 8-bit registers, 48 instructions, and interrupt capability.
Contents
Registers[edit]
The 8008 had seven scratchpad registers. A few of them had additional capabilities - A is used an an accumulator register. Registers H & L are high-order and low-order words of a 14-bit address.
Register | Size | Purpose |
---|---|---|
A | 8 bit | Accumulator |
B | 8 bit | GP |
C | 8 bit | GP |
D | 8 bit | GP |
E | 8 bit | GP |
H | 8 bit | High-order word |
L | 8 bit | Low-order word |
ISA[edit]
Data on the 8008 is always stored in an 8-bit binary integer.
- Data WordD7 D6 D5 D4 D3 D2 D1 D0
Instructions can be made of 1-3 bytes depending on operation. Multi-byte instructions must be stored in successive order in memory. Typical operations involving register-register operations such as arithmetic and logic operations only require one byte and take the following form:
- 1-Byte InstD7 D6 D5 D4 D3 D2 D1 D0OPCode
Instructions that involve an immediate value have 2 bytes. The first bite stores the opcode and the second byte stores the 8-bit value.
- 2-Byte InstD7 D6 D5 D4 D3 D2 D1 D0D7 D6 D5 D4 D3 D2 D1 D0OPCodeImm Value
Instructions involving an address (such as CALL and JUMP) require a 14-bit address. This is done via a 3-byte instruction where the first byte is the opcode, the second byte is the low-order word, and the third byte is the high-order word. Note that the 2 MSBs on the high-order word are don't cares.
Listing[edit]
The 8008 ISA has 48 instructions broken a number of groups:
- Index Register Instructions
- Accumulator Group Instructions
- Program Counter and Stack Control Instructions
- Input/Output Instructions
- Machine Instructions
In 1972, Intel introduced their first set of mnemonics for their instructions. This original set consists of three characters which meant it could easily be encoded into a lookup table. A few years later, when they released their 8080 and its instruction set, they also revamped the 8008 mnemonics to match the 8080's ones more closely. The newer mnemonics resemble a primitive version of modern x86 mnemonics. Since 8008 programs can be found using bother mnemonics, both the "old" and the "new" mnemonics are listed below. Both mnemonics results in identical binary values.
8008 ISA | ||||
---|---|---|---|---|
Mnemonic (old) | Mnemonic (new) | Len | Opcode | Action |
Index Register Instructions Load instructions do not affect any flag. The Inc and Dec instructions affect all flags except carry. | ||||
LRdRs | MOV Rd, Rs | 1 | 11 DDD SSS2 | Rd = Rs |
LRdM | MOV Rd, M | 1 | 11 DDD 1112 | Rd = Mem |
LMRs | MOV M, Rs | 1 | 11 111 SSS2 | Mem = Rs |
LRdI | MVI Rd, Imm | 2 | 00 DDD 1102 | Rd = Immed Value |
LMI | MVI M, Imm | 2 | 00 111 1102 | Mem = Immed Value |
INRd | INR Rd | 1 | 00 DDD 0002 | Rd = Rd + 1 (Rd ≠ A) |
DCRd | DCR Rd | 1 | 00 DDD 0012 | Rd = Rd - 1 (Rd ≠ A) |
Accumulator Group Instructions The result of an ALU instruction affect all flags. The rotation instructions only affect the carry flag. | ||||
ADRs | ADD Rs | 1 | 10 000 SSS2 | A = A + Rs |
ADM | ADD M | 1 | 10 000 1112 | A = A + Mem |
ADI | ADI | 2 | 00 000 1002 | A = A + Immed Value |
ACRs | ADC Rs | 1 | 10 001 SSS2 | A = Carry + Rs |
ACM | ADC M | 1 | 10 001 1112 | A = Carry + Mem |
ACI | ACI | 2 | 00 001 1002 | A = Carry + Immed Value |
SURs | SUB Rs | 1 | 10 010 SSS2 | A = A - Rs |
SUM | SUB M | 1 | 10 010 1112 | A = A - Mem |
SUI | SUI | 2 | 00 010 1002 | A = A - Immed Value |
SBRs | SBB Rs | 1 | 10 011 SSS2 | A = A - (Carry + Rs) |
SBM | SBB M | 1 | 10 011 1112 | A = A - (Carry + Mem) |
SBI | SCI | 2 | 00 011 1002 | A = A - (Carry + Immed Value) |
NDRs | ANA Rs | 1 | 10 100 SSS2 | A = A ∧ Rs |
NDM | ANA M | 1 | 10 100 1112 | A = A ∧ Mem |
NDI | ANI | 2 | 00 100 1002 | A = A ∧ Immed Value |
XRRs | XRA Rs | 1 | 10 101 SSS2 | A = A ⊕ Rs |
XRM | XRA M | 1 | 10 101 1112 | A = A ⊕ Mem |
XRI | XRI | 2 | 00 101 1002 | A = A ⊕ Immed Value |
ORRs | ORA Rs | 1 | 10 110 SSS2 | A = A ∨ Rs |
ORM | ORA M | 1 | 10 110 1112 | A = A ∨ Mem |
ORI | ORI | 2 | 00 110 1002 | A = A ∨ Immed Value |
CRRs | CMP Rs | 1 | 10 111 SSS2 | Compare A with Rs, set flags |
CRM | CMP M | 1 | 10 111 1112 | Compare A with Mem, set flags |
CRI | CPI | 2 | 00 111 1002 | Compare A with Immed Value, set flags |
RLC | RLC | 1 | 00 000 0102 | Rotate A Left Once |
RRC | RRC | 1 | 00 001 0102 | Rotate A Right Once |
RAL | RAL | 1 | 00 010 0102 | Rotate A Left Through Carry Once |
RAR | RAR | 1 | 00 011 0102 | Rotate A Right Through Carry Once |
Program Counter and Stack Control Instructions | ||||
JMP | JMP | 3 | 01 XXX 1002 | Unconditional Jump to immed address |
JFC | JNC | 3 | 01 000 0002 | If carry = 0, jump to immed address |
JFZ | JNZ | 3 | 01 001 0002 | If result ≠ 0, jump to immed address |
JFS | JP | 3 | 01 010 0002 | If sign = 0 (positive), jump to immed address |
JFP | JPO | 3 | 01 011 0002 | If parity = 0 (odd), jump to immed address |
JTC | JC | 3 | 01 100 0002 | If carry = 1, jump to immed address |
JTZ | JZ | 3 | 01 101 0002 | If result = 0, jump to immed address |
JTS | JM | 3 | 01 110 0002 | If sign = 1 (negative), jump to immed address |
JTP | JPE | 3 | 01 111 0002 | If parity = 1 (even), jump to immed address |
CAL | CALL | 3 | 01 XXX 1102 | Save current address onto the stack and jump to immed address |
CFC | CNC | 3 | 01 000 0102 | If carry = 0, save current address and jump to immed address |
CFZ | CNZ | 3 | 01 001 0102 | If result ≠ 0, save current address and jump to immed address |
CFS | CP | 3 | 01 010 0102 | If sign = 0 (positive), save current address and jump to immed address |
CFP | CPO | 3 | 01 011 0102 | If parity = 0 (odd), save current address and jump to immed address |
CTC | CC | 3 | 01 100 0102 | If carry = 1, save current address and jump to immed address |
CTZ | CZ | 3 | 01 101 0102 | If result = 0, save current address and jump to immed address |
CTS | CM | 3 | 01 110 0102 | If sign = 1 (negative), save current address and jump to immed address |
CTP | CPE | 3 | 01 111 0102 | If parity = 1 (even), save current address and jump to immed address |
RET | RET | 1 | 00 XXX 1112 | Unconditionally return, down one stack level |
RFC | RNC | 1 | 00 000 0112 | If carry = 0, return, down one stack level |
RFZ | RNZ | 1 | 00 001 0112 | If result ≠ 0, return, down one stack level |
RFS | RP | 1 | 00 010 0112 | If sign = 0 (positive), return, down one stack level |
RFP | RPO | 1 | 00 011 0112 | If parity = 0 (odd), return, down one stack level |
RTC | RC | 1 | 00 100 0112 | If carry = 1, return, down one stack level |
RTZ | RZ | 1 | 00 101 0112 | If result = 0, return, down one stack level |
RTS | RM | 1 | 00 110 0112 | If sign = 1 (negative), return, down one stack level |
RTP | RPE | 1 | 00 111 0112 | If parity = 1 (even), return, down one stack level |
RST | RST | 1 | 00 AAA 1012 | Call the subroutine at memory AAA000 (up one stack level) |
Input/Output Instructions | ||||
INP | IN | 1 | 01 00M MM12 | A = PORT[MMM] |
OUT | OUT | 1 | 01 RRM MM12 | PORT[RRMMM] = A (RR ≠ 00) |
Machine Instructions | ||||
HLT | HLT | 1 | 00 000 00X2 | Enter STOPPED state; remain there until interrupted |
HLT | HLT | 1 | 11 111 1112 | Enter STOPPED state; remain there until interrupted |
See also[edit]
designer | Intel + and Datapoint Corporation + |
first launched | 1972 + |
full page name | intel/mcs-8/isa + |
implementation | 8008 - Intel + |
instance of | instruction set architecture + |
instruction count | 48 + |
instruction word size | 8 bit (1 octets) + |
name | 8008 + |
word size | 8 bit (1 octets, 2 nibbles) + |