Follow 12 BIT address bus.
This commit is contained in:
parent
a907e23f9c
commit
bc97f5bd79
@ -43,6 +43,7 @@ int main(int argc, char *argv[])
|
|||||||
if(execute(op_code,data_addr,ram)) //EXECUTE instruction, jump if ALU says
|
if(execute(op_code,data_addr,ram)) //EXECUTE instruction, jump if ALU says
|
||||||
pc=find_data(ram[pc]);
|
pc=find_data(ram[pc]);
|
||||||
else pc++;
|
else pc++;
|
||||||
|
if(pc>4095) pc = pc % 4096; //TOY can only address 12 Bit
|
||||||
|
|
||||||
//Handele user output
|
//Handele user output
|
||||||
printf("PROGRAM COUNTER: %" PRIu16 "\n",pc);
|
printf("PROGRAM COUNTER: %" PRIu16 "\n",pc);
|
||||||
|
Loading…
Reference in New Issue
Block a user