Fixed incorrect register move
This commit is contained in:
@ -20,6 +20,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
}
|
||||
|
||||
f.UseVariable(variable)
|
||||
f.SaveRegister(register)
|
||||
f.RegisterRegister(asm.MOVE, register, variable.Register)
|
||||
return nil
|
||||
|
||||
@ -30,6 +31,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
return err
|
||||
}
|
||||
|
||||
f.SaveRegister(register)
|
||||
f.RegisterNumber(asm.MOVE, register, number)
|
||||
return nil
|
||||
|
||||
@ -37,6 +39,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
||||
data := t.Bytes(f.File.Bytes)
|
||||
data = String(data)
|
||||
label := f.AddBytes(data)
|
||||
f.SaveRegister(register)
|
||||
f.RegisterLabel(asm.MOVE, register, label)
|
||||
return nil
|
||||
|
||||
|
Reference in New Issue
Block a user