16 lines
301 B
Go
16 lines
301 B
Go
package x64
|
|
|
|
const (
|
|
Scale1 = byte(0b00)
|
|
Scale2 = byte(0b01)
|
|
Scale4 = byte(0b10)
|
|
Scale8 = byte(0b11)
|
|
)
|
|
|
|
// SIB is used to generate an SIB byte.
|
|
// - scale: 2 bits
|
|
// - index: 3 bits
|
|
// - base: 3 bits
|
|
func SIB(scale byte, index byte, base byte) byte {
|
|
return (scale << 6) | (index << 3) | base
|
|
}
|