From 74bda7d8b20df78be8a3e4fefdafefcff7c0e23b Mon Sep 17 00:00:00 2001 From: mrbobbyguy <84521318+somerandomviolinkid@users.noreply.github.com> Date: Wed, 9 Sep 2026 18:22:20 -0500 Subject: [PATCH] pc, ir, and mar should all be unsigned --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index b2efd3d..73be276 100644 --- a/main.c +++ b/main.c @@ -111,6 +111,7 @@ #include #include +typedef uint16_t ureg_t; typedef int16_t reg_t; typedef enum INSTRUCTION_E { @@ -151,15 +152,15 @@ typedef struct alu_t { struct cpu_t { reg_t regFile[8]; - reg_t ir; - reg_t pc; + ureg_t ir; + ureg_t pc; bool cc[3]; alu_t alu; } cpu; struct ram_t { int16_t memory[0x10000]; - reg_t mar; + ureg_t mar; reg_t mdr; } ram;