CHDK_DE Vorschauversion  Trunk Rev. 6014
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
lopcodes.h-Dateireferenz
#include "llimits.h"
+ Include-Abhängigkeitsdiagramm für lopcodes.h:
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define SIZE_C   9
 
#define SIZE_B   9
 
#define SIZE_Bx   (SIZE_C + SIZE_B)
 
#define SIZE_A   8
 
#define SIZE_OP   6
 
#define POS_OP   0
 
#define POS_A   (POS_OP + SIZE_OP)
 
#define POS_C   (POS_A + SIZE_A)
 
#define POS_B   (POS_C + SIZE_C)
 
#define POS_Bx   POS_C
 
#define MAXARG_Bx   MAX_INT
 
#define MAXARG_sBx   MAX_INT
 
#define MAXARG_A   ((1<<SIZE_A)-1)
 
#define MAXARG_B   ((1<<SIZE_B)-1)
 
#define MAXARG_C   ((1<<SIZE_C)-1)
 
#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 GETARG_A(i)   (cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))
 
#define SETARG_A(i, u)
 
#define GETARG_B(i)   (cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))
 
#define SETARG_B(i, b)
 
#define GETARG_C(i)   (cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))
 
#define SETARG_C(i, b)
 
#define GETARG_Bx(i)   (cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))
 
#define SETARG_Bx(i, b)
 
#define GETARG_sBx(i)   (GETARG_Bx(i)-MAXARG_sBx)
 
#define SETARG_sBx(i, b)   SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))
 
#define CREATE_ABC(o, a, b, c)
 
#define CREATE_ABx(o, a, bc)
 
#define BITRK   (1 << (SIZE_B - 1))
 
#define ISK(x)   ((x) & BITRK)
 
#define INDEXK(r)   ((int)(r) & ~BITRK)
 
#define MAXINDEXRK   (BITRK - 1)
 
#define RKASK(x)   ((x) | BITRK)
 
#define NO_REG   MAXARG_A
 
#define NUM_OPCODES   (cast(int, OP_VARARG) + 1)
 
#define getOpMode(m)   (cast(enum OpMode, luaP_opmodes[m] & 3))
 
#define getBMode(m)   (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))
 
#define getCMode(m)   (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))
 
#define testAMode(m)   (luaP_opmodes[m] & (1 << 6))
 
#define testTMode(m)   (luaP_opmodes[m] & (1 << 7))
 
#define LFIELDS_PER_FLUSH   50
 

Aufzählungen

enum  OpMode { iABC, iABx, iAsBx }
 
enum  OpCode {
  OP_MOVE, OP_LOADK, OP_LOADBOOL, OP_LOADNIL,
  OP_GETUPVAL, OP_GETGLOBAL, OP_GETTABLE, OP_SETGLOBAL,
  OP_SETUPVAL, OP_SETTABLE, OP_NEWTABLE, OP_SELF,
  OP_ADD, OP_SUB, OP_MUL, OP_DIV,
  OP_MOD, OP_POW, OP_UNM, 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_TFORLOOP, OP_SETLIST, OP_CLOSE,
  OP_CLOSURE, OP_VARARG
}
 
enum  OpArgMask { OpArgN, OpArgU, OpArgR, OpArgK }
 

Variablen

LUAI_DATA const lu_byte luaP_opmodes [NUM_OPCODES]
 
LUAI_DATA const char *const luaP_opnames [NUM_OPCODES+1]
 

Makro-Dokumentation

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

Definiert in Zeile 119 der Datei lopcodes.h.

#define CREATE_ABC (   o,
  a,
  b,
 
)
Wert:

Definiert in Zeile 104 der Datei lopcodes.h.

#define CREATE_ABx (   o,
  a,
  bc 
)
Wert:

Definiert in Zeile 109 der Datei lopcodes.h.

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

Definiert in Zeile 80 der Datei lopcodes.h.

#define GETARG_A (   i)    (cast(int, ((i)>>POS_A) & MASK1(SIZE_A,0)))

Definiert in Zeile 84 der Datei lopcodes.h.

#define GETARG_B (   i)    (cast(int, ((i)>>POS_B) & MASK1(SIZE_B,0)))

Definiert in Zeile 88 der Datei lopcodes.h.

#define GETARG_Bx (   i)    (cast(int, ((i)>>POS_Bx) & MASK1(SIZE_Bx,0)))

Definiert in Zeile 96 der Datei lopcodes.h.

#define GETARG_C (   i)    (cast(int, ((i)>>POS_C) & MASK1(SIZE_C,0)))

Definiert in Zeile 92 der Datei lopcodes.h.

#define GETARG_sBx (   i)    (GETARG_Bx(i)-MAXARG_sBx)

Definiert in Zeile 100 der Datei lopcodes.h.

#define getBMode (   m)    (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3))

Definiert in Zeile 255 der Datei lopcodes.h.

#define getCMode (   m)    (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3))

Definiert in Zeile 256 der Datei lopcodes.h.

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

Definiert in Zeile 254 der Datei lopcodes.h.

#define INDEXK (   r)    ((int)(r) & ~BITRK)

Definiert in Zeile 125 der Datei lopcodes.h.

#define ISK (   x)    ((x) & BITRK)

Definiert in Zeile 122 der Datei lopcodes.h.

#define LFIELDS_PER_FLUSH   50

Definiert in Zeile 265 der Datei lopcodes.h.

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

Definiert in Zeile 74 der Datei lopcodes.h.

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

Definiert in Zeile 71 der Datei lopcodes.h.

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

Definiert in Zeile 65 der Datei lopcodes.h.

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

Definiert in Zeile 66 der Datei lopcodes.h.

#define MAXARG_Bx   MAX_INT

Definiert in Zeile 60 der Datei lopcodes.h.

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

Definiert in Zeile 67 der Datei lopcodes.h.

#define MAXARG_sBx   MAX_INT

Definiert in Zeile 61 der Datei lopcodes.h.

#define MAXINDEXRK   (BITRK - 1)

Definiert in Zeile 127 der Datei lopcodes.h.

#define NO_REG   MAXARG_A

Definiert in Zeile 136 der Datei lopcodes.h.

#define NUM_OPCODES   (cast(int, OP_VARARG) + 1)

Definiert in Zeile 211 der Datei lopcodes.h.

#define POS_A   (POS_OP + SIZE_OP)

Definiert in Zeile 45 der Datei lopcodes.h.

#define POS_B   (POS_C + SIZE_C)

Definiert in Zeile 47 der Datei lopcodes.h.

#define POS_Bx   POS_C

Definiert in Zeile 48 der Datei lopcodes.h.

#define POS_C   (POS_A + SIZE_A)

Definiert in Zeile 46 der Datei lopcodes.h.

#define POS_OP   0

Definiert in Zeile 44 der Datei lopcodes.h.

#define RKASK (   x)    ((x) | BITRK)

Definiert in Zeile 130 der Datei lopcodes.h.

#define SET_OPCODE (   i,
  o 
)
Wert:
((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \

Definiert in Zeile 81 der Datei lopcodes.h.

#define SETARG_A (   i,
 
)
Wert:
((i) = (((i)&MASK0(SIZE_A,POS_A)) | \

Definiert in Zeile 85 der Datei lopcodes.h.

#define SETARG_B (   i,
 
)
Wert:
((i) = (((i)&MASK0(SIZE_B,POS_B)) | \

Definiert in Zeile 89 der Datei lopcodes.h.

#define SETARG_Bx (   i,
 
)
Wert:
((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \

Definiert in Zeile 97 der Datei lopcodes.h.

#define SETARG_C (   i,
 
)
Wert:
((i) = (((i)&MASK0(SIZE_C,POS_C)) | \

Definiert in Zeile 93 der Datei lopcodes.h.

#define SETARG_sBx (   i,
 
)    SETARG_Bx((i),cast(unsigned int, (b)+MAXARG_sBx))

Definiert in Zeile 101 der Datei lopcodes.h.

#define SIZE_A   8

Definiert in Zeile 40 der Datei lopcodes.h.

#define SIZE_B   9

Definiert in Zeile 38 der Datei lopcodes.h.

#define SIZE_Bx   (SIZE_C + SIZE_B)

Definiert in Zeile 39 der Datei lopcodes.h.

#define SIZE_C   9

Definiert in Zeile 37 der Datei lopcodes.h.

#define SIZE_OP   6

Definiert in Zeile 42 der Datei lopcodes.h.

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

Definiert in Zeile 257 der Datei lopcodes.h.

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

Definiert in Zeile 258 der Datei lopcodes.h.

Dokumentation der Aufzählungstypen

enum OpArgMask
Aufzählungswerte
OpArgN 
OpArgU 
OpArgR 
OpArgK 

Definiert in Zeile 245 der Datei lopcodes.h.

245  {
246  OpArgN, /* argument is not used */
247  OpArgU, /* argument is used */
248  OpArgR, /* argument is a register or a jump offset */
249  OpArgK /* argument is a constant or register/constant */
250 };
enum OpCode
Aufzählungswerte
OP_MOVE 
OP_LOADK 
OP_LOADBOOL 
OP_LOADNIL 
OP_GETUPVAL 
OP_GETGLOBAL 
OP_GETTABLE 
OP_SETGLOBAL 
OP_SETUPVAL 
OP_SETTABLE 
OP_NEWTABLE 
OP_SELF 
OP_ADD 
OP_SUB 
OP_MUL 
OP_DIV 
OP_MOD 
OP_POW 
OP_UNM 
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_TFORLOOP 
OP_SETLIST 
OP_CLOSE 
OP_CLOSURE 
OP_VARARG 

Definiert in Zeile 150 der Datei lopcodes.h.

150  {
151 /*----------------------------------------------------------------------
152 name args description
153 ------------------------------------------------------------------------*/
154 OP_MOVE,/* A B R(A) := R(B) */
155 OP_LOADK,/* A Bx R(A) := Kst(Bx) */
156 OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */
157 OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */
158 OP_GETUPVAL,/* A B R(A) := UpValue[B] */
159 
160 OP_GETGLOBAL,/* A Bx R(A) := Gbl[Kst(Bx)] */
161 OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */
162 
163 OP_SETGLOBAL,/* A Bx Gbl[Kst(Bx)] := R(A) */
164 OP_SETUPVAL,/* A B UpValue[B] := R(A) */
165 OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */
166 
167 OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */
168 
169 OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */
170 
171 OP_ADD,/* A B C R(A) := RK(B) + RK(C) */
172 OP_SUB,/* A B C R(A) := RK(B) - RK(C) */
173 OP_MUL,/* A B C R(A) := RK(B) * RK(C) */
174 OP_DIV,/* A B C R(A) := RK(B) / RK(C) */
175 OP_MOD,/* A B C R(A) := RK(B) % RK(C) */
176 OP_POW,/* A B C R(A) := RK(B) ^ RK(C) */
177 OP_UNM,/* A B R(A) := -R(B) */
178 OP_NOT,/* A B R(A) := not R(B) */
179 OP_LEN,/* A B R(A) := length of R(B) */
180 
181 OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */
182 
183 OP_JMP,/* sBx pc+=sBx */
184 
185 OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */
186 OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */
187 OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */
188 
189 OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
190 OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
191 
192 OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
193 OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
194 OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
195 
196 OP_FORLOOP,/* A sBx R(A)+=R(A+2);
197  if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
198 OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
199 
200 OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
201  if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
202 OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
203 
204 OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
205 OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */
206 
207 OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
208 } OpCode;
enum OpMode
Aufzählungswerte
iABC 
iABx 
iAsBx 

Definiert in Zeile 31 der Datei lopcodes.h.

31 {iABC, iABx, iAsBx}; /* basic instruction format */

Variablen-Dokumentation

Definiert in Zeile 252 der Datei lopcodes.h.

LUAI_DATA const char* const luaP_opnames[NUM_OPCODES+1]

Definiert in Zeile 261 der Datei lopcodes.h.