Implemented subtraction

This commit is contained in:
Eduard Urbach 2024-06-24 16:55:15 +02:00
parent 0657b88945
commit 9e3af3b01c
Signed by: eduard
GPG key ID: 49226B848C78F6C8
9 changed files with 92 additions and 28 deletions

View file

@ -0,0 +1,15 @@
package x64
import (
"git.akyoto.dev/cli/q/src/build/cpu"
)
// AddRegNum adds a number to the given register.
func AddRegNum(code []byte, destination cpu.Register, number int) []byte {
return numberToRegister(0x83, 0x81, 0b000, code, destination, number)
}
// SubRegNum subtracts a number from the given register.
func SubRegNum(code []byte, destination cpu.Register, number int) []byte {
return numberToRegister(0x83, 0x81, 0b101, code, destination, number)
}