Implemented subtraction

This commit is contained in:
2024-06-24 16:55:15 +02:00
parent 597cb9abed
commit b018d8de61
9 changed files with 92 additions and 28 deletions

View File

@ -30,10 +30,13 @@ func (a *Assembler) Finalize() ([]byte, []byte) {
case ADD:
switch operands := x.Data.(type) {
case *RegisterNumber:
code = x64.AddRegNum8(code, operands.Register, uint8(operands.Number))
code = x64.AddRegNum(code, operands.Register, operands.Number)
}
case *RegisterRegister:
// code = x64.AddRegReg64(code, operands.Destination, operands.Source)
case SUB:
switch operands := x.Data.(type) {
case *RegisterNumber:
code = x64.SubRegNum(code, operands.Register, operands.Number)
}
case CALL: