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<