instruction

package
v0.0.0-...-350ec9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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) ABC

func (me LuaInstruction) ABC() (a, b, c int)

ABC 获取ABC模式下的参数(6,8,9,9)

func (LuaInstruction) ABx

func (me LuaInstruction) ABx() (a, bx int)

ABx 获取ABx模式下的参数(6,8,18)

func (LuaInstruction) AsBx

func (me LuaInstruction) AsBx() (a, sbx int)

AsBx 获取AsBx模式下的参数(6,8,18)

func (LuaInstruction) Ax

func (me LuaInstruction) Ax() int

Ax 获取Ax模式下的参数(6,26)

func (LuaInstruction) BMode

BMode 获取操作数B的使用模式

func (LuaInstruction) CMode

CMode 获取操作数C的使用模式

func (LuaInstruction) OpCode

func (me LuaInstruction) OpCode() ELuaInstruction

OpCode 获取指令操作码(左边6个字节)

func (LuaInstruction) OpMode

func (me LuaInstruction) OpMode() ELuaInstructionMode

OpMode 获取指令模式

func (LuaInstruction) OpName

func (me LuaInstruction) OpName() string

OpName 获取指令名称

func (LuaInstruction) Operands

func (me LuaInstruction) Operands() string

Operands 获取指令操作数信息

type LuaInstructionInfo

type LuaInstructionInfo struct {
	// contains filtered or unexported fields
}

LuaInstructionInfo 指令信息

func LuaInstructionInfoTable

func LuaInstructionInfoTable(index int) LuaInstructionInfo

LuaInstructionInfoTable 查询指令信息表

func (*LuaInstructionInfo) ArgBMode

ArgBMode s

func (*LuaInstructionInfo) ArgCMode

ArgCMode s

func (*LuaInstructionInfo) Name

func (me *LuaInstructionInfo) Name() string

Name s

func (*LuaInstructionInfo) OpMode

OpMode s

func (*LuaInstructionInfo) SetAFlag

func (me *LuaInstructionInfo) SetAFlag() byte

SetAFlag s

func (*LuaInstructionInfo) TestFlag

func (me *LuaInstructionInfo) TestFlag() byte

TestFlag s

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL