Implemented modulo operation

This commit is contained in:
2024-07-25 12:11:55 +02:00
parent 65cc81032b
commit 60b8ff1308
7 changed files with 75 additions and 0 deletions

View File

@ -22,6 +22,9 @@ func (f *Function) ExecuteRegisterNumber(operation token.Token, register cpu.Reg
case token.Div, token.DivAssign:
f.RegisterNumber(asm.DIV, register, number)
case token.Mod, token.ModAssign:
f.RegisterNumber(asm.MODULO, register, number)
case token.Equal, token.NotEqual, token.Less, token.LessEqual, token.Greater, token.GreaterEqual:
f.RegisterNumber(asm.COMPARE, register, number)