instruction: 4-bit first;
value: last 4-bit;
assembly language for ZC 1.0:
0000:NOP: no operation;
0001:LDA: load value address in ram into A register;
0010:ADD: adds the value from A register for the value at address value;
0011:SUB: subtract the value from A register for the value at address value;
0100:STA: store value at A register to the value address in ram;
0101:LDI: load value to A register;
0110:JMP: jump;
1000:JC: jump if carry;
1001:JNC: jump if not carry;
1110:OUT: output value to screen;
1111:HLT: halt program;
Note: JC or JNC instruction executes only when ALU returns flag not carry or carry.
Note 2: after jumping with JMP, JC, JNC instruction, the computer will not execute the instruction at the address it jumps to, but will execute the instruction at the next address. for example: jmp 1110; the computer will execute the instruction at address 1111;
MCRZC (8-bit computer)
What is the difference between MCRZC and ZC 1.0 ? :
+MCRZC assembly language is not as powerful as ZC 1.0.
+MCRZC has more RAM than ZC 1.0 (256 byte) so can write larger programs.
+MCRZC clocks 4 times faster than ZC 1.0.
+MCRZC is about 7 times smaller than ZC 1.0 by using FILT and CRAY.
instruction: 4-bit first;
value: 8-bit last;
Assembly language for MCRZC:
BIN : HEX
0000 : 0:NOP: no operation;
0001 : 1:LDA: load value address in ram into A register;
0010 : 2:ADD: adds the value from A register for the value at address value;
0011 : 3:SUB: subtract the value from A register for the value at address value;
0100 : 4:STA+OUT: store value at A register to the value address in RAM and output that value to the screen;
0101 : 5:LDI: load value to A register;
0110 : 6:JMP: jump;
1000 : 8:JC: jump if carry;
1001 : 9:JNC: jump if not carry;
1111 : F:HLT: halt program;
Note: you must write the program properly or you will get an error.
Note: Register A is also an ALU.
Example program:
+Increment:
ADDRESS: CODE
00000000: LDI 00000001;
00000001: STA 00000110;
00000010: STA 11111110;
00000011: ADD 00000110;
00000100: JC 11111111;
00000101: JMP 00000010;
11111111:HLT;
-Other program in my save id:2903580