From 1b706fa71672dd94e0691aece87032f2adb70ee9 Mon Sep 17 00:00:00 2001 From: mrbobbyguy <84521318+somerandomviolinkid@users.noreply.github.com> Date: Mon, 7 Sep 2026 13:00:24 -0500 Subject: [PATCH] update docs to include register list and explanations --- main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.c b/main.c index b00f3b6..407f797 100644 --- a/main.c +++ b/main.c @@ -85,6 +85,13 @@ ex. trap 0 + **** REGISTERS **** + r0...r7: general purpose registers (r0 is usually used as an argument for trap calls, r7 is used for return addresses) + accumulator: register inside alu that stores results of arithmetic and logical operations + ir (instruction register): stores the current instruction the cpu is executing + pc (program counter): stores the memory address of the NEXT instruction to execute (gets incremented during fetch phase of execution, so keep in mind anything using pc-relative addressing will be using the incremented pc) + cc: 3 bit flags which consist of n (negative), z (zero), and p (positive), are changed whenever an instruction modifies a general purpose register + **** NOTES **** any immediate values in assembly will clamp to be within bounds, e.g. for ADD normal immediate, if you put 60 as the immediate value it will clamp to 15 any unused bits in a machine code instruction will be set to 0