Implemented parameters

This commit is contained in:
Eduard Urbach 2024-06-27 10:12:41 +02:00
parent 51a2308179
commit 0d8891d8a7
Signed by: eduard
GPG key ID: 49226B848C78F6C8
6 changed files with 76 additions and 27 deletions

View file

@ -101,7 +101,9 @@ func (f *Function) ExecuteRegisterRegister(operation token.Token, destination cp
f.Assembler.RegisterRegister(asm.DIV, destination, source)
case "=":
f.Assembler.RegisterRegister(asm.MOVE, destination, source)
if destination != source {
f.Assembler.RegisterRegister(asm.MOVE, destination, source)
}
default:
return errors.New(&errors.InvalidOperator{Operator: operation.Text()}, f.File, operation.Position)