Documentation
¶
Index ¶
- Constants
- type ELuaInstruction
- type ELuaInstructionArgMode
- type ELuaInstructionMode
- type LuaInstruction
- func (me LuaInstruction) ABC() (a, b, c int)
- func (me LuaInstruction) ABx() (a, bx int)
- func (me LuaInstruction) AsBx() (a, sbx int)
- func (me LuaInstruction) Ax() int
- func (me LuaInstruction) BMode() ELuaInstructionArgMode
- func (me LuaInstruction) CMode() ELuaInstructionArgMode
- func (me LuaInstruction) OpCode() ELuaInstruction
- func (me LuaInstruction) OpMode() ELuaInstructionMode
- func (me LuaInstruction) OpName() string
- func (me LuaInstruction) Operands() string
- type LuaInstructionInfo
- func (me *LuaInstructionInfo) ArgBMode() ELuaInstructionArgMode
- func (me *LuaInstructionInfo) ArgCMode() ELuaInstructionArgMode
- func (me *LuaInstructionInfo) Name() string
- func (me *LuaInstructionInfo) OpMode() ELuaInstructionMode
- func (me *LuaInstructionInfo) SetAFlag() byte
- func (me *LuaInstructionInfo) TestFlag() byte
Constants ¶
View Source
const MaxArgBx = 1<<18 - 1
MaxArgBx (比如说255)
View Source
const MaxArgSBx = MaxArgBx >> 1
MaxArgSBx (比如说127)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ELuaInstruction ¶
type ELuaInstruction byte
ELuaInstruction 指令操作码枚举
const ( OpMove ELuaInstruction = iota OpLoadK OpLoadKx OpLoadBool OpLoadNil OpGetUpval OpGetTabup OpGetTable OpSetTabup OpSetUpval OpSetTable OpNewTable OpSelf OpAdd OpSub OpMul OpMod OpPow OpDiv OpIDiv OpBand OpBor OpBxor OpShl OpShr OpUnm OpBNot OpNot OpLen OpConcat OpJmp OpEq OpLt OpLe OpTest OpTestSet OpCall OpTailCall OpReturn OpForLoop OpForPrep OpTForCall OpTForLoop OpSetList OpClosure OpVararg OpExtraarg )
type ELuaInstructionArgMode ¶
type ELuaInstructionArgMode byte
ELuaInstructionArgMode 指令参数类型枚举
const ( // InstructionArgN 不表示任何信息 InstructionArgN ELuaInstructionArgMode = iota // InstructionArgR IABC模式表示寄存器索引,IAsBx模式表示跳转偏移 InstructionArgR // InstructionArgK 常量表索引或寄存器索引 InstructionArgK // InstructionArgU 其他情况(布尔值,整数值,Upvalue索引,子函数索引等) InstructionArgU )
type ELuaInstructionMode ¶
type ELuaInstructionMode int
ELuaInstructionMode 指令编码模式枚举
const ( // IABC 6 8 9 9 IABC ELuaInstructionMode = iota // IABx 6 8 18 IABx // IAsBx 6 8 18 IAsBx // IAx 6 26 IAx )
type LuaInstruction ¶
type LuaInstruction uint32
LuaInstruction Lua指令(为一个32位无符号数)
func (LuaInstruction) BMode ¶
func (me LuaInstruction) BMode() ELuaInstructionArgMode
BMode 获取操作数B的使用模式
func (LuaInstruction) CMode ¶
func (me LuaInstruction) CMode() ELuaInstructionArgMode
CMode 获取操作数C的使用模式
func (LuaInstruction) OpCode ¶
func (me LuaInstruction) OpCode() ELuaInstruction
OpCode 获取指令操作码(左边6个字节)
type LuaInstructionInfo ¶
type LuaInstructionInfo struct {
// contains filtered or unexported fields
}
LuaInstructionInfo 指令信息
func LuaInstructionInfoTable ¶
func LuaInstructionInfoTable(index int) LuaInstructionInfo
LuaInstructionInfoTable 查询指令信息表
func (*LuaInstructionInfo) ArgBMode ¶
func (me *LuaInstructionInfo) ArgBMode() ELuaInstructionArgMode
ArgBMode s
func (*LuaInstructionInfo) ArgCMode ¶
func (me *LuaInstructionInfo) ArgCMode() ELuaInstructionArgMode
ArgCMode s
func (*LuaInstructionInfo) OpMode ¶
func (me *LuaInstructionInfo) OpMode() ELuaInstructionMode
OpMode s
Click to show internal directories.
Click to hide internal directories.