Added register move for syscall returns
All checks were successful
/ test (push) Successful in 15s

This commit is contained in:
Eduard Urbach 2025-07-02 17:37:46 +02:00
parent 3301cf5542
commit e833268061
Signed by: akyoto
GPG key ID: 49226B848C78F6C8

View file

@ -50,5 +50,15 @@ func (f *Compiler) ValueToRegister(instr ssa.Value, destination cpu.Register) {
Destination: destination,
Source: source,
})
case *ssa.Syscall:
if destination == f.CPU.Return[0] {
return
}
f.Assembler.Append(&asm.MoveRegisterRegister{
Destination: destination,
Source: f.CPU.Return[0],
})
}
}