2001-06-28 12:58:57 -07:00
|
|
|
/*
|
2002-12-04 09:38:31 -08:00
|
|
|
** $Id: lopcodes.c,v 1.21 2002/08/20 20:03:05 roberto Exp roberto $
|
2001-06-28 12:58:57 -07:00
|
|
|
** extracted automatically from lopcodes.h by mkprint.lua
|
|
|
|
** DO NOT EDIT
|
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-12-04 09:38:31 -08:00
|
|
|
#define lopcodes_c
|
|
|
|
|
2001-06-28 12:58:57 -07:00
|
|
|
#include "lua.h"
|
|
|
|
|
2001-08-31 12:46:07 -07:00
|
|
|
#include "lobject.h"
|
2001-06-28 12:58:57 -07:00
|
|
|
#include "lopcodes.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LUA_OPNAMES
|
|
|
|
|
2001-11-28 12:13:13 -08:00
|
|
|
const char *const luaP_opnames[] = {
|
|
|
|
"MOVE",
|
|
|
|
"LOADK",
|
2001-12-11 14:48:44 -08:00
|
|
|
"LOADBOOL",
|
2001-11-28 12:13:13 -08:00
|
|
|
"LOADNIL",
|
|
|
|
"GETUPVAL",
|
|
|
|
"GETGLOBAL",
|
|
|
|
"GETTABLE",
|
|
|
|
"SETGLOBAL",
|
|
|
|
"SETUPVAL",
|
|
|
|
"SETTABLE",
|
|
|
|
"NEWTABLE",
|
|
|
|
"SELF",
|
|
|
|
"ADD",
|
|
|
|
"SUB",
|
|
|
|
"MUL",
|
|
|
|
"DIV",
|
|
|
|
"POW",
|
|
|
|
"UNM",
|
|
|
|
"NOT",
|
|
|
|
"CONCAT",
|
|
|
|
"JMP",
|
2002-05-06 08:51:41 -07:00
|
|
|
"EQ",
|
2002-06-12 07:56:22 -07:00
|
|
|
"LT",
|
|
|
|
"LE",
|
2002-05-06 08:51:41 -07:00
|
|
|
"TEST",
|
2001-11-28 12:13:13 -08:00
|
|
|
"CALL",
|
2002-03-21 12:32:22 -08:00
|
|
|
"TAILCALL",
|
2001-11-28 12:13:13 -08:00
|
|
|
"RETURN",
|
|
|
|
"FORLOOP",
|
|
|
|
"TFORLOOP",
|
2002-04-10 11:05:08 -07:00
|
|
|
"TFORPREP",
|
2001-11-28 12:13:13 -08:00
|
|
|
"SETLIST",
|
|
|
|
"SETLISTO",
|
|
|
|
"CLOSE",
|
|
|
|
"CLOSURE"
|
2001-06-28 12:58:57 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-08-20 13:03:05 -07:00
|
|
|
#define opmode(t,b,bk,ck,sa,k,m) (((t)<<OpModeT) | \
|
|
|
|
((b)<<OpModeBreg) | ((bk)<<OpModeBrk) | ((ck)<<OpModeCrk) | \
|
2002-03-25 09:47:14 -08:00
|
|
|
((sa)<<OpModesetA) | ((k)<<OpModeK) | (m))
|
2001-06-28 12:58:57 -07:00
|
|
|
|
2002-03-08 11:10:32 -08:00
|
|
|
|
2001-08-27 08:14:57 -07:00
|
|
|
const lu_byte luaP_opmodes[NUM_OPCODES] = {
|
2002-08-20 13:03:05 -07:00
|
|
|
/* T B Bk Ck sA K mode opcode */
|
|
|
|
opmode(0, 1, 0, 0, 1, 0, iABC) /* OP_MOVE */
|
|
|
|
,opmode(0, 0, 0, 0, 1, 1, iABx) /* OP_LOADK */
|
|
|
|
,opmode(0, 0, 0, 0, 1, 0, iABC) /* OP_LOADBOOL */
|
|
|
|
,opmode(0, 1, 0, 0, 1, 0, iABC) /* OP_LOADNIL */
|
|
|
|
,opmode(0, 0, 0, 0, 1, 0, iABC) /* OP_GETUPVAL */
|
|
|
|
,opmode(0, 0, 0, 0, 1, 1, iABx) /* OP_GETGLOBAL */
|
|
|
|
,opmode(0, 1, 0, 1, 1, 0, iABC) /* OP_GETTABLE */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 1, iABx) /* OP_SETGLOBAL */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABC) /* OP_SETUPVAL */
|
|
|
|
,opmode(0, 0, 1, 1, 0, 0, iABC) /* OP_SETTABLE */
|
|
|
|
,opmode(0, 0, 0, 0, 1, 0, iABC) /* OP_NEWTABLE */
|
|
|
|
,opmode(0, 1, 0, 1, 1, 0, iABC) /* OP_SELF */
|
|
|
|
,opmode(0, 0, 1, 1, 1, 0, iABC) /* OP_ADD */
|
|
|
|
,opmode(0, 0, 1, 1, 1, 0, iABC) /* OP_SUB */
|
|
|
|
,opmode(0, 0, 1, 1, 1, 0, iABC) /* OP_MUL */
|
|
|
|
,opmode(0, 0, 1, 1, 1, 0, iABC) /* OP_DIV */
|
|
|
|
,opmode(0, 0, 1, 1, 1, 0, iABC) /* OP_POW */
|
|
|
|
,opmode(0, 1, 0, 0, 1, 0, iABC) /* OP_UNM */
|
|
|
|
,opmode(0, 1, 0, 0, 1, 0, iABC) /* OP_NOT */
|
|
|
|
,opmode(0, 1, 0, 1, 1, 0, iABC) /* OP_CONCAT */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iAsBx) /* OP_JMP */
|
|
|
|
,opmode(1, 0, 1, 1, 0, 0, iABC) /* OP_EQ */
|
|
|
|
,opmode(1, 0, 1, 1, 0, 0, iABC) /* OP_LT */
|
|
|
|
,opmode(1, 0, 1, 1, 0, 0, iABC) /* OP_LE */
|
|
|
|
,opmode(1, 1, 0, 0, 1, 0, iABC) /* OP_TEST */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABC) /* OP_CALL */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABC) /* OP_TAILCALL */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABC) /* OP_RETURN */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iAsBx) /* OP_FORLOOP */
|
|
|
|
,opmode(1, 0, 0, 0, 0, 0, iABC) /* OP_TFORLOOP */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iAsBx) /* OP_TFORPREP */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABx) /* OP_SETLIST */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABx) /* OP_SETLISTO */
|
|
|
|
,opmode(0, 0, 0, 0, 0, 0, iABC) /* OP_CLOSE */
|
|
|
|
,opmode(0, 0, 0, 0, 1, 0, iABx) /* OP_CLOSURE */
|
2001-06-28 12:58:57 -07:00
|
|
|
};
|
|
|
|
|