Improved branch code generation

This commit is contained in:
2024-07-07 15:20:21 +02:00
parent 403e78f655
commit 23b4e6442d
3 changed files with 19 additions and 15 deletions

View File

@ -22,6 +22,9 @@ func (f *Function) ExecuteRegisterNumber(operation token.Token, register cpu.Reg
case "/", "/=":
f.assembler.RegisterNumber(asm.DIV, register, number)
case "==", "!=", "<", "<=", ">", ">=":
f.assembler.RegisterNumber(asm.COMPARE, register, number)
case "=":
f.assembler.RegisterNumber(asm.MOVE, register, number)