diff --git a/src/cpu.c b/src/cpu.c index a78c94c..79d52c6 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -32,7 +32,7 @@ #include "instr.h" // Registers r0, r15 -int16_t reg[16] = { 0 }; +int16_t reg[CPU_NUM_REGS] = { 0 }; /* Program */ unsigned char *instr_mem = NULL; diff --git a/src/cpu.h b/src/cpu.h index c9eef2e..a9b1473 100644 --- a/src/cpu.h +++ b/src/cpu.h @@ -23,6 +23,8 @@ #include #include "instr.h" +#define CPU_NUM_REGS 16 + int cpu_instr_load(void *ptr, unsigned len); void cpu_instr_unload();