Implemented simple expressions

This commit is contained in:
Eduard Urbach 2024-06-25 20:50:06 +02:00
parent c437b1d0f8
commit 37e222e022
Signed by: eduard
GPG key ID: 49226B848C78F6C8
12 changed files with 232 additions and 52 deletions

View file

@ -6,5 +6,10 @@ import (
// SubRegNum subtracts a number from the given register.
func SubRegNum(code []byte, destination cpu.Register, number int) []byte {
return numRegReg(code, 0x83, 0x81, 0b101, byte(destination), number)
return numRegReg(code, 0b101, byte(destination), number, 0x83, 0x81)
}
// SubRegReg subtracts a register value from another register.
func SubRegReg(code []byte, destination cpu.Register, operand cpu.Register) []byte {
return regReg(code, byte(operand), byte(destination), 0x29)
}