1
0
Fork 0
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:
Henrik Hautakoski 2018-10-28 13:27:01 +01:00
parent 96bfab8176
commit 1eef46cc5e
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -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();