Il microprocessore DMC8 Fig. 1: Registri ed elementi di calcolo del DMC8 PC 16 bit Program Counter In altri contesti è chiamato anche Instruction Pointer. Questo registro a 16 bit contiene l indirizzo che punta all istruzione da eseguire. Come vedremo, le istruzioni risiedono nella memoria, e questo registro è utilizzato dal processore per indirizzare la memoria, mediante il bus degli indirizzi, al fine di prendere la prossima istruzione da eseguire. SP 16 bit Stack Pointer Letteralmente Puntatore alla Catasta". Discuteremo in dettaglio la funzione di questo importante registro più avanti. Per il momento basti dire che questo registro contiene l indirizzo della locazione in cima ad una catasta (o pila ) di locazioni di memoria RAM chiamata, appunto, Stack. IX 16 bit Index Register X IY 16 bit Index Register Y Letteralmente Registri Indice IX e IY. Sono registri specializzati, utilizzati per l indirizzamento in memoria di vettori e altre strutture dati. Si chiamano così perché permettono di indicizzare l indirizzamento in memoria, facilitando l accesso alle strutture dati. Saranno esaminati più avanti, in relazione ai cosiddetti modi di indirizzamento. Elettronica dei Sistemi Digitali 1
A 8 bit Accumulator Register A Il registro Accumulatore A è definito anche come Registro Privilegiato", perché interviene per default in moltissime operazioni eseguite dalla CPU. Si chiama così per ragioni storiche, perché per alcuni tipi di elaborazione consente di "accumulare" via via i risultati intermedi senza doverli riporre tutte le volte in memoria. Nel nostro processore, è il registro più importante per l'elaborazione dati. B 8 bit B Register C 8 bit C Register D 8 bit D Register E 8 bit E Register H 8 bit H Register L 8 bit L Register Si tratta di registri di uso generale ad 8 bit, utilizzati per supportare e velocizzare l elaborazione dati. Servono per memorizzare dati senza dovere accedere sempre alla memoria esterna (operazione più dispendiosa in termini di tempo). In alternativa, questi registri possono essere anche usati a coppie, come 3 registri da 16 bit, utilizzando i nomi simbolici BC, DE e HL. In questo caso, tali registri appaiono al programmatore nel modo seguente: BC 16 bit BC Register DE 16 bit DE Register HL 16 bit HL Register F 8 bit Register Il registro dei Flag (Segnalatori), chiamato anche Registro di Stato, non è un vero registro, in quanto è costituito da un insieme di alcuni flip-flop tra loro non omogenei come significato, raggruppati solo per comodità in un apparente unico registro da 8 bit, di cui sono utilizzati solo 6 bit. I Flag indicano lo stato del sistema di calcolo dopo l'esecuzione di una operazione aritmetica o logica: ad esempio segnalano se c'è stato riporto, oppure se il risultato dell operazione è zero. Qui di seguito è descritta la posizione dei Flag nel registro e, sommariamente, logico di ciascuno. Approfondiremo più avanti l utilizzo dei Flag, che sono molto importanti per il funzionamento del processore. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 S Z H p/v N C C Z S Carry Flag Memorizza il riporto dal bit più significativo dell'accumulatore, nel caso di una operazione di addizione, oppure il prestito nel caso di sottrazione (C=1 indica che è avvenuto un riporto o un prestito, C=0 no). Zero Flag Segnala che l'accumulatore si è azzerato, dopo l'esecuzione di una operazione, (Z=1 indica che tutti i bit dell'accumulatore sono a zero, Z=0 indica che almeno uno non lo è). Nel seguito vedremo, però, che non tutte le istruzioni agiranno su questo flag, come ci potremmo aspettare. Alcune istruzioni, come quelle di trasferimento dati, non modificano il valore di questo flag. Sign Flag Risulta uguale al bit più significativo del risultato in accumulatore (infatti, nella aritmetica in complemento a 2, S=0 indica il segno positivo del risultato di una operazione, S=1 il segno negativo). Elettronica dei Sistemi Digitali 2
P/V Parity/OverFlow Flag Questo flag dal doppi nome (P oppure V) indica se c'è stato overflow, qualora sia stata eseguita un'operazione aritmetica tra numeri in complemento a 2 (V = 1), oppure, se l'operazione eseguita è stata di tipo logico, indica la parità del risultato (P = 1 = parità pari). H N Half-Carry Flag Significativo solo per le istruzioni in aritmetica BCD, indica se si è verificato un riporto tra i 4 bit meno significativi e i 4 bit più significativi dell'accumulatore. Subtract Flag Indica se l'ultima operazione eseguita è stata una sottrazione (N=1) o altro (N=0). In ultimo, nel DMC8 è presente anche un flip-flop isolato, NON incluso nel registro dei Flag F: IFF 1 bit Interrupt Flip Flop Questo registro ad un bit abilita o disabilita il meccanismo delle cosiddette Interruzioni, che incontreremo più avanti. Se uguale a zero, le Interruzioni sono disabilitate. Fig. 2: Il microcomputer, basato sul microprocessore DMC8, come modellato nel Deeds Elettronica dei Sistemi Digitali 3
Fig. 3: La struttura del porto parallelo di ingresso IA Fig. 4: La struttura del porto parallelo di uscita OA Elettronica dei Sistemi Digitali 4
Tabelle delle Istruzioni DMC8 Le tabelle seguenti mostrano le istruzioni del DMC8 e riassumomo schematicamente i dettagli riguardanti la loro esecuzione. Partendo da sinistra, questo il significato delle colonne: Mnemonic: Operation: : : Bytes: M Cycles: Clock Cycles: Comments: Il codice mnemonico Assembly dell istruzione; L operazione che svolge rappresentata in modo simbolico; Gli indicatori (flags) interessati dall esecuzione dell istruzione; Il codice operativo in binario e, subito a destra, in esadecimale (Hex); Il numero di byte di cui e` composta l istruzione; Il numero di cicli macchina della istruzione; Il numero di cicli di clock necessari per l esecuzione dell istruzione; Eventuali commenti. Istruzioni di Caricamento a 8 bit Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments LD r, r r r 01 r r 1 1 4 r, r Reg. LD r, n r n 00 r 110 2 2 7 000 B 001 C LD r, (HL) r (HL) 01 r 110 1 2 7 010 D 011 E LD r, (IX + d) r (IX + d) 11 011 101 3 5 19 100 H 01 r 110 101 L 111 A LD r, (IY + d) r (IY + d) 11 111 101 3 5 19 01 r 110 LD (HL), r (HL) r 01 110 r 1 2 7 LD (IX + d), r (IX + d) r 11 011 101 01 110 r LD (IY + d), r (IY + d) r 11 111 101 01 110 r LD (HL), n (HL) n 00 110 110 LD (IX + d), n (IX + d) n 11 011 101 00 110 110 LD (IY + d), n (IY + d) n 11 111 101 00 110 110 3 5 19 3 5 19 36 2 3 10 36 36 4 5 19 4 5 19 LD A, (BC) A (BC) 00 001 010 0A 1 2 7 LD A, (DE) A (DE) 00 011 010 1A 1 2 7 LD A, (nn) A (nn) 00 111 010 3A 3 4 13 LD (BC), A (BC) A 00 000 010 02 1 2 7 LD (DE), A (DE) A 00 010 010 12 1 2 7 LD (nn), A (nn) A 00 110 010 r, r means any of the registers A, B, C, D, E, H, L. = flag is not affected. 32 3 4 13 Elettronica dei Sistemi Digitali 5
Istruzioni di Caricamento a 16 bit (prima parte) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes LD dd, nn dd nn 00 dd0 001 LD IX, nn IX nn 11 011 101 00 100 001 21 LD IY, nn IY nn 11 111 101 00 100 001 LD HL, (nn) LD dd, (nn) LD IX, (nn) LD IY, (nn) LD (nn), HL LD (nn), dd LD (nn), IX LD (nn), IY L (nn) H (nn+1) dd L (nn) dd H (nn+1) IX L (nn) IX H (nn+1) IY L (nn) IY H (nn+1) (nn) L (nn+1) H (nn) dd L (nn+1) dd H (nn) IX L (nn+1) IX H (nn) IY L (nn+1) IY H 00 101 010 11 101 101 01 dd1 011 11 011 101 00 101 010 11 111 101 00 101 010 00 100 010 11 101 101 01 dd0 011 11 011 101 00 100 010 11 111 101 00 100 010 21 M Cycles Clock Cycles Comments 3 3 10 dd Pair 00 BC 01 DE 4 4 14 10 HL 11 SP 4 4 14 2A 3 5 16 ED 4 6 20 2A 2A 4 6 20 4 6 20 22 3 5 16 4 6 20 22 22 4 6 20 4 6 20 LD SP, HL SP HL 11 111 001 F9 1 1 6 LD SP, IX SP IX 11 011 101 11 111 001 LD SP, IY SP IY 11 111 101 11 111 001 dd is any of the register pair BC, DE, HL, SP. qq is any of the register pair BC, DE, HL, AF. = flag is not affected. F9 F9 2 2 10 2 2 10 (continua) Elettronica dei Sistemi Digitali 6
Istruzioni di Caricamento a 16 bit (seconda parte) Mnemonic Operation PUSH qq SP SP - 1 (SP) qq H SP SP - 1 (SP) qq L PUSH IX SP SP - 1 (SP) IX H SP SP - 1 (SP) IX L PUSH IY SP SP - 1 (SP) IY H SP SP - 1 (SP) IY L POP qq qq L (SP) qq H (SP) POP IX IX L (SP) IX H (SP) POP IY IY L (SP) IY H (SP) S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments 11 qq0 101 1 3 11 qq Pair 00 BC 01 DE 10 HL 11 011 101 11 100 101 11 111 101 11 100 101 E5 E5 2 4 15 11 AF 2 4 15 11 qq0 001 1 3 10 11 011 101 11 100 001 11 111 101 11 100 001 dd is any of the register pair BC, DE, HL, SP. qq is any of the register pair BC, DE, HL, AF. = flag is not affected. E1 E1 2 4 14 2 4 14 Elettronica dei Sistemi Digitali 7
Istruzioni Aritmetiche e Logiche a 8 bit (prima parte) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Byte s M Cycles Clock Cycles Comments A A, r A A + r V 0 10 000 r 1 1 4 r Reg.. A A, n A A + n V 0 11 000 110 2 2 7 000 B 001 C A A, (HL) A A + (HL) V 0 10 000 110 1 2 7 010 D 011 E A A, (IX + d) A A + (IX + d) V 0 11 011 101 10 000 110 3 5 19 100 H 101 L 111 A A A, (IY + d) A A + (IY + d) V 0 11 111 101 10 000 110 3 5 19 ADC A, r A A + r + CY V 0 10 001 r 1 1 4 ADC A, n A A + n + CY V 0 11 001 110 2 2 7 ADC A, (HL) A A + (HL) + CY V 0 10 001 110 1 2 7 ADC A, (IX + d) A A + (IX + d)+cy V 0 11 011 101 10 001 110 ADC A, (IY + d) A A + (IY + d)+cy V 0 11 111 101 10 001 110 3 5 19 3 5 19 SUB r A A - r V 1 10 010 r 1 1 4 SUB n A A - n V 1 11 010 110 2 2 7 SUB (HL) A A - (HL) V 1 10 010 110 1 2 7 SUB (IX + d) A A - (IX + d) V 1 11 011 101 10 010 110 SUB (IY + d) A A - (IY + d) V 1 11 111 101 10 010 110 3 5 19 3 5 19 SBC A, r A A - r - CY V 1 10 011 r 1 1 4 SBC A, n A A - n - CY V 1 11 011 110 2 2 7 SBC A, (HL) A A - (HL) - CY V 1 10 011 110 1 2 7 SBC A, (IX + d) A A - (IX + d)-cy V 1 11 011 101 10 011 110 SBC A, (IY + d) A A - (IY + d)-cy V 1 11 111 101 10 011 110 3 5 19 3 5 19 CP r A - r V 1 10 111 r 1 1 4 CP n A - n V 1 11 111 110 2 2 7 CP (HL) A - (HL) V 1 10 111 110 1 2 7 CP (IX + d) A - (IX + d) V 1 11 011 101 10 111 110 CP (IY + d) A - (IY + d) V 1 11 111 101 10 111 110 3 5 19 3 5 19 The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation. Similarly the P symbol indicates parity. r means any of the registers A, B, C, D, E, H, L. CY means the carry flip-flop. = flag is not affected, 0 = flag is reset, 1 = flag is set, (continua) Elettronica dei Sistemi Digitali 8
Istruzioni Aritmetiche e Logiche a 8 bit (seconda parte) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Byte s M Cycles Clock Cycles Comments AND r A A and r 1 P 0 0 10 100 r 1 1 4 r Reg.. AND n A A and n 1 P 0 0 11 100 110 2 2 7 000 B 001 C AND (HL) A A and (HL) 1 P 0 0 10 100 110 1 2 7 010 D 011 E AND (IX + d) A A and (IX+d) 1 P 0 0 11 011 101 10 100 110 3 5 19 100 H 101 L 111 A AND (IY + d) A A and (IY+d) 1 P 0 0 11 111 101 10 100 110 3 5 19 OR r A A or r 0 P 0 0 10 110 r 1 1 4 OR n A A or n 0 P 0 0 11 110 110 2 2 7 OR (HL) A A or (HL) 0 P 0 0 10 110 110 1 2 7 OR (IX + d) A A or (IX+d) 0 P 0 0 11 011 101 10 110 110 OR (IY + d) A A or (IY+d) 0 P 0 0 11 111 101 10 110 110 3 5 19 3 5 19 XOR r A A xor r 0 P 0 0 10 101 r 1 1 4 XOR n A A xor n 0 P 0 0 11 101 110 2 2 7 XOR (HL) A A xor (HL) 0 P 0 0 10 101 110 1 2 7 XOR (IX + d) A A xor (IX+d) 0 P 0 0 11 011 101 10 101 110 XOR (IY + d) A A xor (IY+d) 0 P 0 0 11 111 101 10 101 110 3 5 19 3 5 19 INC r r r + 1 V 0 00 r 100 1 1 4 INC (HL) (HL) (HL) + 1 V 0 00 110 100 1 3 11 INC (IX + d) (IX + d) (IX + d) + 1 V 0 11 011 101 00 110 100 INC (IY + d) (IY + d) (IY + d) + 1 V 0 11 111 101 00 110 100 3 6 23 3 6 23 DEC r r r 1 V 1 00 r 101 1 1 4 DEC (HL) (HL) (HL) - 1 V 1 00 110 101 1 3 11 DEC (IX + d) (IX + d) (IX + d) - 1 V 1 11 011 101 00 110 101 DEC (IY + d) (IY + d) (IY + d) - 1 V 1 11 111 101 00 110 101 CPL NEG 3 6 23 3 6 23 _ A A 1 1 00 101 111 2F 1 1 4 One s complement. _ A A + 1 V 1 11 101 101 01 000 100 ED 44 2 2 8 Two s complement. The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation. Similarly the P symbol indicates parity. r means any of the registers A, B, C, D, E, H, L. CY means the carry flip-flop. = flag is not affected, 0 = flag is reset, 1 = flag is set, Elettronica dei Sistemi Digitali 9
Istruzioni Aritmetiche a 16 bit Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments A HL, ss HL HL + ss 2 0 1 00 ss1 001 1 3 11 ss Reg. ADC HL, ss HL HL + ss 1 1 2 V 1 0 1 11 101 101 ED 2 4 15 00 BC + CY 01 ss1 010 01 DE SBC HL, ss HL HL ss 1 1 2 V 1 1 1 11 101 101 ED 2 4 15 10 HL CY 01 ss0 010 11 SP A IX, pp IX IX + pp 2 0 1 11 011 101 2 4 15 00 pp1 001 pp Reg. A IY, rr IY IY + rr 2 0 1 11 111 101 2 4 15 00 BC 00 rr1 001 01 DE INC ss ss ss + 1 00 ss0 011 1 1 6 10 IX 11 SP INC IX IX IX + 1 11 011 101 2 2 10 00 100 011 23 INC IY IY IY + 1 11 111 101 2 2 10 rr Reg. 00 100 011 23 00 BC DEC ss ss ss - 1 00 ss1 011 1 1 6 01 DE 10 IY DEC IX IX IX - 1 11 011 101 2 2 10 11 SP 00 101 011 2B DEC IY IY IY - 1 11 111 101 00 101 011 2B 2 2 10 The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation. Ss means any of the registers BC, DE, HL, SP. Pp means any of the registers BC, DE, IX, SP. Rr means any of the registers BC, DE, IY, SP. 16 bit additions are performed by first adding the two low order eight bits, and then the two high order eight bits. 1 Indicates the flag is affected by the 16 bit result of the operation. 2 Indicates the flag is affected by the 8 bit addition of the high order eight bits. CY means the carry flip-flop. = flag is not affected, 0 = flag is reset, 1 = flag is set, Istruzioni di controllo della CPU Mnemonic CCF Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments CY CY X 0 00 111 111 3F 1 1 4 Complement carry flag. SCF CY 1 0 0 1 00 110 111 37 1 1 4 NOP No Operation 00 000 000 00 1 1 4 HALT CPU halted 01 110 110 76 1 1 4 DI 1 IFF 0 11 110 011 F3 1 1 4 EI 1 IFF 1 11 111 011 FB 1 1 4 The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation. Similarly the P symbol indicates parity. 1 No interrupts are issued directly after a DI or EI. CY means the carry flip-flop. = flag is not affected, 0 = flag is reset, 1 = flag is set, X = flag is don t care, Elettronica dei Sistemi Digitali 10
Istruzioni di Salto (Jump) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles JP nn PC nn 11 000 011 C3 3 3 10 JP cc, nn if cc is true, PC nn 11 cc 010 JP ( HL ) PC HL 11 101 001 E9 1 1 4 Comments 3 3 10 cc Condition 000 NZ non zero 001 Z zero 010 NC non carry 011 C carry 100 PO parity odd 101 PE parity even 110 P sign positive 111 M sign negative JP ( IX ) PC IX 11 011 101 11 101 001 JP ( IY ) PC IY 11 111 101 11 101 001 = flag is not affected. E9 E9 2 2 8 2 2 8 Istruzioni di Chiamata e Ritorno da sottoprogrammi (Call e Return) Mnemonic Operation CALL nn SP SP - 1 (SP) PC H SP SP - 1 (SP) PC L PC nn CALL cc, nn if cc is true, SP SP - 1 (SP) PC H SP SP - 1 (SP) PC L PC nn RET PC L (SP) PC H (SP) RET cc if cc is true, PC L (SP) PC H (SP) RST p SP SP - 1 (SP) PC H SP SP - 1 (SP) PC L PC p = flag is not affected. S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles 11 001 101 CD 3 5 17 11 ccc 100 11 001 001 C9 1 3 10 11 ccc 000 1 1 3 3 3 5 1 3 10 17 5 11 Comments if cc is false if cc is true if cc is false if cc is true 11 t 111 1 3 11 t _ p 000 0000h 001 0008h 010 0010h 011 0018h 100 0020h 101 0028h 110 0030h 111 0038h Elettronica dei Sistemi Digitali 11
Istruzioni di Rotazione e di Scalamento (prima parte) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles RLCA 0 0 00 000 111 07 1 1 4 Comments RLA 0 0 00 010 111 17 1 1 4 RRCA 0 0 00 001 111 0F 1 1 4 RRA 0 0 00 011 111 1F 1 1 4 RLC r 0 P 0 00 000 r RLC (HL) 0 P 0 00 000 110 RLC (IX + d) 0 P 0 11 011 101 00 000 110 RLC (IY + d) 0 P 0 11 111 101 00 000 110 RL r 0 P 0 00 010 r RL (HL) 0 P 0 00 010 110 RL (IX + d) 0 P 0 11 011 101 00 010 110 RL (IY + d) 0 P 0 11 111 101 00 010 110 RRC r 0 P 0 00 001 r RRC (HL) 0 P 0 00 001 110 RRC (IX + d) 0 P 0 11 011 101 00 001 110 RRC (IY + d) 0 P 0 11 111 101 00 001 110 RR r 0 P 0 00 011 r RR (HL) 0 P 0 00 011 110 RR (IX + d) 0 P 0 11 011 101 00 011 110 RR (IY + d) 0 P 0 11 111 101 00 011 110 RLD 0 P 0 11 101 101 01 101 111 RRD 0 P 0 11 101 101 01 100 111 2 2 8 r Reg. 000 B 2 4 15 001 C 010 D 011 E 100 H 101 L 111 A 2 2 8 2 4 15 2 2 8 2 4 15 2 2 8 2 4 15 ED 6F ED 67 2 5 18 2 5 18 The P symbol in the P/V flag column indicates that the P/V flag contains the parity of the result. r means any of the registers A, B, C, D, E, H, L. CY means the carry flip-flop. = flag is not affected, 0 = flag is reset, 1 = flag is set, (continua) Elettronica dei Sistemi Digitali 12
Istruzioni di Rotazione e di Scalamento (seconda parte) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments SLA r 0 P 0 2 2 8 r Reg. 00 100 r 000 B SLA (HL) 0 P 0 00 100 110 2 4 15 001 C 010 D SLA (IX + d) 0 P 0 11 011 101 011 E 100 H 101 L 00 100 110 111 A SLA (IY + d) 0 P 0 11 111 101 00 100 110 SRA r 0 P 0 00 101 r SRA (HL) 0 P 0 00 101 110 SRA (IX + d) 0 P 0 11 011 101 00 101 110 SRA (IY + d) 0 P 0 11 111 101 00 101 110 SRL r 0 P 0 00 111 r SRL (HL) 0 P 0 00 111 110 SRL (IX + d) 0 P 0 11 011 101 00 111 110 SRL (IY + d) 0 P 0 11 111 101 00 111 110 2 2 8 2 4 15 2 2 8 2 4 15 The P symbol in the P/V flag column indicates that the P/V flag contains the parity of the result. r means any of the registers A, B, C, D, E, H, L. CY means the carry flip-flop. = flag is not affected, 0 = flag is reset, 1 = flag is set, Elettronica dei Sistemi Digitali 13
Istruzioni di manipolazione del Bit Mnemonic BIT b, r BIT b, (HL) BIT b, (IX + d) BIT b, (IY + d) Operation _ Z r b Z (HL) b Z (IX+ d) b Z (IY+ d) b S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments X 1 X 0 2 2 8 r Reg. 01 b r 000 B X 1 X 0 2 3 12 001 C 01 b 110 010 D X 1 X 0 11 011 101 4 5 20 011 E 100 H 101 L 01 b 110 111 A X 1 X 0 11 111 101 01 b 110 SET b, r r b 1 11 b r SET b, (HL) (HL) b 1 11 b 110 SET b, (IX + d) (IX+ d) b 1 11 011 101 11 b 110 SET b, (IY + d) (IY+ d) b 1 11 111 101 11 b 110 RES b, r r b 0 10 b r RES b, (HL) (HL) b 0 10 b 110 RES b, (IX + d) (IX+ d) b 0 11 011 101 10 b 110 RES b, (IY + d) (IY+ d) b 0 11 111 101 10 b 110 4 5 20 2 2 8 b Bit. 000 0 2 4 15 001 1 010 2 011 3 100 4 101 5 110 6 111 7 2 2 8 2 4 15 The notation m b indicates bit b (0 to 7) of location m. BIT instructions are performed by an bitwise AND. = flag is not affected, 0 = flag is reset, 1 = flag is set, X = flag is don t care, Istruzioni di Ingresso / Uscita (Input / Output) Mnemonic Operation S Z H P/V N C 76 543 210 Hex Bytes Cycles Cycles Comments IN A, (n) A (n) 11 011 011 DB 2 3 11 R Reg. 000 B IN r, (C) r (C) 0 P 0 11 101 101 ED 2 3 12 001 C 01 r 000 010 D OUT (n), A (n) A 11 010 011 D3 2 3 11 011 E 100 H OUT (C), r (C) r 11 101 101 ED 2 3 12 101 L 01 r 001 111 A The V symbol in the P/V flag column indicates that the P/V flag contains the overflow of the operation. Similarly the P symbol indicates parity. r means any of the registers A, B, C, D, E, H, L. = flag is not affected, 0 = flag is reset, 1 = flag is set, Elettronica dei Sistemi Digitali 14
Codice ASCII (7 bit) Caratteri Non Stampabili Caratteri Stampabili Char. Dec. Hex. Char. Dec. Hex. Char. Dec. Hex NUL 0 00 DLE 16 10 SOH 1 01 XON 17 11 STX 2 02 DC2 18 12 ETX 3 03 XOFF 19 13 EOT 4 04 DC4 20 14 ENQ 5 05 NAK 21 15 ACK 6 06 SYN 22 16 BEL 7 07 ETB 23 17 BS 8 08 CAN 24 18 HT 9 09 EM 25 19 LF 10 0A SUB 26 1A VT 11 0B ESC 27 1B FF 12 0C FS 28 1C CR 13 0D GS 29 1D SO 14 0E RS 30 1E SI 15 0F US 31 1F DEL 127 7F Char. Dec. Hex. Char. Dec. Hex. Char. Dec. Hex. 32 20 @ 64 40 ` 96 60! 33 21 A 65 41 a 97 61 " 34 22 B 66 42 b 98 62 # 35 23 C 67 43 c 99 63 $ 36 24 D 68 44 d 100 64 % 37 25 E 69 45 e 101 65 & 38 26 F 70 46 f 102 66 ' 39 27 G 71 47 g 103 67 ( 40 28 H 72 48 h 104 68 ) 41 29 I 73 49 i 105 69 * 42 2A J 74 4A j 106 6A + 43 2B K 75 4B k 107 6B, 44 2C L 76 4C l 108 6C - 45 2D M 77 4D m 109 6D. 46 2E N 78 4E n 110 6E / 47 2F O 79 4F o 111 6F 0 48 30 P 80 50 p 112 70 1 49 31 Q 81 51 q 113 71 2 50 32 R 82 52 r 114 72 3 51 33 S 83 53 s 115 73 4 52 34 T 84 54 t 116 74 5 53 35 U 85 55 u 117 75 6 54 36 V 86 56 v 118 76 7 55 37 W 87 57 w 119 77 8 56 38 X 88 58 x 120 78 9 57 39 Y 89 59 y 121 79 : 58 3A Z 90 5A z 122 7A ; 59 3B [ 91 5B { 123 7B < 60 3C \ 92 5C 124 7C = 61 3D ] 93 5D } 125 7D > 62 3E ^ 94 5E ~ 126 7E? 63 3F _ 95 5F Elettronica dei Sistemi Digitali 15