The Battle for Wesnoth
1.13.4+dev
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
lua
lopcodes.cpp
Go to the documentation of this file.
1
/*
2
** Opcodes for Lua virtual machine
3
** See Copyright Notice in lua.h
4
*/
5
6
7
#define lopcodes_c
8
#define LUA_CORE
9
10
11
#include "
lopcodes.h
"
12
13
14
/* ORDER OP */
15
16
LUAI_DDEF
const
char
*
const
luaP_opnames
[
NUM_OPCODES
+1] = {
17
"MOVE"
,
18
"LOADK"
,
19
"LOADKX"
,
20
"LOADBOOL"
,
21
"LOADNIL"
,
22
"GETUPVAL"
,
23
"GETTABUP"
,
24
"GETTABLE"
,
25
"SETTABUP"
,
26
"SETUPVAL"
,
27
"SETTABLE"
,
28
"NEWTABLE"
,
29
"SELF"
,
30
"ADD"
,
31
"SUB"
,
32
"MUL"
,
33
"DIV"
,
34
"MOD"
,
35
"POW"
,
36
"UNM"
,
37
"NOT"
,
38
"LEN"
,
39
"CONCAT"
,
40
"JMP"
,
41
"EQ"
,
42
"LT"
,
43
"LE"
,
44
"TEST"
,
45
"TESTSET"
,
46
"CALL"
,
47
"TAILCALL"
,
48
"RETURN"
,
49
"FORLOOP"
,
50
"FORPREP"
,
51
"TFORCALL"
,
52
"TFORLOOP"
,
53
"SETLIST"
,
54
"CLOSURE"
,
55
"VARARG"
,
56
"EXTRAARG"
,
57
NULL
58
};
59
60
61
#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m))
62
63
LUAI_DDEF
const
lu_byte
luaP_opmodes
[
NUM_OPCODES
] = {
64
/* T A B C mode opcode */
65
opmode
(0, 1,
OpArgR
,
OpArgN
,
iABC
)
/* OP_MOVE */
66
,
opmode
(0, 1,
OpArgK
,
OpArgN
,
iABx
)
/* OP_LOADK */
67
,
opmode
(0, 1,
OpArgN
,
OpArgN
,
iABx
)
/* OP_LOADKX */
68
,
opmode
(0, 1,
OpArgU
,
OpArgU
,
iABC
)
/* OP_LOADBOOL */
69
,
opmode
(0, 1,
OpArgU
,
OpArgN
,
iABC
)
/* OP_LOADNIL */
70
,
opmode
(0, 1,
OpArgU
,
OpArgN
,
iABC
)
/* OP_GETUPVAL */
71
,
opmode
(0, 1,
OpArgU
,
OpArgK
,
iABC
)
/* OP_GETTABUP */
72
,
opmode
(0, 1,
OpArgR
,
OpArgK
,
iABC
)
/* OP_GETTABLE */
73
,
opmode
(0, 0,
OpArgK
,
OpArgK
,
iABC
)
/* OP_SETTABUP */
74
,
opmode
(0, 0,
OpArgU
,
OpArgN
,
iABC
)
/* OP_SETUPVAL */
75
,
opmode
(0, 0,
OpArgK
,
OpArgK
,
iABC
)
/* OP_SETTABLE */
76
,
opmode
(0, 1,
OpArgU
,
OpArgU
,
iABC
)
/* OP_NEWTABLE */
77
,
opmode
(0, 1,
OpArgR
,
OpArgK
,
iABC
)
/* OP_SELF */
78
,
opmode
(0, 1,
OpArgK
,
OpArgK
,
iABC
)
/* OP_ADD */
79
,
opmode
(0, 1,
OpArgK
,
OpArgK
,
iABC
)
/* OP_SUB */
80
,
opmode
(0, 1,
OpArgK
,
OpArgK
,
iABC
)
/* OP_MUL */
81
,
opmode
(0, 1,
OpArgK
,
OpArgK
,
iABC
)
/* OP_DIV */
82
,
opmode
(0, 1,
OpArgK
,
OpArgK
,
iABC
)
/* OP_MOD */
83
,
opmode
(0, 1,
OpArgK
,
OpArgK
,
iABC
)
/* OP_POW */
84
,
opmode
(0, 1,
OpArgR
,
OpArgN
,
iABC
)
/* OP_UNM */
85
,
opmode
(0, 1,
OpArgR
,
OpArgN
,
iABC
)
/* OP_NOT */
86
,
opmode
(0, 1,
OpArgR
,
OpArgN
,
iABC
)
/* OP_LEN */
87
,
opmode
(0, 1,
OpArgR
,
OpArgR
,
iABC
)
/* OP_CONCAT */
88
,
opmode
(0, 0,
OpArgR
,
OpArgN
,
iAsBx
)
/* OP_JMP */
89
,
opmode
(1, 0,
OpArgK
,
OpArgK
,
iABC
)
/* OP_EQ */
90
,
opmode
(1, 0,
OpArgK
,
OpArgK
,
iABC
)
/* OP_LT */
91
,
opmode
(1, 0,
OpArgK
,
OpArgK
,
iABC
)
/* OP_LE */
92
,
opmode
(1, 0,
OpArgN
,
OpArgU
,
iABC
)
/* OP_TEST */
93
,
opmode
(1, 1,
OpArgR
,
OpArgU
,
iABC
)
/* OP_TESTSET */
94
,
opmode
(0, 1,
OpArgU
,
OpArgU
,
iABC
)
/* OP_CALL */
95
,
opmode
(0, 1,
OpArgU
,
OpArgU
,
iABC
)
/* OP_TAILCALL */
96
,
opmode
(0, 0,
OpArgU
,
OpArgN
,
iABC
)
/* OP_RETURN */
97
,
opmode
(0, 1,
OpArgR
,
OpArgN
,
iAsBx
)
/* OP_FORLOOP */
98
,
opmode
(0, 1,
OpArgR
,
OpArgN
,
iAsBx
)
/* OP_FORPREP */
99
,
opmode
(0, 0,
OpArgN
,
OpArgU
,
iABC
)
/* OP_TFORCALL */
100
,
opmode
(0, 1,
OpArgR
,
OpArgN
,
iAsBx
)
/* OP_TFORLOOP */
101
,
opmode
(0, 0,
OpArgU
,
OpArgU
,
iABC
)
/* OP_SETLIST */
102
,
opmode
(0, 1,
OpArgU
,
OpArgN
,
iABx
)
/* OP_CLOSURE */
103
,
opmode
(0, 1,
OpArgU
,
OpArgN
,
iABC
)
/* OP_VARARG */
104
,
opmode
(0, 0,
OpArgU
,
OpArgU
,
iAx
)
/* OP_EXTRAARG */
105
};
106
OpArgN
Definition:
lopcodes.h:265
NUM_OPCODES
#define NUM_OPCODES
Definition:
lopcodes.h:227
luaP_opmodes
LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES]
Definition:
lopcodes.cpp:63
iAx
Definition:
lopcodes.h:31
iABx
Definition:
lopcodes.h:31
OpArgK
Definition:
lopcodes.h:268
iAsBx
Definition:
lopcodes.h:31
lu_byte
unsigned char lu_byte
Definition:
llimits.h:26
opmode
#define opmode(t, a, b, c, m)
Definition:
lopcodes.cpp:61
LUAI_DDEF
#define LUAI_DDEF
Definition:
luaconf.h:189
luaP_opnames
LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1]
Definition:
lopcodes.cpp:16
lopcodes.h
iABC
Definition:
lopcodes.h:31
OpArgU
Definition:
lopcodes.h:266
OpArgR
Definition:
lopcodes.h:267
Generated by
1.8.8