2001-06-28 23:58:57 +04:00
|
|
|
/*
|
2001-10-25 23:14:14 +04:00
|
|
|
** $Id: lopcodes.c,v 1.5 2001/09/07 17:39:10 roberto Exp $
|
2001-06-28 23:58:57 +04:00
|
|
|
** extracted automatically from lopcodes.h by mkprint.lua
|
|
|
|
** DO NOT EDIT
|
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define LUA_PRIVATE
|
|
|
|
#include "lua.h"
|
|
|
|
|
2001-08-31 23:46:07 +04:00
|
|
|
#include "lobject.h"
|
2001-06-28 23:58:57 +04:00
|
|
|
#include "lopcodes.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LUA_OPNAMES
|
|
|
|
|
|
|
|
const l_char *const luaP_opnames[] = {
|
|
|
|
l_s("MOVE"),
|
|
|
|
l_s("LOADK"),
|
|
|
|
l_s("LOADINT"),
|
|
|
|
l_s("LOADNIL"),
|
2001-09-07 21:39:10 +04:00
|
|
|
l_s("GETUPVAL"),
|
2001-06-28 23:58:57 +04:00
|
|
|
l_s("GETGLOBAL"),
|
|
|
|
l_s("GETTABLE"),
|
|
|
|
l_s("SETGLOBAL"),
|
2001-09-07 21:39:10 +04:00
|
|
|
l_s("SETUPVAL"),
|
2001-06-28 23:58:57 +04:00
|
|
|
l_s("SETTABLE"),
|
|
|
|
l_s("NEWTABLE"),
|
|
|
|
l_s("SELF"),
|
|
|
|
l_s("ADD"),
|
|
|
|
l_s("SUB"),
|
|
|
|
l_s("MUL"),
|
|
|
|
l_s("DIV"),
|
|
|
|
l_s("POW"),
|
|
|
|
l_s("UNM"),
|
|
|
|
l_s("NOT"),
|
|
|
|
l_s("CONCAT"),
|
|
|
|
l_s("JMP"),
|
|
|
|
l_s("CJMP"),
|
|
|
|
l_s("TESTEQ"),
|
|
|
|
l_s("TESTNE"),
|
|
|
|
l_s("TESTLT"),
|
|
|
|
l_s("TESTLE"),
|
|
|
|
l_s("TESTGT"),
|
|
|
|
l_s("TESTGE"),
|
|
|
|
l_s("TESTT"),
|
|
|
|
l_s("TESTF"),
|
|
|
|
l_s("NILJMP"),
|
|
|
|
l_s("CALL"),
|
|
|
|
l_s("RETURN"),
|
|
|
|
l_s("FORPREP"),
|
|
|
|
l_s("FORLOOP"),
|
|
|
|
l_s("TFORPREP"),
|
|
|
|
l_s("TFORLOOP"),
|
|
|
|
l_s("SETLIST"),
|
|
|
|
l_s("SETLISTO"),
|
2001-09-07 21:39:10 +04:00
|
|
|
l_s("CLOSE"),
|
2001-06-28 23:58:57 +04:00
|
|
|
l_s("CLOSURE")
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2001-07-03 21:02:02 +04:00
|
|
|
#define opmode(t,x,b,c,sa,k,m) (((t)<<OpModeT) | \
|
2001-06-28 23:58:57 +04:00
|
|
|
((b)<<OpModeBreg) | ((c)<<OpModeCreg) | \
|
|
|
|
((sa)<<OpModesetA) | ((k)<<OpModeK) | (m))
|
|
|
|
|
2001-08-27 19:14:57 +04:00
|
|
|
const lu_byte luaP_opmodes[NUM_OPCODES] = {
|
2001-07-03 21:02:02 +04:00
|
|
|
/* T _ B C sA K mode opcode */
|
|
|
|
opmode(0,0,1,0, 1,0,iABC) /* OP_MOVE */
|
|
|
|
,opmode(0,0,0,0, 1,1,iABc) /* OP_LOADK */
|
|
|
|
,opmode(0,0,0,0, 1,0,iAsBc) /* OP_LOADINT */
|
|
|
|
,opmode(0,0,1,0, 1,0,iABC) /* OP_LOADNIL */
|
2001-09-07 21:39:10 +04:00
|
|
|
,opmode(0,0,0,0, 1,0,iABC) /* OP_GETUPVAL */
|
2001-07-03 21:02:02 +04:00
|
|
|
,opmode(0,0,0,0, 1,1,iABc) /* OP_GETGLOBAL */
|
|
|
|
,opmode(0,0,1,1, 1,0,iABC) /* OP_GETTABLE */
|
|
|
|
,opmode(0,0,0,0, 0,1,iABc) /* OP_SETGLOBAL */
|
2001-09-07 21:39:10 +04:00
|
|
|
,opmode(0,0,0,0, 0,0,iABC) /* OP_SETUPVAL */
|
2001-07-03 21:02:02 +04:00
|
|
|
,opmode(0,0,1,1, 0,0,iABC) /* OP_SETTABLE */
|
2001-10-25 23:14:14 +04:00
|
|
|
,opmode(0,0,0,0, 1,0,iABC) /* OP_NEWTABLE */
|
2001-07-03 21:02:02 +04:00
|
|
|
,opmode(0,0,1,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,0,1,0, 1,0,iABC) /* OP_UNM */
|
|
|
|
,opmode(0,0,1,0, 1,0,iABC) /* OP_NOT */
|
|
|
|
,opmode(0,0,1,1, 1,0,iABC) /* OP_CONCAT */
|
|
|
|
,opmode(0,0,0,0, 0,0,iAsBc) /* OP_JMP */
|
|
|
|
,opmode(0,0,0,0, 0,0,iAsBc) /* OP_CJMP */
|
|
|
|
,opmode(1,0,0,1, 0,0,iABC) /* OP_TESTEQ */
|
|
|
|
,opmode(1,0,0,1, 0,0,iABC) /* OP_TESTNE */
|
|
|
|
,opmode(1,0,0,1, 0,0,iABC) /* OP_TESTLT */
|
|
|
|
,opmode(1,0,0,1, 0,0,iABC) /* OP_TESTLE */
|
|
|
|
,opmode(1,0,0,1, 0,0,iABC) /* OP_TESTGT */
|
|
|
|
,opmode(1,0,0,1, 0,0,iABC) /* OP_TESTGE */
|
|
|
|
,opmode(1,0,1,0, 1,0,iABC) /* OP_TESTT */
|
|
|
|
,opmode(1,0,1,0, 1,0,iABC) /* OP_TESTF */
|
|
|
|
,opmode(0,0,0,0, 1,0,iABc) /* OP_NILJMP */
|
|
|
|
,opmode(0,0,0,0, 0,0,iABC) /* OP_CALL */
|
|
|
|
,opmode(0,0,0,0, 0,0,iABC) /* OP_RETURN */
|
|
|
|
,opmode(0,0,0,0, 0,0,iAsBc) /* OP_FORPREP */
|
|
|
|
,opmode(0,0,0,0, 0,0,iAsBc) /* OP_FORLOOP */
|
|
|
|
,opmode(0,0,0,0, 0,0,iAsBc) /* OP_TFORPREP */
|
|
|
|
,opmode(0,0,0,0, 0,0,iAsBc) /* OP_TFORLOOP */
|
|
|
|
,opmode(0,0,0,0, 0,0,iABc) /* OP_SETLIST */
|
|
|
|
,opmode(0,0,0,0, 0,0,iABc) /* OP_SETLISTO */
|
2001-09-07 21:39:10 +04:00
|
|
|
,opmode(0,0,0,0, 0,0,iABC) /* OP_CLOSE */
|
2001-07-03 21:02:02 +04:00
|
|
|
,opmode(0,0,0,0, 1,0,iABc) /* OP_CLOSURE */
|
2001-06-28 23:58:57 +04:00
|
|
|
};
|
|
|
|
|