Implemented bitwise operations
This commit is contained in:
parent
f68c50247f
commit
a7d8d6ae20
12 changed files with 287 additions and 5 deletions
15
src/build/arch/x64/Xor.go
Normal file
15
src/build/arch/x64/Xor.go
Normal file
|
@ -0,0 +1,15 @@
|
|||
package x64
|
||||
|
||||
import (
|
||||
"git.akyoto.dev/cli/q/src/build/cpu"
|
||||
)
|
||||
|
||||
// XorRegisterNumber performs a bitwise XOR using a register and a number.
|
||||
func XorRegisterNumber(code []byte, destination cpu.Register, number int) []byte {
|
||||
return encodeNum(code, AddressDirect, 0b110, destination, number, 0x83, 0x81)
|
||||
}
|
||||
|
||||
// XorRegisterRegister performs a bitwise XOR using two registers.
|
||||
func XorRegisterRegister(code []byte, destination cpu.Register, operand cpu.Register) []byte {
|
||||
return encode(code, AddressDirect, operand, destination, 8, 0x31)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue