Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Instruction_Length ¶
func Instruction_Length(instr Instruction) (int, error)
func IsRegister ¶
Types ¶
type Instruction ¶
type Instruction interface { Encode() (MachineCode, error) String() string }
type Instructions ¶
type Instructions []Instruction
func (Instructions) Add ¶
func (i Instructions) Add(i2 []Instruction) Instructions
func (Instructions) Encode ¶
func (i Instructions) Encode() (MachineCode, error)
func (Instructions) String ¶
func (i Instructions) String() string
type MachineCode ¶
type MachineCode []uint8
func CompileInstruction ¶
func CompileInstruction(instr []Instruction, debug bool) (MachineCode, error)
func (MachineCode) Add ¶
func (m MachineCode) Add(m2 MachineCode) MachineCode
func (MachineCode) Execute ¶
func (m MachineCode) Execute(debug bool) int
func (MachineCode) String ¶
func (m MachineCode) String() string
type Type ¶
type Type uint8
const ( T_Register Type = iota // e.g. %rax T_IndirectRegister Type = iota // e.g. (%rax) T_RIPRelative Type = iota // e.g. -$0x18(%rip) T_SIBRegister Type = iota // e.g. (%rax, %rcx, 8) (the address of %rxc * 8 + %rax) T_DisplacedRegister Type = iota // e.g. 0x9(%rax) // TODO T_DisplacedSIBRegister Type = iota // e.g. 0x9(%rax, %rcx, 8) the address of %rcx * 8 + %rax + 9) T_Uint8 Type = iota T_Uint16 Type = iota T_Uint32 Type = iota T_Uint64 Type = iota T_Int32 Type = iota T_Float32 Type = iota T_Float64 Type = iota )
Click to show internal directories.
Click to hide internal directories.