Mercurial > vba-linux
diff src/lua/lopcodes.c @ 11:27763b933818
raise lua sources up one level
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 11:07:39 -0600 |
parents | src/lua/src/lopcodes.c@f9f4f1b99eed |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/lua/lopcodes.c Sat Mar 03 11:07:39 2012 -0600 1.3 @@ -0,0 +1,102 @@ 1.4 +/* 1.5 +** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ 1.6 +** See Copyright Notice in lua.h 1.7 +*/ 1.8 + 1.9 + 1.10 +#define lopcodes_c 1.11 +#define LUA_CORE 1.12 + 1.13 + 1.14 +#include "lopcodes.h" 1.15 + 1.16 + 1.17 +/* ORDER OP */ 1.18 + 1.19 +const char *const luaP_opnames[NUM_OPCODES+1] = { 1.20 + "MOVE", 1.21 + "LOADK", 1.22 + "LOADBOOL", 1.23 + "LOADNIL", 1.24 + "GETUPVAL", 1.25 + "GETGLOBAL", 1.26 + "GETTABLE", 1.27 + "SETGLOBAL", 1.28 + "SETUPVAL", 1.29 + "SETTABLE", 1.30 + "NEWTABLE", 1.31 + "SELF", 1.32 + "ADD", 1.33 + "SUB", 1.34 + "MUL", 1.35 + "DIV", 1.36 + "MOD", 1.37 + "POW", 1.38 + "UNM", 1.39 + "NOT", 1.40 + "LEN", 1.41 + "CONCAT", 1.42 + "JMP", 1.43 + "EQ", 1.44 + "LT", 1.45 + "LE", 1.46 + "TEST", 1.47 + "TESTSET", 1.48 + "CALL", 1.49 + "TAILCALL", 1.50 + "RETURN", 1.51 + "FORLOOP", 1.52 + "FORPREP", 1.53 + "TFORLOOP", 1.54 + "SETLIST", 1.55 + "CLOSE", 1.56 + "CLOSURE", 1.57 + "VARARG", 1.58 + NULL 1.59 +}; 1.60 + 1.61 + 1.62 +#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) 1.63 + 1.64 +const lu_byte luaP_opmodes[NUM_OPCODES] = { 1.65 +/* T A B C mode opcode */ 1.66 + opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ 1.67 + ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ 1.68 + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ 1.69 + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ 1.70 + ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ 1.71 + ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */ 1.72 + ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ 1.73 + ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */ 1.74 + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ 1.75 + ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ 1.76 + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ 1.77 + ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ 1.78 + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ 1.79 + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ 1.80 + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ 1.81 + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ 1.82 + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ 1.83 + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ 1.84 + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ 1.85 + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ 1.86 + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ 1.87 + ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ 1.88 + ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ 1.89 + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ 1.90 + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ 1.91 + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ 1.92 + ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */ 1.93 + ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ 1.94 + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ 1.95 + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ 1.96 + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ 1.97 + ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ 1.98 + ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ 1.99 + ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ 1.100 + ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ 1.101 + ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ 1.102 + ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ 1.103 + ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ 1.104 +}; 1.105 +