OSDN Git Service

wwww
[proj16/16.git] / 16 / v2 / source / ENGINE / VCCODE.H
1 /*\r
2 Copyright (C) 1998 BJ Eirich (aka vecna)\r
3 This program is free software; you can redistribute it and/or\r
4 modify it under the terms of the GNU General Public License\r
5 as published by the Free Software Foundation; either version 2\r
6 of the License, or (at your option) any later version.\r
7 This program is distributed in the hope that it will be useful,\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
10 See the GNU General Public Lic\r
11 See the GNU General Public License for more details.\r
12 You should have received a copy of the GNU General Public License\r
13 along with this program; if not, write to the Free Software\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
15 */\r
16 \r
17 // We never use zero as a tag. This makes it easier to track down misbehaving\r
18 // VC code, since zero is commonly come-by when going off into uncharted\r
19 // depths of memory.\r
20 \r
21 #define ERROR                 0\r
22 \r
23 // Opcode values.\r
24 \r
25 #define opEXEC_STDLIB         1\r
26 #define opEXEC_LOCALFUNC      2\r
27 #define opEXEC_EXTERNFUNC     3\r
28 #define opIF                  4\r
29 #define opELSE                5\r
30 #define opGOTO                6\r
31 #define opSWITCH              7\r
32 #define opCASE                8\r
33 #define opRETURN              9\r
34 #define opASSIGN              10\r
35 #define opSETRETVAL           11\r
36 #define opSETLOCALSTACK       12\r
37 \r
38 // Operand types.\r
39 \r
40 #define op_IMMEDIATE          1\r
41 #define op_HVAR0              2\r
42 #define op_HVAR1              3\r
43 #define op_UVAR               4\r
44 #define op_UVARRAY            5\r
45 #define op_LVAR               6\r
46 #define op_BFUNC              7\r
47 #define op_UFUNC              8\r
48 #define op_GROUP              9\r
49 #define op_STRING             10\r
50 #define op_SARRAY             11\r
51 #define op_SLOCAL             12\r
52 \r
53 // Variable types.\r
54 \r
55 #define v_IMMEDIATE           1  // is this necessary?\r
56 #define v_CHAR                2\r
57 #define v_PTR                 3\r
58 #define v_INT                 4\r
59 \r
60 // IF relational operators.\r
61 \r
62 #define i_ZERO                1\r
63 #define i_NONZERO             2\r
64 #define i_EQUALTO             3\r
65 #define i_NOTEQUAL            4\r
66 #define i_GREATERTHAN         5\r
67 #define i_LESSTHAN            6\r
68 #define i_GREATERTHANOREQUAL  7\r
69 #define i_LESSTHANOREQUAL     8\r
70 #define i_GROUP               9\r
71 #define i_UNGROUP             10\r
72 #define i_AND                 11\r
73 #define i_OR                  12\r
74 \r
75 // Assignment operators.\r
76 \r
77 #define a_SET                 1\r
78 #define a_INC                 2\r
79 #define a_DEC                 3\r
80 #define a_INCSET              4\r
81 #define a_DECSET              5\r
82 #define a_MULTSET             6\r
83 #define a_DIVSET              7\r
84 \r
85 // Operand combination operators.\r
86 \r
87 #define op_ADD                1\r
88 #define op_SUB                2\r
89 #define op_MULT               3\r
90 #define op_DIV                4\r
91 #define op_MOD                5\r
92 #define op_SHL                6\r
93 #define op_SHR                7\r
94 #define op_AND                8\r
95 #define op_OR                 9\r
96 #define op_XOR                10\r
97 #define op_END                11\r
98 \r
99 // String components\r
100 \r
101 #define s_IMMEDIATE           1\r
102 #define s_GLOBAL              2\r
103 #define s_ARRAY               3\r
104 #define s_NUMSTR              4\r
105 #define s_LEFT                5\r
106 #define s_RIGHT               6\r
107 #define s_MID                 7\r
108 #define s_LOCAL               8\r
109 #define s_ADD                 9\r
110 #define s_CHR                 10\r
111 #define s_END                 11\r