Documentation
¶
Index ¶
- Constants
- func Fb2int(x int) int
- func Int2fb(x int) int
- type Instruction
- func (self Instruction) ABC() (a, b, c int)
- func (self Instruction) ABx() (a, bx int)
- func (self Instruction) AsBx() (a, sbx int)
- func (self Instruction) Ax() int
- func (self Instruction) BMode() byte
- func (self Instruction) CMode() byte
- func (self Instruction) Execute(vm api.LuaVM)
- func (self Instruction) OpMode() byte
- func (self Instruction) OpName() string
- func (self Instruction) Opcode() int
Constants ¶
View Source
const ( IABC = iota // [ B:9 ][ C:9 ][ A:8 ][OP:6] IABx // [ Bx:18 ][ A:8 ][OP:6] IAsBx // [ sBx:18 ][ A:8 ][OP:6] IAx // [ Ax:26 ][OP:6] )
OpMode basic instruction format
View Source
const ( OpArgN = iota // argument is not used OpArgU // argument is used OpArgR // argument is a register or a jump offset OpArgK // argument is a constant or register/constant )
OpArgMask
View Source
const ( OP_MOVE = iota OP_LOADK OP_LOADKX OP_LOADBOOL OP_LOADNIL OP_GETUPVAL OP_GETTABUP OP_GETTABLE OP_SETTABUP OP_SETUPVAL OP_SETTABLE OP_NEWTABLE OP_SELF OP_ADD OP_SUB OP_MUL OP_MOD OP_POW OP_DIV OP_IDIV OP_BAND OP_BOR OP_BXOR OP_SHL OP_SHR OP_UNM OP_BNOT OP_NOT OP_LEN OP_CONCAT OP_JMP OP_EQ OP_LT OP_LE OP_TEST OP_TESTSET OP_CALL OP_TAILCALL OP_RETURN OP_FORLOOP OP_FORPREP OP_TFORCALL OP_TFORLOOP OP_SETLIST OP_CLOSURE OP_VARARG OP_EXTRAARG )
OpCode
View Source
const LFIELDS_PER_FLUSH = 50
number of list items to accumulate before a SETLIST instruction
View Source
const MAXARG_Bx = 1<<18 - 1 // 262143
View Source
const MAXARG_sBx = MAXARG_Bx >> 1 // 131071
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Instruction ¶
type Instruction uint32
31 22 13 5 0
+-------+^------+-^-----+-^----- |b=9bits |c=9bits |a=8bits|op=6| +-------+^------+-^-----+-^----- | bx=18bits |a=8bits|op=6| +-------+^------+-^-----+-^----- | sbx=18bits |a=8bits|op=6| +-------+^------+-^-----+-^----- | ax=26bits |op=6| +-------+^------+-^-----+-^-----
31 23 15 7 0
func (Instruction) ABC ¶
func (self Instruction) ABC() (a, b, c int)
func (Instruction) ABx ¶
func (self Instruction) ABx() (a, bx int)
func (Instruction) AsBx ¶
func (self Instruction) AsBx() (a, sbx int)
func (Instruction) Ax ¶
func (self Instruction) Ax() int
func (Instruction) BMode ¶
func (self Instruction) BMode() byte
func (Instruction) CMode ¶
func (self Instruction) CMode() byte
func (Instruction) Execute ¶
func (self Instruction) Execute(vm api.LuaVM)
func (Instruction) OpMode ¶
func (self Instruction) OpMode() byte
func (Instruction) OpName ¶
func (self Instruction) OpName() string
func (Instruction) Opcode ¶
func (self Instruction) Opcode() int
Click to show internal directories.
Click to hide internal directories.