Add more CPU outputs for stdout.
This commit is contained in:
parent
c9b291ce38
commit
82aba5e133
15
src/main.c
15
src/main.c
@ -18,17 +18,24 @@ int main(int argc, char *argv[])
|
||||
int quit='n';
|
||||
bool run = true;
|
||||
|
||||
printf("\n+++++++++++++++++++++++++++++++++++++++++++\n+Boot: "CPU_TYPE
|
||||
" wite %zu x %zu RAM.+\n+++++++++++++++++++++++++++++++++++++++++++\n\n"
|
||||
,(sizeof(ram)/sizeof(ram[0])),sizeof(ram[0])*8);
|
||||
|
||||
if(initialise_ram(ram,argc,argv)==-1) return 1;
|
||||
|
||||
|
||||
while(run && pc<(RAM_SIZE-1))
|
||||
{
|
||||
ir = ram[pc];
|
||||
op_code = get_opcode(ir);
|
||||
data_addr=find_data(ir);
|
||||
#ifdef DEBUG
|
||||
printf("OP Code: %"PRIu8"\n",op_code);
|
||||
printf("Adresse: %d\n",data_addr);
|
||||
#endif
|
||||
|
||||
printf("Inst: ");
|
||||
fprintBits(sizeof(*ram), ram+pc,stdout);
|
||||
printf("OP Code: %"PRIu8" ",op_code);
|
||||
printf("Adresse: %d\n",data_addr);
|
||||
|
||||
if(execute(op_code,data_addr,ram))
|
||||
pc=find_data(ram[pc]); //jump if ACCU is ZERO
|
||||
else pc++;
|
||||
|
Loading…
Reference in New Issue
Block a user