
Un meraviglioso processore a 4 bit
Questo articolo presenta un progetto per i hobbisti, che è stato sviluppato come mezzo di auto-istruzione per imparare di più sulle architetture hardware.

Qui sotto c'è una parte del programma:
00: F CLF ; Initialize 01: 7 0 0 AND 00 ; Load 0 to accumulator 04: 2 E F STA FE ; Set #FE to 0 07: 1 C F LDA FC ; Load first argument 0A: 5 F 0 AND 0F ; Take low nybble 0D: 2 A F STA FA ; Store at working storage 10: 1 D F LDA FD ; Load second argument 13: 5 F 0 AND 0F ; Take low nybble 16: 2 9 2 STA 29 ; Store as argument to ADD instruction 19: 1 A F LDA FA ; Load first argument 1C: F CLF ; 1D: E ROR ; Take one bit 1E: 2 A F STA FA ; Store the rest 21: C E 2 JNC 2E ; If not 1, no need to add 24: 1 E F LDA FE ; Load result 27: F CLF ; 28: 7 0 0 ADD 00 ; Add second argument (stored here) 2B: 2 E F STA FE ; Store result 2E: 1 9 2 LDA 29 ; Load second argument 31: F CLF ; Multiply by 2 32: D ROL ; 33: 2 9 2 STA 29 ; Store 36: 1 A F LDA FA ; Reload first 39: F CLF ; 3C: 7 0 0 ADD 00 ; Check for 0 3D: 9 D 1 JNZ 1D ; Repeat loop if necessary 40: 0 HLT ; Result obtained 41: 3 0 0 JMP 00 ; Restart FA: 0 0 ; Working storage FC: 3 5 ; Operands FE: 0 0 ; Result
Source: http://www.vttoth.com/vicproc.htm
