Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lopcodes.h File Reference
#include "llimits.h"

Go to the source code of this file.

Macros

#define SIZE_C   8
 
#define SIZE_B   8
 
#define SIZE_Bx   (SIZE_C + SIZE_B + 1)
 
#define SIZE_A   8
 
#define SIZE_Ax   (SIZE_Bx + SIZE_A)
 
#define SIZE_sJ   (SIZE_Bx + SIZE_A)
 
#define SIZE_OP   7
 
#define POS_OP   0
 
#define POS_A   (POS_OP + SIZE_OP)
 
#define POS_k   (POS_A + SIZE_A)
 
#define POS_B   (POS_k + 1)
 
#define POS_C   (POS_B + SIZE_B)
 
#define POS_Bx   POS_k
 
#define POS_Ax   POS_A
 
#define POS_sJ   POS_A
 
#define L_INTHASBITS(b)   ((UINT_MAX >> ((b) - 1)) >= 1)
 
#define MAXARG_Bx   MAX_INT
 
#define OFFSET_sBx   (MAXARG_Bx>>1) /* 'sBx' is signed */
 
#define MAXARG_Ax   MAX_INT
 
#define MAXARG_sJ   MAX_INT
 
#define OFFSET_sJ   (MAXARG_sJ >> 1)
 
#define MAXARG_A   ((1<<SIZE_A)-1)
 
#define MAXARG_B   ((1<<SIZE_B)-1)
 
#define MAXARG_C   ((1<<SIZE_C)-1)
 
#define OFFSET_sC   (MAXARG_C >> 1)
 
#define int2sC(i)   ((i) + OFFSET_sC)
 
#define sC2int(i)   ((i) - OFFSET_sC)
 
#define MASK1(n, p)   ((~((~(Instruction)0)<<(n)))<<(p))
 
#define MASK0(n, p)   (~MASK1(n,p))
 
#define GET_OPCODE(i)   (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
 
#define SET_OPCODE(i, o)
 
#define checkopm(i, m)   (getOpMode(GET_OPCODE(i)) == m)
 
#define getarg(i, pos, size)   (cast_int(((i)>>(pos)) & MASK1(size,0)))
 
#define setarg(i, v, pos, size)
 
#define GETARG_A(i)   getarg(i, POS_A, SIZE_A)
 
#define SETARG_A(i, v)   setarg(i, v, POS_A, SIZE_A)
 
#define GETARG_B(i)   check_exp(checkopm(i, iABC), getarg(i, POS_B, SIZE_B))
 
#define GETARG_sB(i)   sC2int(GETARG_B(i))
 
#define SETARG_B(i, v)   setarg(i, v, POS_B, SIZE_B)
 
#define GETARG_C(i)   check_exp(checkopm(i, iABC), getarg(i, POS_C, SIZE_C))
 
#define GETARG_sC(i)   sC2int(GETARG_C(i))
 
#define SETARG_C(i, v)   setarg(i, v, POS_C, SIZE_C)
 
#define TESTARG_k(i)   check_exp(checkopm(i, iABC), (cast_int(((i) & (1u << POS_k)))))
 
#define GETARG_k(i)   check_exp(checkopm(i, iABC), getarg(i, POS_k, 1))
 
#define SETARG_k(i, v)   setarg(i, v, POS_k, 1)
 
#define GETARG_Bx(i)   check_exp(checkopm(i, iABx), getarg(i, POS_Bx, SIZE_Bx))
 
#define SETARG_Bx(i, v)   setarg(i, v, POS_Bx, SIZE_Bx)
 
#define GETARG_Ax(i)   check_exp(checkopm(i, iAx), getarg(i, POS_Ax, SIZE_Ax))
 
#define SETARG_Ax(i, v)   setarg(i, v, POS_Ax, SIZE_Ax)
 
#define GETARG_sBx(i)    check_exp(checkopm(i, iAsBx), getarg(i, POS_Bx, SIZE_Bx) - OFFSET_sBx)
 
#define SETARG_sBx(i, b)   SETARG_Bx((i),cast_uint((b)+OFFSET_sBx))
 
#define GETARG_sJ(i)    check_exp(checkopm(i, isJ), getarg(i, POS_sJ, SIZE_sJ) - OFFSET_sJ)
 
#define SETARG_sJ(i, j)    setarg(i, cast_uint((j)+OFFSET_sJ), POS_sJ, SIZE_sJ)
 
#define CREATE_ABCk(o, a, b, c, k)
 
#define CREATE_ABx(o, a, bc)
 
#define CREATE_Ax(o, a)
 
#define CREATE_sJ(o, j, k)
 
#define MAXINDEXRK   MAXARG_B
 
#define NO_REG   MAXARG_A
 
#define NUM_OPCODES   ((int)(OP_EXTRAARG) + 1)
 
#define getOpMode(m)   (cast(enum OpMode, luaP_opmodes[m] & 7))
 
#define testAMode(m)   (luaP_opmodes[m] & (1 << 3))
 
#define testTMode(m)   (luaP_opmodes[m] & (1 << 4))
 
#define testITMode(m)   (luaP_opmodes[m] & (1 << 5))
 
#define testOTMode(m)   (luaP_opmodes[m] & (1 << 6))
 
#define testMMMode(m)   (luaP_opmodes[m] & (1 << 7))
 
#define isOT(i)
 
#define isIT(i)   (testITMode(GET_OPCODE(i)) && GETARG_B(i) == 0)
 
#define opmode(mm, ot, it, t, a, m)    (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m))
 
#define LFIELDS_PER_FLUSH   50
 

Enumerations

enum  OpMode {
  iABC , iABx , iAsBx , iAx ,
  isJ
}
 
enum  OpCode {
  OP_MOVE , OP_LOADI , OP_LOADF , OP_LOADK ,
  OP_LOADKX , OP_LOADFALSE , OP_LFALSESKIP , OP_LOADTRUE ,
  OP_LOADNIL , OP_GETUPVAL , OP_SETUPVAL , OP_GETTABUP ,
  OP_GETTABLE , OP_GETI , OP_GETFIELD , OP_SETTABUP ,
  OP_SETTABLE , OP_SETI , OP_SETFIELD , OP_NEWTABLE ,
  OP_SELF , OP_ADDI , OP_ADDK , OP_SUBK ,
  OP_MULK , OP_MODK , OP_POWK , OP_DIVK ,
  OP_IDIVK , OP_BANDK , OP_BORK , OP_BXORK ,
  OP_SHRI , OP_SHLI , 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_MMBIN , OP_MMBINI ,
  OP_MMBINK , OP_UNM , OP_BNOT , OP_NOT ,
  OP_LEN , OP_CONCAT , OP_CLOSE , OP_TBC ,
  OP_JMP , OP_EQ , OP_LT , OP_LE ,
  OP_EQK , OP_EQI , OP_LTI , OP_LEI ,
  OP_GTI , OP_GEI , OP_TEST , OP_TESTSET ,
  OP_CALL , OP_TAILCALL , OP_RETURN , OP_RETURN0 ,
  OP_RETURN1 , OP_FORLOOP , OP_FORPREP , OP_TFORPREP ,
  OP_TFORCALL , OP_TFORLOOP , OP_SETLIST , OP_CLOSURE ,
  OP_VARARG , OP_VARARGPREP , OP_EXTRAARG
}
 

Macro Definition Documentation

◆ checkopm

#define checkopm ( i,
m )   (getOpMode(GET_OPCODE(i)) == m)

Definition at line 118 of file lua-5.4.3/src/lopcodes.h.

◆ CREATE_ABCk

#define CREATE_ABCk ( o,
a,
b,
c,
k )
Value:
| (cast(Instruction, b)<<POS_B) \
| (cast(Instruction, c)<<POS_C) \
lu_int32 Instruction
#define cast(t, exp)
#define POS_OP
#define POS_A
#define POS_C
#define POS_B
#define POS_k

Definition at line 156 of file lua-5.4.3/src/lopcodes.h.

156#define CREATE_ABCk(o,a,b,c,k) ((cast(Instruction, o)<<POS_OP) \
157 | (cast(Instruction, a)<<POS_A) \
158 | (cast(Instruction, b)<<POS_B) \
159 | (cast(Instruction, c)<<POS_C) \
160 | (cast(Instruction, k)<<POS_k))

Referenced by luaK_codeABCk(), luaK_settablesize(), and patchtestreg().

◆ CREATE_ABx

#define CREATE_ABx ( o,
a,
bc )
Value:
| (cast(Instruction, bc)<<POS_Bx))
#define POS_Bx

Definition at line 162 of file lua-5.4.3/src/lopcodes.h.

162#define CREATE_ABx(o,a,bc) ((cast(Instruction, o)<<POS_OP) \
163 | (cast(Instruction, a)<<POS_A) \
164 | (cast(Instruction, bc)<<POS_Bx))

◆ CREATE_Ax

#define CREATE_Ax ( o,
a )
Value:
#define POS_Ax

Definition at line 166 of file lua-5.4.3/src/lopcodes.h.

166#define CREATE_Ax(o,a) ((cast(Instruction, o)<<POS_OP) \
167 | (cast(Instruction, a)<<POS_Ax))

◆ CREATE_sJ

#define CREATE_sJ ( o,
j,
k )
Value:
((cast(Instruction, o) << POS_OP) \
| (cast(Instruction, j) << POS_sJ) \
| (cast(Instruction, k) << POS_k))
#define POS_sJ

Definition at line 169 of file lua-5.4.3/src/lopcodes.h.

169#define CREATE_sJ(o,j,k) ((cast(Instruction, o) << POS_OP) \
170 | (cast(Instruction, j) << POS_sJ) \
171 | (cast(Instruction, k) << POS_k))

Referenced by codesJ().

◆ GET_OPCODE

#define GET_OPCODE ( i)    (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))

Definition at line 114 of file lua-5.4.3/src/lopcodes.h.

◆ getarg

#define getarg ( i,
pos,
size )   (cast_int(((i)>>(pos)) & MASK1(size,0)))

Definition at line 121 of file lua-5.4.3/src/lopcodes.h.

◆ GETARG_A

#define GETARG_A ( i)    getarg(i, POS_A, SIZE_A)

Definition at line 125 of file lua-5.4.3/src/lopcodes.h.

◆ GETARG_Ax

#define GETARG_Ax ( i)    check_exp(checkopm(i, iAx), getarg(i, POS_Ax, SIZE_Ax))

Definition at line 143 of file lua-5.4.3/src/lopcodes.h.

◆ GETARG_B

#define GETARG_B ( i)    check_exp(checkopm(i, iABC), getarg(i, POS_B, SIZE_B))

Definition at line 128 of file lua-5.4.3/src/lopcodes.h.

◆ GETARG_Bx

#define GETARG_Bx ( i)    check_exp(checkopm(i, iABx), getarg(i, POS_Bx, SIZE_Bx))

Definition at line 140 of file lua-5.4.3/src/lopcodes.h.

◆ GETARG_C

#define GETARG_C ( i)    check_exp(checkopm(i, iABC), getarg(i, POS_C, SIZE_C))

Definition at line 132 of file lua-5.4.3/src/lopcodes.h.

◆ GETARG_k

#define GETARG_k ( i)    check_exp(checkopm(i, iABC), getarg(i, POS_k, 1))

◆ GETARG_sB

#define GETARG_sB ( i)    sC2int(GETARG_B(i))

Definition at line 129 of file lua-5.4.3/src/lopcodes.h.

Referenced by luaV_execute(), and PrintCode().

◆ GETARG_sBx

#define GETARG_sBx ( i)     check_exp(checkopm(i, iAsBx), getarg(i, POS_Bx, SIZE_Bx) - OFFSET_sBx)

Definition at line 146 of file lua-5.4.3/src/lopcodes.h.

146#define GETARG_sBx(i) \
147 check_exp(checkopm(i, iAsBx), getarg(i, POS_Bx, SIZE_Bx) - OFFSET_sBx)

◆ GETARG_sC

#define GETARG_sC ( i)    sC2int(GETARG_C(i))

Definition at line 133 of file lua-5.4.3/src/lopcodes.h.

Referenced by luaV_execute(), and PrintCode().

◆ GETARG_sJ

#define GETARG_sJ ( i)     check_exp(checkopm(i, isJ), getarg(i, POS_sJ, SIZE_sJ) - OFFSET_sJ)

Definition at line 150 of file lua-5.4.3/src/lopcodes.h.

150#define GETARG_sJ(i) \
151 check_exp(checkopm(i, isJ), getarg(i, POS_sJ, SIZE_sJ) - OFFSET_sJ)

Referenced by finaltarget(), findsetreg(), getjump(), and PrintCode().

◆ getOpMode

#define getOpMode ( m)    (cast(enum OpMode, luaP_opmodes[m] & 7))

Definition at line 370 of file lua-5.4.3/src/lopcodes.h.

◆ int2sC

#define int2sC ( i)    ((i) + OFFSET_sC)

Definition at line 100 of file lua-5.4.3/src/lopcodes.h.

Referenced by codebini(), finishbinexpneg(), and isSCnumber().

◆ isIT

#define isIT ( i)    (testITMode(GET_OPCODE(i)) && GETARG_B(i) == 0)

Definition at line 383 of file lua-5.4.3/src/lopcodes.h.

Referenced by luaG_traceexec(), luaK_finish(), and luaV_execute().

◆ isOT

#define isOT ( i)
Value:
((testOTMode(GET_OPCODE(i)) && GETARG_C(i) == 0) || \
#define testOTMode(m)
#define GET_OPCODE(i)
#define GETARG_C(i)

Definition at line 378 of file lua-5.4.3/src/lopcodes.h.

378#define isOT(i) \
379 ((testOTMode(GET_OPCODE(i)) && GETARG_C(i) == 0) || \
380 GET_OPCODE(i) == OP_TAILCALL)

Referenced by luaK_finish().

◆ L_INTHASBITS

#define L_INTHASBITS ( b)    ((UINT_MAX >> ((b) - 1)) >= 1)

Definition at line 68 of file lua-5.4.3/src/lopcodes.h.

◆ LFIELDS_PER_FLUSH

#define LFIELDS_PER_FLUSH   50

Definition at line 390 of file lua-5.4.3/src/lopcodes.h.

◆ MASK0

#define MASK0 ( n,
p )   (~MASK1(n,p))

Definition at line 108 of file lua-5.4.3/src/lopcodes.h.

◆ MASK1

#define MASK1 ( n,
p )   ((~((~(Instruction)0)<<(n)))<<(p))

Definition at line 105 of file lua-5.4.3/src/lopcodes.h.

◆ MAXARG_A

#define MAXARG_A   ((1<<SIZE_A)-1)

Definition at line 95 of file lua-5.4.3/src/lopcodes.h.

◆ MAXARG_Ax

#define MAXARG_Ax   MAX_INT

Definition at line 83 of file lua-5.4.3/src/lopcodes.h.

◆ MAXARG_B

#define MAXARG_B   ((1<<SIZE_B)-1)

Definition at line 96 of file lua-5.4.3/src/lopcodes.h.

◆ MAXARG_Bx

#define MAXARG_Bx   MAX_INT

Definition at line 74 of file lua-5.4.3/src/lopcodes.h.

◆ MAXARG_C

#define MAXARG_C   ((1<<SIZE_C)-1)

Definition at line 97 of file lua-5.4.3/src/lopcodes.h.

◆ MAXARG_sJ

#define MAXARG_sJ   MAX_INT

Definition at line 89 of file lua-5.4.3/src/lopcodes.h.

Referenced by codesJ(), and fixjump().

◆ MAXINDEXRK

#define MAXINDEXRK   MAXARG_B

Definition at line 175 of file lua-5.4.3/src/lopcodes.h.

◆ NO_REG

#define NO_REG   MAXARG_A

Definition at line 182 of file lua-5.4.3/src/lopcodes.h.

◆ NUM_OPCODES

#define NUM_OPCODES   ((int)(OP_EXTRAARG) + 1)

Definition at line 312 of file lua-5.4.3/src/lopcodes.h.

◆ OFFSET_sBx

#define OFFSET_sBx   (MAXARG_Bx>>1) /* 'sBx' is signed */

Definition at line 77 of file lua-5.4.3/src/lopcodes.h.

Referenced by fitsBx(), and luaK_codeAsBx().

◆ OFFSET_sC

#define OFFSET_sC   (MAXARG_C >> 1)

Definition at line 98 of file lua-5.4.3/src/lopcodes.h.

Referenced by fitsC().

◆ OFFSET_sJ

#define OFFSET_sJ   (MAXARG_sJ >> 1)

Definition at line 92 of file lua-5.4.3/src/lopcodes.h.

Referenced by codesJ(), and fixjump().

◆ opmode

#define opmode ( mm,
ot,
it,
t,
a,
m )    (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m))

Definition at line 385 of file lua-5.4.3/src/lopcodes.h.

385#define opmode(mm,ot,it,t,a,m) \
386 (((mm) << 7) | ((ot) << 6) | ((it) << 5) | ((t) << 4) | ((a) << 3) | (m))

◆ POS_A

#define POS_A   (POS_OP + SIZE_OP)

Definition at line 49 of file lua-5.4.3/src/lopcodes.h.

◆ POS_Ax

#define POS_Ax   POS_A

Definition at line 56 of file lua-5.4.3/src/lopcodes.h.

◆ POS_B

#define POS_B   (POS_k + 1)

Definition at line 51 of file lua-5.4.3/src/lopcodes.h.

◆ POS_Bx

#define POS_Bx   POS_k

Definition at line 54 of file lua-5.4.3/src/lopcodes.h.

◆ POS_C

#define POS_C   (POS_B + SIZE_B)

Definition at line 52 of file lua-5.4.3/src/lopcodes.h.

◆ POS_k

#define POS_k   (POS_A + SIZE_A)

Definition at line 50 of file lua-5.4.3/src/lopcodes.h.

◆ POS_OP

#define POS_OP   0

Definition at line 47 of file lua-5.4.3/src/lopcodes.h.

◆ POS_sJ

#define POS_sJ   POS_A

Definition at line 58 of file lua-5.4.3/src/lopcodes.h.

◆ sC2int

#define sC2int ( i)    ((i) - OFFSET_sC)

Definition at line 101 of file lua-5.4.3/src/lopcodes.h.

◆ SET_OPCODE

#define SET_OPCODE ( i,
o )
Value:
((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
#define SIZE_OP
#define MASK0(n, p)
#define MASK1(n, p)

Definition at line 115 of file lua-5.4.3/src/lopcodes.h.

115#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
116 ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))

◆ setarg

#define setarg ( i,
v,
pos,
size )
Value:
((i) = (((i)&MASK0(size,pos)) | \
((cast(Instruction, v)<<pos)&MASK1(size,pos))))

Definition at line 122 of file lua-5.4.3/src/lopcodes.h.

122#define setarg(i,v,pos,size) ((i) = (((i)&MASK0(size,pos)) | \
123 ((cast(Instruction, v)<<pos)&MASK1(size,pos))))

◆ SETARG_A

#define SETARG_A ( i,
v )   setarg(i, v, POS_A, SIZE_A)

Definition at line 126 of file lua-5.4.3/src/lopcodes.h.

◆ SETARG_Ax

#define SETARG_Ax ( i,
v )   setarg(i, v, POS_Ax, SIZE_Ax)

Definition at line 144 of file lua-5.4.3/src/lopcodes.h.

◆ SETARG_B

#define SETARG_B ( i,
v )   setarg(i, v, POS_B, SIZE_B)

Definition at line 130 of file lua-5.4.3/src/lopcodes.h.

◆ SETARG_Bx

#define SETARG_Bx ( i,
v )   setarg(i, v, POS_Bx, SIZE_Bx)

Definition at line 141 of file lua-5.4.3/src/lopcodes.h.

◆ SETARG_C

#define SETARG_C ( i,
v )   setarg(i, v, POS_C, SIZE_C)

Definition at line 134 of file lua-5.4.3/src/lopcodes.h.

◆ SETARG_k

#define SETARG_k ( i,
v )   setarg(i, v, POS_k, 1)

Definition at line 138 of file lua-5.4.3/src/lopcodes.h.

Referenced by luaK_finish(), and negatecondition().

◆ SETARG_sBx

#define SETARG_sBx ( i,
b )   SETARG_Bx((i),cast_uint((b)+OFFSET_sBx))

Definition at line 148 of file lua-5.4.3/src/lopcodes.h.

◆ SETARG_sJ

#define SETARG_sJ ( i,
j )    setarg(i, cast_uint((j)+OFFSET_sJ), POS_sJ, SIZE_sJ)

Definition at line 152 of file lua-5.4.3/src/lopcodes.h.

152#define SETARG_sJ(i,j) \
153 setarg(i, cast_uint((j)+OFFSET_sJ), POS_sJ, SIZE_sJ)

Referenced by fixjump().

◆ SIZE_A

#define SIZE_A   8

Definition at line 41 of file lua-5.4.3/src/lopcodes.h.

◆ SIZE_Ax

#define SIZE_Ax   (SIZE_Bx + SIZE_A)

Definition at line 42 of file lua-5.4.3/src/lopcodes.h.

◆ SIZE_B

#define SIZE_B   8

Definition at line 39 of file lua-5.4.3/src/lopcodes.h.

◆ SIZE_Bx

#define SIZE_Bx   (SIZE_C + SIZE_B + 1)

Definition at line 40 of file lua-5.4.3/src/lopcodes.h.

◆ SIZE_C

#define SIZE_C   8

Definition at line 38 of file lua-5.4.3/src/lopcodes.h.

◆ SIZE_OP

#define SIZE_OP   7

Definition at line 45 of file lua-5.4.3/src/lopcodes.h.

◆ SIZE_sJ

#define SIZE_sJ   (SIZE_Bx + SIZE_A)

Definition at line 43 of file lua-5.4.3/src/lopcodes.h.

◆ testAMode

#define testAMode ( m)    (luaP_opmodes[m] & (1 << 3))

Definition at line 371 of file lua-5.4.3/src/lopcodes.h.

◆ TESTARG_k

#define TESTARG_k ( i)    check_exp(checkopm(i, iABC), (cast_int(((i) & (1u << POS_k)))))

Definition at line 136 of file lua-5.4.3/src/lopcodes.h.

Referenced by luaV_execute().

◆ testITMode

#define testITMode ( m)    (luaP_opmodes[m] & (1 << 5))

Definition at line 373 of file lua-5.4.3/src/lopcodes.h.

◆ testMMMode

#define testMMMode ( m)    (luaP_opmodes[m] & (1 << 7))

Definition at line 375 of file lua-5.4.3/src/lopcodes.h.

Referenced by findsetreg().

◆ testOTMode

#define testOTMode ( m)    (luaP_opmodes[m] & (1 << 6))

Definition at line 374 of file lua-5.4.3/src/lopcodes.h.

◆ testTMode

#define testTMode ( m)    (luaP_opmodes[m] & (1 << 4))

Definition at line 372 of file lua-5.4.3/src/lopcodes.h.

Enumeration Type Documentation

◆ OpCode

enum OpCode
Enumerator
OP_MOVE 
OP_LOADI 
OP_LOADF 
OP_LOADK 
OP_LOADKX 
OP_LOADFALSE 
OP_LFALSESKIP 
OP_LOADTRUE 
OP_LOADNIL 
OP_GETUPVAL 
OP_SETUPVAL 
OP_GETTABUP 
OP_GETTABLE 
OP_GETI 
OP_GETFIELD 
OP_SETTABUP 
OP_SETTABLE 
OP_SETI 
OP_SETFIELD 
OP_NEWTABLE 
OP_SELF 
OP_ADDI 
OP_ADDK 
OP_SUBK 
OP_MULK 
OP_MODK 
OP_POWK 
OP_DIVK 
OP_IDIVK 
OP_BANDK 
OP_BORK 
OP_BXORK 
OP_SHRI 
OP_SHLI 
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_MMBIN 
OP_MMBINI 
OP_MMBINK 
OP_UNM 
OP_BNOT 
OP_NOT 
OP_LEN 
OP_CONCAT 
OP_CLOSE 
OP_TBC 
OP_JMP 
OP_EQ 
OP_LT 
OP_LE 
OP_EQK 
OP_EQI 
OP_LTI 
OP_LEI 
OP_GTI 
OP_GEI 
OP_TEST 
OP_TESTSET 
OP_CALL 
OP_TAILCALL 
OP_RETURN 
OP_RETURN0 
OP_RETURN1 
OP_FORLOOP 
OP_FORPREP 
OP_TFORPREP 
OP_TFORCALL 
OP_TFORLOOP 
OP_SETLIST 
OP_CLOSURE 
OP_VARARG 
OP_VARARGPREP 
OP_EXTRAARG 

Definition at line 196 of file lua-5.4.3/src/lopcodes.h.

196 {
197/*----------------------------------------------------------------------
198 name args description
199------------------------------------------------------------------------*/
200OP_MOVE,/* A B R[A] := R[B] */
201OP_LOADI,/* A sBx R[A] := sBx */
202OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */
203OP_LOADK,/* A Bx R[A] := K[Bx] */
204OP_LOADKX,/* A R[A] := K[extra arg] */
205OP_LOADFALSE,/* A R[A] := false */
206OP_LFALSESKIP,/*A R[A] := false; pc++ */
207OP_LOADTRUE,/* A R[A] := true */
208OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */
209OP_GETUPVAL,/* A B R[A] := UpValue[B] */
210OP_SETUPVAL,/* A B UpValue[B] := R[A] */
211
212OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:string] */
213OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */
214OP_GETI,/* A B C R[A] := R[B][C] */
215OP_GETFIELD,/* A B C R[A] := R[B][K[C]:string] */
216
217OP_SETTABUP,/* A B C UpValue[A][K[B]:string] := RK(C) */
218OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */
219OP_SETI,/* A B C R[A][B] := RK(C) */
220OP_SETFIELD,/* A B C R[A][K[B]:string] := RK(C) */
221
222OP_NEWTABLE,/* A B C k R[A] := {} */
223
224OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][RK(C):string] */
225
226OP_ADDI,/* A B sC R[A] := R[B] + sC */
227
228OP_ADDK,/* A B C R[A] := R[B] + K[C]:number */
229OP_SUBK,/* A B C R[A] := R[B] - K[C]:number */
230OP_MULK,/* A B C R[A] := R[B] * K[C]:number */
231OP_MODK,/* A B C R[A] := R[B] % K[C]:number */
232OP_POWK,/* A B C R[A] := R[B] ^ K[C]:number */
233OP_DIVK,/* A B C R[A] := R[B] / K[C]:number */
234OP_IDIVK,/* A B C R[A] := R[B] // K[C]:number */
235
236OP_BANDK,/* A B C R[A] := R[B] & K[C]:integer */
237OP_BORK,/* A B C R[A] := R[B] | K[C]:integer */
238OP_BXORK,/* A B C R[A] := R[B] ~ K[C]:integer */
239
240OP_SHRI,/* A B sC R[A] := R[B] >> sC */
241OP_SHLI,/* A B sC R[A] := sC << R[B] */
242
243OP_ADD,/* A B C R[A] := R[B] + R[C] */
244OP_SUB,/* A B C R[A] := R[B] - R[C] */
245OP_MUL,/* A B C R[A] := R[B] * R[C] */
246OP_MOD,/* A B C R[A] := R[B] % R[C] */
247OP_POW,/* A B C R[A] := R[B] ^ R[C] */
248OP_DIV,/* A B C R[A] := R[B] / R[C] */
249OP_IDIV,/* A B C R[A] := R[B] // R[C] */
250
251OP_BAND,/* A B C R[A] := R[B] & R[C] */
252OP_BOR,/* A B C R[A] := R[B] | R[C] */
253OP_BXOR,/* A B C R[A] := R[B] ~ R[C] */
254OP_SHL,/* A B C R[A] := R[B] << R[C] */
255OP_SHR,/* A B C R[A] := R[B] >> R[C] */
256
257OP_MMBIN,/* A B C call C metamethod over R[A] and R[B] */
258OP_MMBINI,/* A sB C k call C metamethod over R[A] and sB */
259OP_MMBINK,/* A B C k call C metamethod over R[A] and K[B] */
260
261OP_UNM,/* A B R[A] := -R[B] */
262OP_BNOT,/* A B R[A] := ~R[B] */
263OP_NOT,/* A B R[A] := not R[B] */
264OP_LEN,/* A B R[A] := #R[B] (length operator) */
265
266OP_CONCAT,/* A B R[A] := R[A].. ... ..R[A + B - 1] */
267
268OP_CLOSE,/* A close all upvalues >= R[A] */
269OP_TBC,/* A mark variable A "to be closed" */
270OP_JMP,/* sJ pc += sJ */
271OP_EQ,/* A B k if ((R[A] == R[B]) ~= k) then pc++ */
272OP_LT,/* A B k if ((R[A] < R[B]) ~= k) then pc++ */
273OP_LE,/* A B k if ((R[A] <= R[B]) ~= k) then pc++ */
274
275OP_EQK,/* A B k if ((R[A] == K[B]) ~= k) then pc++ */
276OP_EQI,/* A sB k if ((R[A] == sB) ~= k) then pc++ */
277OP_LTI,/* A sB k if ((R[A] < sB) ~= k) then pc++ */
278OP_LEI,/* A sB k if ((R[A] <= sB) ~= k) then pc++ */
279OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */
280OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */
281
282OP_TEST,/* A k if (not R[A] == k) then pc++ */
283OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */
284
285OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */
286OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */
287
288OP_RETURN,/* A B C k return R[A], ... ,R[A+B-2] (see note) */
289OP_RETURN0,/* return */
290OP_RETURN1,/* A return R[A] */
291
292OP_FORLOOP,/* A Bx update counters; if loop continues then pc-=Bx; */
293OP_FORPREP,/* A Bx <check values and prepare counters>;
294 if not to run then pc+=Bx+1; */
295
296OP_TFORPREP,/* A Bx create upvalue for R[A + 3]; pc+=Bx */
297OP_TFORCALL,/* A C R[A+4], ... ,R[A+3+C] := R[A](R[A+1], R[A+2]); */
298OP_TFORLOOP,/* A Bx if R[A+2] ~= nil then { R[A]=R[A+2]; pc -= Bx } */
299
300OP_SETLIST,/* A B C k R[A][C+i] := R[A+i], 1 <= i <= B */
301
302OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */
303
304OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
305
306OP_VARARGPREP,/*A (adjust vararg parameters) */
307
308OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */
309} OpCode;

◆ OpMode

enum OpMode
Enumerator
iABC 
iABx 
iAsBx 
iAx 
isJ 

Definition at line 32 of file lua-5.4.3/src/lopcodes.h.

32{iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */