Removed unnecessary list of registers
This commit is contained in:
@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -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<<reg) != 0 {
|
||||
registers.WriteString("● ")
|
||||
} else {
|
||||
|
@ -2,10 +2,10 @@ package cpu
|
||||
|
||||
// CPU represents the processor.
|
||||
type CPU struct {
|
||||
All []Register
|
||||
General []Register
|
||||
Input []Register
|
||||
Output []Register
|
||||
SyscallInput []Register
|
||||
SyscallOutput []Register
|
||||
NumRegisters byte
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
AllRegisters = []cpu.Register{RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15}
|
||||
SyscallInputRegisters = []cpu.Register{RAX, RDI, RSI, RDX, R10, R8, R9}
|
||||
SyscallOutputRegisters = []cpu.Register{RAX, RCX, R11}
|
||||
GeneralRegisters = []cpu.Register{RBX, R12, R13, R14, R15, RCX, R11}
|
||||
|
Reference in New Issue
Block a user