| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
1 | LSC-8 ISA | |||||||||
2 | Index Register Instructions Load instructions do not affect any flag. The Inc and Dec instructions affect all flags except carry. | |||||||||
3 | Accumulator Group Instructions The result of an ALU instruction affect all flags. The rotation instructions only affect the carry flag. | |||||||||
4 | Program Counter and Stack Control Instructions | SSS | Source Reg | |||||||
5 | Input/Output Instructions | DDD | Destination Reg | |||||||
6 | Machine Instructions | registers | ||||||||
7 | Mnemonic | Len | Opcode | Action | Flags | A | 000 | |||
8 | MOV Rd, Rs | 1 | 11 DDD SSS | Rd = Rs | B | 001 | ||||
9 | MOV Rd, M | 1 | 11 DDD 111 | Rd = Mem | C | 010 | ||||
10 | MOV M, Rs | 1 | 11 111 SSS | Mem = Rs | D | 011 | ||||
11 | MVI Rd, Imm | 2 | 00 DDD 110 | Rd = Immed Value | E | 100 | ||||
12 | MVI M, Imm | 2 | 00 111 110 | Mem = Immed Value | H | 101 | ||||
13 | INC Rd | 1 | 00 DDD 000 | Rd = Rd+ 1 (Rd ≠ M) | P, S, Z, x | L | 110 | |||
14 | DEC Rd | 1 | 00 DDD 001 | Rd = Rd- 1 (Rd ≠ M) | P, S, Z, x | Mem | 111 | |||
15 | PUSH Rs | 1 | 01 SSS 100 | Push SSS to Stack | ||||||
16 | PUSH M | 1 | 01 111 100 | Push Mem to stack | ||||||
17 | PUSH Imm | 2 | 00 110 010 | Push Imm to Stack | ||||||
18 | POP Rd | 1 | 01 DDD 110 | Pop to DDD from Stack | ||||||
19 | POP M | 1 | 01 111 110 | Pop to Mem from Stack | ||||||
20 | CLC/STC/CLI/STI | 1 | 00 FS0 101 | SET/CLR Flags: F - Flag (0=C, 1=I), S - State (0=CLR, 1=SET) | ||||||
21 | ADD A, Rs | 1 | 10 000 SSS | A = A + Rs | P, S, Z, C | |||||
22 | ADD A, M | 1 | 10 000 111 | A = A + Mem | P, S, Z, C | |||||
23 | ADI A, Imm | 2 | 00 000 100 | A = A + Immed Value | P, S, Z, C | |||||
24 | ADC A, Rs | 1 | 10 001 SSS | A = A + Carry + Rs | P, S, Z, C | Flag flip-flops are defined by C4C3: carry (00 - overflow or underflow), zero (01 - result is zero), sign (10 - MSB of result is "1"), parity (11 - parity is even). | ||||
25 | ADC A, M | 1 | 10 001 111 | A = A + Carry + Mem | P, S, Z, C | |||||
26 | ACI A, Imm | 2 | 00 001 100 | A = A + Carry + Immed Value | P, S, Z, C | |||||
27 | SUB A, Rs | 1 | 10 010 SSS | A = A - Rs | P, S, Z, C | |||||
28 | SUB A, M | 1 | 10 010 111 | A = A - Mem | P, S, Z, C | |||||
29 | SUI A, Imm | 2 | 00 010 100 | A = A - Immed Value | P, S, Z, C | |||||
30 | SBB A, Rs | 1 | 10 011 SSS | A = A - (Carry + Rs) | P, S, Z, C | M/IO | S1 | S0 | Characteristics | |
31 | SBB A, M | 1 | 10 011 111 | A = A - (Carry + Mem) | P, S, Z, C | 1 | 1 | 1 | Interrupt Acknowledge | |
32 | SCI A, Imm | 2 | 00 011 100 | A = A - (Carry + Immed Value) | P, S, Z, C | 1 | 1 | 0 | Read I/O Port | |
33 | ANA Rs | 1 | 10 100 SSS | A = A ∧ Rs | P, S, Z, c0 | 1 | 0 | 1 | Write I/O Port | |
34 | ANA M | 1 | 10 100 111 | A = A ∧ Mem | P, S, Z, c0 | 1 | 0 | 0 | None; Idle | |
35 | ANI | 2 | 00 100 100 | A = A ∧ Immed Value | P, S, Z, c0 | 0 | 1 | 1 | Halt | |
36 | XRA Rs | 1 | 10 101 SSS | A = A ⊕ Rs | P, S, Z, c0 | 0 | 1 | 0 | Read Memory | |
37 | XRA M | 1 | 10 101 111 | A = A ⊕ Mem | P, S, Z, c0 | 0 | 0 | 1 | Write Memory | |
38 | XRI | 2 | 00 101 100 | A = A ⊕ Immed Value | P, S, Z, c0 | 0 | 0 | 0 | None; Idle | |
39 | ORA Rs | 1 | 10 110 SSS | A = A ∨ Rs | P, S, Z, c0 | |||||
40 | ORA M | 1 | 10 110 111 | A = A ∨ Mem | P, S, Z, c0 | 00xx | math | ДОБАВИТЬ!!! | ||
41 | ORI | 2 | 00 110 100 | A = A ∨ Immed Value | P, S, Z, c0 | 01xx | logic | NOP | ||
42 | CMP Rs | 1 | 10 111 SSS | Compare A with Rs, set flags | P, S, Z, C | 10xx | rotate | NOT | ||
43 | CMP M | 1 | 10 111 111 | Compare A with Mem, set flags | P, S, Z, C | 11xx | inc/dec | NEG | ||
44 | CPI | 2 | 00 111 100 | Compare A with Immed Value, set flags | P, S, Z, C | TEST | ||||
45 | RLC | 1 | 00 000 010 | Rotate A Left Once | x, x, x, C | 0000 | add | MUL | ||
46 | RRC | 1 | 00 001 010 | Rotate A Right Once | x, x, x, C | 0001 | adc | DIV | ||
47 | RAL | 1 | 00 010 010 | Rotate A Left Through Carry Once | x, x, x, C | 0010 | sub | SHR | ||
48 | RAR | 1 | 00 011 010 | Rotate A Right Through Carry Once | x, x, x, C | 0011 | sbb | SHL | ||
49 | JMP | 3 | 00 111 000 | Unconditional Jump to immed address | 0100 | ana | SAR | |||
50 | JNC, JAE, JNB | 3 | 01 000 000 | If carry = 0, jump to immed address | 0101 | xra | SAL | |||
51 | JNZ, JNE | 3 | 01 001 000 | If result ≠ 0, jump to immed address | 0110 | ora | пересмотреть | |||
52 | JNS | 3 | 01 010 000 | If sign = 0 (positive), jump to immed address | 0111 | cmp | RET Cond | |||
53 | JPO, JNS | 3 | 01 011 000 | If parity = 0 (odd), jump to immed address | 1000 | rlc | CALL Cond | |||
54 | JC, JB, JNAE | 3 | 01 100 000 | If carry = 1, jump to immed address | 1001 | rrc | ||||
55 | JZ, JE | 3 | 01 101 000 | If result = 0, jump to immed address | 1010 | ral | ||||
56 | JS | 3 | 01 110 000 | If sign = 1 (negative), jump to immed address | 1011 | rar | ||||
57 | JPE, JP | 3 | 01 111 000 | If parity = 1 (even), jump to immed address | 1100 | INC | ||||
58 | CALL | 3 | 00 111 001 | Save current address onto the stack and jump to immed address | 1110 | DEC | ||||
59 | CNC | 3 | 01 000 010 | If carry = 0, save current address and jump to immed address | ||||||
60 | CNZ | 3 | 01 001 010 | If result ≠ 0, save current address and jump to immed address | ||||||
61 | CP | 3 | 01 010 010 | If sign = 0 (positive), save current address and jump to immed address | ||||||
62 | CPO | 3 | 01 011 010 | If parity = 0 (odd), save current address and jump to immed address | ||||||
63 | CC | 3 | 01 100 010 | If carry = 1, save current address and jump to immed address | ||||||
64 | CZ | 3 | 01 101 010 | If result = 0, save current address and jump to immed address | ||||||
65 | CM | 3 | 01 110 010 | If sign = 1 (negative), save current address and jump to immed address | ||||||
66 | CPE | 3 | 01 111 010 | If parity = 1 (even), save current address and jump to immed address | ||||||
67 | RET | 1 | 00 100 010 | Unconditionally return, down one stack level | ||||||
68 | RNC | 1 | 00 000 011 | If carry = 0, return, down one stack level | ||||||
69 | RNZ | 1 | 00 001 011 | If result ≠ 0, return, down one stack level | ||||||
70 | RP | 1 | 00 010 011 | If sign = 0 (positive), return, down one stack level | ||||||
71 | RPO | 1 | 00 011 011 | If parity = 0 (odd), return, down one stack level | ||||||
72 | RC | 1 | 00 100 011 | If carry = 1, return, down one stack level | ||||||
73 | RZ | 1 | 00 101 011 | If result = 0, return, down one stack level | ||||||
74 | RM | 1 | 00 110 011 | If sign = 1 (negative), return, down one stack level | ||||||
75 | RPE | 1 | 00 111 011 | If parity = 1 (even), return, down one stack level | ||||||
76 | IN | 1 | 01 0MM MM1 | A = PORT[MMMM] | ||||||
77 | OUT | 1 | 01 1MM MM1 | PORT[MMM] = A | ||||||
78 | HLT | 1 | 11 111 111 | Enter STOPPED state; remain there until interrupted | ||||||
79 | INT | 2 | 00 101 010 | |||||||
80 | IRET | 1 | 00 111 010 | |||||||