annotate lib/lua/lua-5.2.2/lopcodes.c @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents 41cc4dd3c122
children
rev   line source
1866
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
1 /*
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
2 ** $Id: lopcodes.c,v 1.49 2012/05/14 13:34:18 roberto Exp $
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
3 ** Opcodes for Lua virtual machine
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
4 ** See Copyright Notice in lua.h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
5 */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
6
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
7
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
8 #define lopcodes_c
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
9 #define LUA_CORE
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
10
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
11
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
12 #include "lopcodes.h"
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
13
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
14
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
15 /* ORDER OP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
16
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
17 LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = {
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
18 "MOVE",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
19 "LOADK",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
20 "LOADKX",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
21 "LOADBOOL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
22 "LOADNIL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
23 "GETUPVAL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
24 "GETTABUP",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
25 "GETTABLE",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
26 "SETTABUP",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
27 "SETUPVAL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
28 "SETTABLE",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
29 "NEWTABLE",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
30 "SELF",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
31 "ADD",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
32 "SUB",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
33 "MUL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
34 "DIV",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
35 "MOD",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
36 "POW",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
37 "UNM",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
38 "NOT",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
39 "LEN",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
40 "CONCAT",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
41 "JMP",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
42 "EQ",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
43 "LT",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
44 "LE",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
45 "TEST",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
46 "TESTSET",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
47 "CALL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
48 "TAILCALL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
49 "RETURN",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
50 "FORLOOP",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
51 "FORPREP",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
52 "TFORCALL",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
53 "TFORLOOP",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
54 "SETLIST",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
55 "CLOSURE",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
56 "VARARG",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
57 "EXTRAARG",
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
58 NULL
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
59 };
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
60
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
61
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
62 #define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
63
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
64 LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = {
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
65 /* T A B C mode opcode */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
66 opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
67 ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
68 ,opmode(0, 1, OpArgN, OpArgN, iABx) /* OP_LOADKX */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
69 ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
70 ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_LOADNIL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
71 ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
72 ,opmode(0, 1, OpArgU, OpArgK, iABC) /* OP_GETTABUP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
73 ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
74 ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABUP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
75 ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
76 ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
77 ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
78 ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
79 ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
80 ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
81 ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
82 ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
83 ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
84 ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
85 ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
86 ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
87 ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
88 ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
89 ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
90 ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
91 ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
92 ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
93 ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TEST */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
94 ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
95 ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
96 ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
97 ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
98 ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
99 ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
100 ,opmode(0, 0, OpArgN, OpArgU, iABC) /* OP_TFORCALL */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
101 ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_TFORLOOP */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
102 ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
103 ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
104 ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
105 ,opmode(0, 0, OpArgU, OpArgU, iAx) /* OP_EXTRAARG */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
106 };
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
107