From c61bb89dbac0913cc28c775a58238403be75026f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 17 May 2004 09:34:00 -0300 Subject: details --- lopcodes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lopcodes.h b/lopcodes.h index ca848835..be5bde30 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.106 2003/05/15 19:46:03 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.107 2004/04/30 20:13:38 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -41,10 +41,10 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ #define SIZE_OP 6 -#define POS_C SIZE_OP +#define POS_C (POS_A + SIZE_A) #define POS_B (POS_C + SIZE_C) #define POS_Bx POS_C -#define POS_A (POS_B + SIZE_B) +#define POS_A SIZE_OP /* @@ -79,7 +79,7 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ #define GET_OPCODE(i) (cast(OpCode, (i)&MASK1(SIZE_OP,0))) #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,0)) | cast(Instruction, o))) -#define GETARG_A(i) (cast(int, (i)>>POS_A)) +#define GETARG_A(i) (cast(int, (i)>>POS_A) & MASK1(SIZE_A,0)) #define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ ((cast(Instruction, u)<