aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lopcodes.h b/lopcodes.h
index d6528220..b684dab5 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.90 2002/03/08 19:10:32 roberto Exp roberto $ 2** $Id: lopcodes.h,v 1.91 2002/03/18 14:49:46 roberto Exp roberto $
3** Opcodes for Lua virtual machine 3** Opcodes for Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -77,7 +77,7 @@ enum OpMode {iABC, iABc, iAsBc}; /* basic instruction format */
77*/ 77*/
78 78
79#define GET_OPCODE(i) (cast(OpCode, (i)&MASK1(SIZE_OP,0))) 79#define GET_OPCODE(i) (cast(OpCode, (i)&MASK1(SIZE_OP,0)))
80#define SET_OPCODE(i,o) (((i)&MASK0(SIZE_OP,0)) | cast(Instruction, o)) 80#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,0)) | cast(Instruction, o)))
81 81
82#define GETARG_A(i) (cast(int, (i)>>POS_A)) 82#define GETARG_A(i) (cast(int, (i)>>POS_A))
83#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ 83#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \
@@ -168,6 +168,7 @@ OP_TESTT,/* A B if (R(B)) then R(A) := R(B) else pc++ */
168OP_TESTF,/* A B if not (R(B)) then R(A) := R(B) else pc++ */ 168OP_TESTF,/* A B if not (R(B)) then R(A) := R(B) else pc++ */
169 169
170OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ 170OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
171OP_TAILCALL,/* A B return R(A)(R(A+1), ... ,R(A+B-1)) */
171OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see (3)) */ 172OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see (3)) */
172 173
173OP_FORLOOP,/* A sBc R(A)+=R(A+2); if R(A) <?= R(A+1) then PC+= sBc */ 174OP_FORLOOP,/* A sBc R(A)+=R(A+2); if R(A) <?= R(A+1) then PC+= sBc */