Moved sizeof functions to a separate package

This commit is contained in:
Eduard Urbach 2024-07-29 12:33:28 +02:00
parent 6d77a8a120
commit 315ad23e31
Signed by: eduard
GPG key ID: 49226B848C78F6C8
13 changed files with 83 additions and 40 deletions

View file

@ -4,13 +4,14 @@ import (
"encoding/binary"
"git.akyoto.dev/cli/q/src/build/cpu"
"git.akyoto.dev/cli/q/src/build/sizeof"
)
// MoveRegisterNumber moves an integer into the given register.
func MoveRegisterNumber(code []byte, destination cpu.Register, number int) []byte {
w := byte(0)
if SizeOf(int64(number)) == 8 {
if sizeof.Signed(int64(number)) == 8 {
w = 1
}