From 14abb8202ba408b37e0895c632c5a14bda44249e Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Wed, 5 Mar 2025 14:41:58 +0100 Subject: [PATCH] Removed unnecessary list of registers --- src/core/NewFunction.go | 2 +- src/core/PrintInstructions.go | 2 +- src/cpu/CPU.go | 2 +- src/x86/Registers.go | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/NewFunction.go b/src/core/NewFunction.go index dabb185..1450660 100644 --- a/src/core/NewFunction.go +++ b/src/core/NewFunction.go @@ -24,12 +24,12 @@ func NewFunction(pkg string, name string, file *fs.File) *Function { Scopes: []*scope.Scope{{}}, }, CPU: cpu.CPU{ - All: x86.AllRegisters, General: x86.GeneralRegisters, Input: x86.InputRegisters, Output: x86.OutputRegisters, SyscallInput: x86.SyscallInputRegisters, SyscallOutput: x86.SyscallOutputRegisters, + NumRegisters: 16, }, }, } diff --git a/src/core/PrintInstructions.go b/src/core/PrintInstructions.go index 69cfc26..cc81953 100644 --- a/src/core/PrintInstructions.go +++ b/src/core/PrintInstructions.go @@ -44,7 +44,7 @@ func (f *Function) PrintInstructions() { registers := bytes.Buffer{} used := f.RegisterHistory[i] - for _, reg := range f.CPU.All { + for reg := range f.CPU.NumRegisters { if used&(1<