diff options
| -rw-r--r-- | lopcodes.h | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lopcodes.h,v 1.106 2003/05/15 19:46:03 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.107 2004/04/30 20:13:38 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 | */ |
| @@ -41,10 +41,10 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ | |||
| 41 | 41 | ||
| 42 | #define SIZE_OP 6 | 42 | #define SIZE_OP 6 |
| 43 | 43 | ||
| 44 | #define POS_C SIZE_OP | 44 | #define POS_C (POS_A + SIZE_A) |
| 45 | #define POS_B (POS_C + SIZE_C) | 45 | #define POS_B (POS_C + SIZE_C) |
| 46 | #define POS_Bx POS_C | 46 | #define POS_Bx POS_C |
| 47 | #define POS_A (POS_B + SIZE_B) | 47 | #define POS_A SIZE_OP |
| 48 | 48 | ||
| 49 | 49 | ||
| 50 | /* | 50 | /* |
| @@ -79,7 +79,7 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ | |||
| 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) = (((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) & MASK1(SIZE_A,0)) |
| 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)) | \ |
| 84 | ((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A)))) | 84 | ((cast(Instruction, u)<<POS_A)&MASK1(SIZE_A,POS_A)))) |
| 85 | 85 | ||
