Implemented subtraction
This commit is contained in:
parent
0657b88945
commit
9e3af3b01c
9 changed files with 92 additions and 28 deletions
15
src/build/arch/x64/Math.go
Normal file
15
src/build/arch/x64/Math.go
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue