mirror of
https://github.com/pnx/m16vm
synced 2026-06-16 03:44:55 +02:00
src/cpu.c: adding print_reg()
This commit is contained in:
parent
96bfab8176
commit
1eef46cc5e
1 changed files with 13 additions and 0 deletions
13
src/cpu.c
13
src/cpu.c
|
|
@ -110,6 +110,18 @@ void print_memory() {
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
void print_reg() {
|
||||
|
||||
int i = 0;
|
||||
|
||||
printf("\n");
|
||||
|
||||
for(i = 0; i < 16; i++) {
|
||||
printf("r%i = %i\n", i, reg[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static unsigned char* instr_fetch() {
|
||||
|
||||
if (pc + 1 >= instr_cnt >> 1)
|
||||
|
|
@ -163,6 +175,7 @@ void cpu_run() {
|
|||
execute(&instr);
|
||||
}
|
||||
|
||||
print_reg();
|
||||
print_memory();
|
||||
|
||||
mm_exit();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue