Flattened package hierarchy

This commit is contained in:
2024-08-25 20:38:22 +02:00
parent 2d8fe15abb
commit b35b17bb32
89 changed files with 42 additions and 42 deletions

17
src/x64/Shift.go Normal file
View File

@ -0,0 +1,17 @@
package x64
import (
"git.akyoto.dev/cli/q/src/cpu"
)
// ShiftLeftNumber shifts the register value by `bitCount` bits to the left.
func ShiftLeftNumber(code []byte, register cpu.Register, bitCount byte) []byte {
code = encode(code, AddressDirect, 0b100, register, 8, 0xC1)
return append(code, bitCount)
}
// ShiftRightSignedNumber shifts the signed register value by `bitCount` bits to the right.
func ShiftRightSignedNumber(code []byte, register cpu.Register, bitCount byte) []byte {
code = encode(code, AddressDirect, 0b111, register, 8, 0xC1)
return append(code, bitCount)
}