Flattened package hierarchy
This commit is contained in:
parent
12dcf672cb
commit
a4dc5a4eff
89 changed files with 42 additions and 42 deletions
|
@ -1,27 +0,0 @@
|
|||
package x64
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/cpu"
|
||||
)
|
||||
|
||||
// StoreNumber stores a number into the memory address included in the given register.
|
||||
func StoreNumber(code []byte, register cpu.Register, offset byte, length byte, number int) []byte {
|
||||
code = memoryAccess(code, 0xC6, 0xC7, register, offset, length, 0b000)
|
||||
|
||||
switch length {
|
||||
case 8, 4:
|
||||
return binary.LittleEndian.AppendUint32(code, uint32(number))
|
||||
|
||||
case 2:
|
||||
return binary.LittleEndian.AppendUint16(code, uint16(number))
|
||||
}
|
||||
|
||||
return append(code, byte(number))
|
||||
}
|
||||
|
||||
// StoreRegister stores the contents of the `source` register into the memory address included in the given register.
|
||||
func StoreRegister(code []byte, register cpu.Register, offset byte, length byte, source cpu.Register) []byte {
|
||||
return memoryAccess(code, 0x88, 0x89, register, offset, length, source)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue