Improved x64 encoder
This commit is contained in:
parent
2c2b6e93db
commit
53379ff5bc
9 changed files with 214 additions and 49 deletions
|
@ -6,10 +6,10 @@ import (
|
|||
|
||||
// AddRegisterNumber adds a number to the given register.
|
||||
func AddRegisterNumber(code []byte, destination cpu.Register, number int) []byte {
|
||||
return encodeNum(code, 1, AddressDirect, 0, byte(destination), number, 0x83, 0x81)
|
||||
return encodeNum(code, AddressDirect, 0, destination, number, 0x83, 0x81)
|
||||
}
|
||||
|
||||
// AddRegisterRegister adds a register value into another register.
|
||||
func AddRegisterRegister(code []byte, destination cpu.Register, operand cpu.Register) []byte {
|
||||
return encode(code, 1, AddressDirect, byte(operand), byte(destination), 0x01)
|
||||
return encode(code, AddressDirect, operand, destination, 8, 0x01)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue