Simplified file structure

This commit is contained in:
Eduard Urbach 2024-08-07 19:39:10 +02:00
parent cacee7260a
commit a466281307
Signed by: eduard
GPG key ID: 49226B848C78F6C8
219 changed files with 453 additions and 457 deletions

17
src/arch/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)
}