Implemented subtraction
This commit is contained in:
parent
0657b88945
commit
9e3af3b01c
9 changed files with 92 additions and 28 deletions
|
@ -1,18 +0,0 @@
|
|||
package x64
|
||||
|
||||
import "git.akyoto.dev/cli/q/src/build/cpu"
|
||||
|
||||
// AddRegNum8 adds a byte to the given register.
|
||||
func AddRegNum8(code []byte, destination cpu.Register, number uint8) []byte {
|
||||
if destination >= 8 {
|
||||
code = append(code, REX(0, 0, 0, 1))
|
||||
destination -= 8
|
||||
}
|
||||
|
||||
return append(
|
||||
code,
|
||||
0x83,
|
||||
ModRM(0b11, 0b000, byte(destination)),
|
||||
byte(number),
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue