From dca453457d03fd02b71bc8a00a20ca9e3cbb32f4 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 28 Oct 2018 14:21:00 +0100 Subject: [PATCH] src/cpu: add the define "CPU_NUM_REGS" --- src/cpu.c | 2 +- src/cpu.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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();