Implemented Value interface

This commit is contained in:
2025-02-28 12:15:19 +01:00
parent 31423ccc08
commit b67361c035
36 changed files with 194 additions and 153 deletions

View File

@ -19,12 +19,12 @@ func (f *Machine) SaveRegister(register cpu.Register) {
variable := f.VariableByRegister(register)
if variable == nil || variable.Alive == 0 {
if variable == nil || variable.Value.Alive == 0 {
return
}
newRegister := f.NewRegister()
f.RegisterRegister(asm.MOVE, newRegister, register)
variable.Register = newRegister
variable.Value.Register = newRegister
f.FreeRegister(register)
}