LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bytecodes.c
Go to the documentation of this file.
1 /*
2  * LEGO® MINDSTORMS EV3
3  *
4  * Copyright (C) 2010-2013 The LEGO Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #define MAX_SUBCODES 33
23 #define OPCODE_NAMESIZE 20
24 #define MAX_LABELS 32
25 
26 
27 typedef struct
28 {
29  const ULONG Pars;
30  const char *Name;
31 }
32 OPCODE;
33 
34 typedef struct
35 {
36  const ULONG Pars;
37  const char *Name;
38 }
39 SUBCODE;
40 
41 #define OC(OpCode,Par1,Par2,Par3,Par4,Par5,Par6,Par7,Par8) \
42  \
43  [OpCode] = { \
44  .Pars = ((ULONG)Par1) + \
45  ((ULONG)Par2 << 4) + \
46  ((ULONG)Par3 << 8) + \
47  ((ULONG)Par4 << 12) + \
48  ((ULONG)Par5 << 16) + \
49  ((ULONG)Par6 << 20) + \
50  ((ULONG)Par7 << 24) + \
51  ((ULONG)Par8 << 28), \
52  .Name = #OpCode, \
53  }
54 
55 
56 #define SC(ParameterFormat,SubCode,Par1,Par2,Par3,Par4,Par5,Par6,Par7,Par8) \
57  \
58  [ParameterFormat][SubCode] = { \
59  .Pars = ((ULONG)Par1) + \
60  ((ULONG)Par2 << 4) + \
61  ((ULONG)Par3 << 8) + \
62  ((ULONG)Par4 << 12) + \
63  ((ULONG)Par5 << 16) + \
64  ((ULONG)Par6 << 20) + \
65  ((ULONG)Par7 << 24) + \
66  ((ULONG)Par8 << 28), \
67  .Name = #SubCode, \
68  }
69 
70 
71 #define SUBP 0x01
72 #define PARNO 0x02
73 #define PARLAB 0x03
74 #define PARVALUES 0x04
75 
76 #define PAR 0x08
77 #define PAR8 (PAR + DATA_8)
78 #define PAR16 (PAR + DATA_16)
79 #define PAR32 (PAR + DATA_32)
80 #define PARF (PAR + DATA_F)
81 #define PARS (PAR + DATA_S)
82 #define PARV (PAR + DATA_V)
83 
84 static const char *ParTypeNames[] =
85 {
86  [DATA_8] = "DATA8",
87  [DATA_16] = "DATA16",
88  [DATA_32] = "DATA32",
89  [DATA_F] = "DATAF",
90  [DATA_S] = "STRING",
91  [DATA_V] = "UNKNOWN",
92 };
93 
94 
95 static const DATA32 ParMin[] =
96 {
97  [DATA_8] = DATA8_MIN,
98  [DATA_16] = DATA16_MIN,
99  [DATA_32] = DATA32_MIN,
100 };
101 
102 
103 static const DATA32 ParMax[] =
104 {
105  [DATA_8] = DATA8_MAX,
106  [DATA_16] = DATA16_MAX,
107  [DATA_32] = DATA32_MAX,
108 };
109 
110 
111 enum
112 {
119  VM_SUBP = 6,
126  MATH_SUBP = 13,
130 
132 };
133 
134 
135 #define FILENAME_SUBP ARRAY_SUBP
136 #define TST_SUBP VM_SUBP
137 
138 
139 static OPCODE OpCodes[256] =
140 {
141  // OpCode Parameters Unused
142  // VM
143  OC( opERROR, 0, 0,0,0,0,0,0,0 ),
144  OC( opNOP, 0, 0,0,0,0,0,0,0 ),
145  OC( opPROGRAM_STOP, PAR16, 0,0,0,0,0,0,0 ),
146  OC( opPROGRAM_START, PAR16,PAR32,PAR32,PAR8, 0,0,0,0 ),
147  OC( opOBJECT_STOP, PAR16, 0,0,0,0,0,0,0 ),
148  OC( opOBJECT_START, PAR16, 0,0,0,0,0,0,0 ),
149  OC( opOBJECT_TRIG, PAR16, 0,0,0,0,0,0,0 ),
150  OC( opOBJECT_WAIT, PAR16, 0,0,0,0,0,0,0 ),
151  OC( opRETURN, 0, 0,0,0,0,0,0,0 ),
152  OC( opCALL, PAR16,PARNO, 0,0,0,0,0,0 ),
153  OC( opOBJECT_END, 0, 0,0,0,0,0,0,0 ),
154  OC( opSLEEP, 0, 0,0,0,0,0,0,0 ),
155  OC( opPROGRAM_INFO, PAR8, SUBP, PROGRAM_SUBP, 0,0,0,0,0 ),
156  OC( opLABEL, PARLAB, 0,0,0,0,0,0,0 ),
157  OC( opPROBE, PAR16,PAR16,PAR32,PAR32, 0,0,0,0 ),
158  OC( opDO, PAR16,PAR32,PAR32, 0,0,0,0,0 ),
159  // Math
160  OC( opADD8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
161  OC( opADD16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
162  OC( opADD32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
163  OC( opADDF, PARF,PARF,PARF, 0,0,0,0,0 ),
164  OC( opSUB8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
165  OC( opSUB16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
166  OC( opSUB32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
167  OC( opSUBF, PARF,PARF,PARF, 0,0,0,0,0 ),
168  OC( opMUL8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
169  OC( opMUL16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
170  OC( opMUL32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
171  OC( opMULF, PARF,PARF,PARF, 0,0,0,0,0 ),
172  OC( opDIV8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
173  OC( opDIV16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
174  OC( opDIV32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
175  OC( opDIVF, PARF,PARF,PARF, 0,0,0,0,0 ),
176  // Logic
177  OC( opOR8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
178  OC( opOR16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
179  OC( opOR32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
180  OC( opAND8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
181  OC( opAND16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
182  OC( opAND32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
183  OC( opXOR8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
184  OC( opXOR16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
185  OC( opXOR32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
186  OC( opRL8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
187  OC( opRL16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
188  OC( opRL32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
189  // Move
190  OC( opINIT_BYTES, PAR8,PAR32,PARVALUES,PAR8, 0,0,0,0 ),
191  OC( opMOVE8_8, PAR8,PAR8, 0,0,0,0,0,0 ),
192  OC( opMOVE8_16, PAR8,PAR16, 0,0,0,0,0,0 ),
193  OC( opMOVE8_32, PAR8,PAR32, 0,0,0,0,0,0 ),
194  OC( opMOVE8_F, PAR8,PARF, 0,0,0,0,0,0 ),
195  OC( opMOVE16_8, PAR16,PAR8, 0,0,0,0,0,0 ),
196  OC( opMOVE16_16, PAR16,PAR16, 0,0,0,0,0,0 ),
197  OC( opMOVE16_32, PAR16,PAR32, 0,0,0,0,0,0 ),
198  OC( opMOVE16_F, PAR16,PARF, 0,0,0,0,0,0 ),
199  OC( opMOVE32_8, PAR32,PAR8, 0,0,0,0,0,0 ),
200  OC( opMOVE32_16, PAR32,PAR16, 0,0,0,0,0,0 ),
201  OC( opMOVE32_32, PAR32,PAR32, 0,0,0,0,0,0 ),
202  OC( opMOVE32_F, PAR32,PARF, 0,0,0,0,0,0 ),
203  OC( opMOVEF_8, PARF,PAR8, 0,0,0,0,0,0 ),
204  OC( opMOVEF_16, PARF,PAR16, 0,0,0,0,0,0 ),
205  OC( opMOVEF_32, PARF,PAR32, 0,0,0,0,0,0 ),
206  OC( opMOVEF_F, PARF,PARF, 0,0,0,0,0,0 ),
207  // Branch
208  OC( opJR, PAR32, 0,0,0,0,0,0,0 ),
209  OC( opJR_FALSE, PAR8,PAR32, 0,0,0,0,0,0 ),
210  OC( opJR_TRUE, PAR8,PAR32, 0,0,0,0,0,0 ),
211  OC( opJR_NAN, PARF,PAR32, 0,0,0,0,0,0 ),
212  // Compare
213  OC( opCP_LT8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
214  OC( opCP_LT16, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
215  OC( opCP_LT32, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
216  OC( opCP_LTF, PARF,PARF,PAR8, 0,0,0,0,0 ),
217  OC( opCP_GT8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
218  OC( opCP_GT16, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
219  OC( opCP_GT32, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
220  OC( opCP_GTF, PARF,PARF,PAR8, 0,0,0,0,0 ),
221  OC( opCP_EQ8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
222  OC( opCP_EQ16, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
223  OC( opCP_EQ32, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
224  OC( opCP_EQF, PARF,PARF,PAR8, 0,0,0,0,0 ),
225  OC( opCP_NEQ8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
226  OC( opCP_NEQ16, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
227  OC( opCP_NEQ32, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
228  OC( opCP_NEQF, PARF,PARF,PAR8, 0,0,0,0,0 ),
229  OC( opCP_LTEQ8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
230  OC( opCP_LTEQ16, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
231  OC( opCP_LTEQ32, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
232  OC( opCP_LTEQF, PARF,PARF,PAR8, 0,0,0,0,0 ),
233  OC( opCP_GTEQ8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
234  OC( opCP_GTEQ16, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
235  OC( opCP_GTEQ32, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
236  OC( opCP_GTEQF, PARF,PARF,PAR8, 0,0,0,0,0 ),
237  // Select
238  OC( opSELECT8, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
239  OC( opSELECT16, PAR8,PAR16,PAR16,PAR16, 0,0,0,0 ),
240  OC( opSELECT32, PAR8,PAR32,PAR32,PAR32, 0,0,0,0 ),
241  OC( opSELECTF, PAR8,PARF,PARF,PARF, 0,0,0,0 ),
242 
243  OC( opSYSTEM, PAR8,PAR32, 0,0,0,0,0,0 ),
244  OC( opPORT_CNV_OUTPUT, PAR32,PAR8,PAR8,PAR8, 0,0,0,0 ),
245  OC( opPORT_CNV_INPUT, PAR32,PAR8,PAR8, 0,0,0,0,0 ),
246  OC( opNOTE_TO_FREQ, PAR8,PAR16, 0,0,0,0,0,0 ),
247 
248  // Branch
249  OC( opJR_LT8, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
250  OC( opJR_LT16, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
251  OC( opJR_LT32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
252  OC( opJR_LTF, PARF,PARF,PAR32, 0,0,0,0,0 ),
253  OC( opJR_GT8, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
254  OC( opJR_GT16, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
255  OC( opJR_GT32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
256  OC( opJR_GTF, PARF,PARF,PAR32, 0,0,0,0,0 ),
257  OC( opJR_EQ8, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
258  OC( opJR_EQ16, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
259  OC( opJR_EQ32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
260  OC( opJR_EQF, PARF,PARF,PAR32, 0,0,0,0,0 ),
261  OC( opJR_NEQ8, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
262  OC( opJR_NEQ16, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
263  OC( opJR_NEQ32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
264  OC( opJR_NEQF, PARF,PARF,PAR32, 0,0,0,0,0 ),
265  OC( opJR_LTEQ8, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
266  OC( opJR_LTEQ16, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
267  OC( opJR_LTEQ32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
268  OC( opJR_LTEQF, PARF,PARF,PAR32, 0,0,0,0,0 ),
269  OC( opJR_GTEQ8, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
270  OC( opJR_GTEQ16, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
271  OC( opJR_GTEQ32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
272  OC( opJR_GTEQF, PARF,PARF,PAR32, 0,0,0,0,0 ),
273  // VM
274  OC( opINFO, PAR8,SUBP,VM_SUBP, 0,0,0,0,0 ),
275  OC( opSTRINGS, PAR8,SUBP,STRING_SUBP, 0,0,0,0,0 ),
276  OC( opMEMORY_WRITE, PAR16,PAR16,PAR32,PAR32,PAR8, 0,0,0 ),
277  OC( opMEMORY_READ, PAR16,PAR16,PAR32,PAR32,PAR8, 0,0,0 ),
278  // UI
279  OC( opUI_FLUSH, 0, 0,0,0,0,0,0,0 ),
280  OC( opUI_READ, PAR8,SUBP,UI_READ_SUBP, 0,0,0,0,0 ),
281  OC( opUI_WRITE, PAR8,SUBP,UI_WRITE_SUBP, 0,0,0,0,0 ),
282  OC( opUI_BUTTON, PAR8,SUBP,UI_BUTTON_SUBP, 0,0,0,0,0 ),
283  OC( opUI_DRAW, PAR8,SUBP,UI_DRAW_SUBP, 0,0,0,0,0 ),
284  // Timer
285  OC( opTIMER_WAIT, PAR32,PAR32, 0,0,0,0,0,0 ),
286  OC( opTIMER_READY, PAR32, 0,0,0,0,0,0,0 ),
287  OC( opTIMER_READ, PAR32, 0,0,0,0,0,0,0 ),
288  // VM
289  OC( opBP0, 0, 0,0,0,0,0,0,0 ),
290  OC( opBP1, 0, 0,0,0,0,0,0,0 ),
291  OC( opBP2, 0, 0,0,0,0,0,0,0 ),
292  OC( opBP3, 0, 0,0,0,0,0,0,0 ),
293  OC( opBP_SET, PAR16,PAR8,PAR32, 0,0,0,0,0 ),
294  OC( opMATH, PAR8,SUBP,MATH_SUBP, 0,0,0,0,0 ),
295  OC( opRANDOM, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
296  OC( opTIMER_READ_US, PAR32, 0,0,0,0,0,0,0 ),
297  OC( opKEEP_ALIVE, PAR8, 0,0,0,0,0,0,0 ),
298  // Com
299  OC( opCOM_READ, PAR8,SUBP,COM_READ_SUBP, 0,0,0,0,0 ),
300  OC( opCOM_WRITE, PAR8,SUBP,COM_WRITE_SUBP, 0,0,0,0,0 ),
301  // Sound
302  OC( opSOUND, PAR8,SUBP,SOUND_SUBP, 0,0,0,0,0 ),
303  OC( opSOUND_TEST, PAR8, 0,0,0,0,0,0,0 ),
304  OC( opSOUND_READY, 0, 0,0,0,0,0,0,0 ),
305  // Input
306  OC( opINPUT_SAMPLE, PAR32,PAR16,PAR16,PAR8,PAR8,PAR8,PAR8,PARF ),
307  OC( opINPUT_DEVICE_LIST, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
308  OC( opINPUT_DEVICE, PAR8,SUBP,INPUT_SUBP, 0,0,0,0,0 ),
309  OC( opINPUT_READ, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
310  OC( opINPUT_READSI, PAR8,PAR8,PAR8,PAR8,PARF, 0,0,0 ),
311  OC( opINPUT_TEST, PAR8, 0,0,0,0,0,0,0 ),
312  OC( opINPUT_TEST, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
313  OC( opINPUT_READY, PAR8,PAR8, 0,0,0,0,0,0 ),
314  OC( opINPUT_READEXT, PAR8,PAR8,PAR8,PAR8,PAR8,PARNO, 0,0 ),
315  OC( opINPUT_WRITE, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
316  // Output
317  OC( opOUTPUT_SET_TYPE, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
318  OC( opOUTPUT_RESET, PAR8,PAR8, 0,0,0,0,0,0 ),
319  OC( opOUTPUT_STOP, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
320  OC( opOUTPUT_SPEED, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
321  OC( opOUTPUT_POWER, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
322  OC( opOUTPUT_START, PAR8,PAR8, 0,0,0,0,0,0 ),
323  OC( opOUTPUT_POLARITY, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
324  OC( opOUTPUT_READ, PAR8,PAR8,PAR8,PAR32, 0,0,0,0 ),
325  OC( opOUTPUT_READY, PAR8,PAR8, 0,0,0,0,0,0 ),
326  OC( opOUTPUT_TEST, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
327  OC( opOUTPUT_STEP_POWER, PAR8,PAR8,PAR8,PAR32,PAR32,PAR32,PAR8, 0 ),
328  OC( opOUTPUT_TIME_POWER, PAR8,PAR8,PAR8,PAR32,PAR32,PAR32,PAR8, 0 ),
329  OC( opOUTPUT_STEP_SPEED, PAR8,PAR8,PAR8,PAR32,PAR32,PAR32,PAR8, 0 ),
330  OC( opOUTPUT_TIME_SPEED, PAR8,PAR8,PAR8,PAR32,PAR32,PAR32,PAR8, 0 ),
331  OC( opOUTPUT_STEP_SYNC, PAR8,PAR8,PAR8,PAR16,PAR32,PAR8, 0,0 ),
332  OC( opOUTPUT_TIME_SYNC, PAR8,PAR8,PAR8,PAR16,PAR32,PAR8, 0,0 ),
333  OC( opOUTPUT_CLR_COUNT, PAR8,PAR8, 0,0,0,0,0,0 ),
334  OC( opOUTPUT_GET_COUNT, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
335  OC( opOUTPUT_PRG_STOP, 0, 0,0,0,0,0,0,0 ),
336  // Memory
337  OC( opFILE, PAR8,SUBP,FILE_SUBP, 0,0,0,0,0 ),
338  OC( opARRAY, PAR8,SUBP,ARRAY_SUBP, 0,0,0,0,0 ),
339  OC( opARRAY_WRITE, PAR16,PAR32,PARV, 0,0,0,0,0 ),
340  OC( opARRAY_READ, PAR16,PAR32,PARV, 0,0,0,0,0 ),
341  OC( opARRAY_APPEND, PAR16,PARV, 0,0,0,0,0,0 ),
342  OC( opMEMORY_USAGE, PAR32,PAR32, 0,0,0,0,0,0 ),
343  OC( opFILENAME, PAR8,SUBP,FILENAME_SUBP, 0,0,0,0,0 ),
344  // Move
345  OC( opREAD8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
346  OC( opREAD16, PAR16,PAR8,PAR16, 0,0,0,0,0 ),
347  OC( opREAD32, PAR32,PAR8,PAR32, 0,0,0,0,0 ),
348  OC( opREADF, PARF,PAR8,PARF, 0,0,0,0,0 ),
349  OC( opWRITE8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
350  OC( opWRITE16, PAR16,PAR8,PAR16, 0,0,0,0,0 ),
351  OC( opWRITE32, PAR32,PAR8,PAR32, 0,0,0,0,0 ),
352  OC( opWRITEF, PARF,PAR8,PARF, 0,0,0,0,0 ),
353  // Com
354  OC( opCOM_READY, PAR8,PAR8, 0,0,0,0,0,0 ),
355  OC( opCOM_READDATA, PAR8,PAR8,PAR16,PAR8, 0,0,0,0 ),
356  OC( opCOM_WRITEDATA, PAR8,PAR8,PAR16,PAR8, 0,0,0,0 ),
357  OC( opCOM_GET, PAR8,SUBP,COM_GET_SUBP, 0,0,0,0,0 ),
358  OC( opCOM_SET, PAR8,SUBP,COM_SET_SUBP, 0,0,0,0,0 ),
359  OC( opCOM_TEST, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
360  OC( opCOM_REMOVE, PAR8,PAR8, 0,0,0,0,0,0 ),
361  OC( opCOM_WRITEFILE, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
362 
363  OC( opMAILBOX_OPEN, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
364  OC( opMAILBOX_WRITE, PAR8,PAR8,PAR8,PAR8,PARNO, 0,0,0 ),
365  OC( opMAILBOX_READ, PAR8,PAR8,PARNO, 0,0,0,0,0 ),
366  OC( opMAILBOX_TEST, PAR8,PAR8, 0,0,0,0,0,0 ),
367  OC( opMAILBOX_READY, PAR8, 0,0,0,0,0,0,0 ),
368  OC( opMAILBOX_CLOSE, PAR8, 0,0,0,0,0,0,0 ),
369  // Test
370  OC( opTST, PAR8,SUBP,TST_SUBP, 0,0,0,0,0 ),
371 
372 
373 };
374 
375 
376 static SUBCODE SubCodes[SUBPS][MAX_SUBCODES] =
377 {
378  // ParameterFormat SubCode Parameters Unused
379 
380  // VM
381  SC( PROGRAM_SUBP, OBJ_STOP, PAR16,PAR16, 0,0,0,0,0,0 ),
382  SC( PROGRAM_SUBP, OBJ_START, PAR16,PAR16, 0,0,0,0,0,0 ),
383  SC( PROGRAM_SUBP, GET_STATUS, PAR16,PAR8, 0,0,0,0,0,0 ),
384  SC( PROGRAM_SUBP, GET_SPEED, PAR16,PAR32, 0,0,0,0,0,0 ),
385  SC( PROGRAM_SUBP, GET_PRGRESULT, PAR16,PAR8, 0,0,0,0,0,0 ),
386  SC( PROGRAM_SUBP, SET_INSTR, PAR16, 0,0,0,0,0,0,0 ),
387  // Memory
388  SC( FILE_SUBP, OPEN_APPEND, PAR8,PAR16, 0,0,0,0,0,0 ),
389  SC( FILE_SUBP, OPEN_READ, PAR8,PAR16,PAR32, 0,0,0,0,0 ),
390  SC( FILE_SUBP, OPEN_WRITE, PAR8,PAR16, 0,0,0,0,0,0 ),
391  SC( FILE_SUBP, READ_VALUE, PAR16,PAR8,PARF, 0,0,0,0,0 ),
392  SC( FILE_SUBP, WRITE_VALUE, PAR16,PAR8,PARF,PAR8,PAR8, 0,0,0 ),
393  SC( FILE_SUBP, READ_TEXT, PAR16,PAR8,PAR16,PAR8, 0,0,0,0 ),
394  SC( FILE_SUBP, WRITE_TEXT, PAR16,PAR8,PAR8, 0,0,0,0,0 ),
395  SC( FILE_SUBP, CLOSE, PAR16, 0,0,0,0,0,0,0 ),
396  SC( FILE_SUBP, LOAD_IMAGE, PAR16,PAR8,PAR32,PAR32, 0,0,0,0 ),
397  SC( FILE_SUBP, GET_HANDLE, PAR8,PAR16,PAR8, 0,0,0,0,0 ),
398  SC( FILE_SUBP, MAKE_FOLDER, PAR8,PAR8, 0,0,0,0,0,0 ),
399  SC( FILE_SUBP, GET_LOG_NAME, PAR8,PAR8, 0,0,0,0,0,0 ),
400  SC( FILE_SUBP, GET_POOL, PAR32,PAR16,PAR32, 0,0,0,0,0 ),
401  SC( FILE_SUBP, GET_FOLDERS, PAR8,PAR8, 0,0,0,0,0,0 ),
402  SC( FILE_SUBP, GET_SUBFOLDER_NAME, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
403  SC( FILE_SUBP, WRITE_LOG, PAR16,PAR32,PAR8,PARF, 0,0,0,0 ),
404  SC( FILE_SUBP, CLOSE_LOG, PAR16,PAR8, 0,0,0,0,0,0 ),
405  SC( FILE_SUBP, SET_LOG_SYNC_TIME, PAR32,PAR32, 0,0,0,0,0,0 ),
406  SC( FILE_SUBP, DEL_SUBFOLDER, PAR8,PAR8, 0,0,0,0,0,0 ),
407  SC( FILE_SUBP, GET_LOG_SYNC_TIME, PAR32,PAR32, 0,0,0,0,0,0 ),
408  SC( FILE_SUBP, GET_IMAGE, PAR8,PAR16,PAR8,PAR32, 0,0,0,0 ),
409  SC( FILE_SUBP, GET_ITEM, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
410  SC( FILE_SUBP, GET_CACHE_FILES, PAR8, 0,0,0,0,0,0,0 ),
411  SC( FILE_SUBP, GET_CACHE_FILE, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
412  SC( FILE_SUBP, PUT_CACHE_FILE, PAR8, 0,0,0,0,0,0,0 ),
413  SC( FILE_SUBP, DEL_CACHE_FILE, PAR8, 0,0,0,0,0,0,0 ),
415  SC( FILE_SUBP, READ_BYTES, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
416  SC( FILE_SUBP, WRITE_BYTES, PAR16,PAR16,PAR8, 0,0,0,0,0 ),
417  SC( FILE_SUBP, REMOVE, PAR8, 0,0,0,0,0,0,0 ),
418  SC( FILE_SUBP, MOVE, PAR8,PAR8, 0,0,0,0,0,0 ),
419 
420  SC( ARRAY_SUBP, CREATE8, PAR32,PAR16, 0,0,0,0,0,0 ),
421  SC( ARRAY_SUBP, CREATE16, PAR32,PAR16, 0,0,0,0,0,0 ),
422  SC( ARRAY_SUBP, CREATE32, PAR32,PAR16, 0,0,0,0,0,0 ),
423  SC( ARRAY_SUBP, CREATEF, PAR32,PAR16, 0,0,0,0,0,0 ),
424  SC( ARRAY_SUBP, RESIZE, PAR16,PAR32, 0,0,0,0,0,0 ),
425  SC( ARRAY_SUBP, DELETE, PAR16, 0,0,0,0,0,0,0 ),
426  SC( ARRAY_SUBP, FILL, PAR16,PARV, 0,0,0,0,0,0 ),
427  SC( ARRAY_SUBP, COPY, PAR16,PAR16, 0,0,0,0,0,0 ),
428  SC( ARRAY_SUBP, INIT8, PAR16,PAR32,PAR32,PARVALUES,PAR8, 0,0,0 ),
429  SC( ARRAY_SUBP, INIT16, PAR16,PAR32,PAR32,PARVALUES,PAR16, 0,0,0 ),
430  SC( ARRAY_SUBP, INIT32, PAR16,PAR32,PAR32,PARVALUES,PAR32, 0,0,0 ),
431  SC( ARRAY_SUBP, INITF, PAR16,PAR32,PAR32,PARVALUES,PARF, 0,0,0 ),
432  SC( ARRAY_SUBP, SIZE, PAR16,PAR32, 0,0,0,0,0,0 ),
433  SC( ARRAY_SUBP, READ_CONTENT, PAR16,PAR16,PAR32,PAR32,PAR8, 0,0,0 ),
434  SC( ARRAY_SUBP, WRITE_CONTENT, PAR16,PAR16,PAR32,PAR32,PAR8, 0,0,0 ),
435  SC( ARRAY_SUBP, READ_SIZE, PAR16,PAR16,PAR32, 0,0,0,0,0 ),
436 
437  SC( FILENAME_SUBP, EXIST, PAR8,PAR8, 0,0,0,0,0,0 ),
438  SC( FILENAME_SUBP, TOTALSIZE, PAR8,PAR32,PAR32, 0,0,0,0,0 ),
439  SC( FILENAME_SUBP, SPLIT, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
440  SC( FILENAME_SUBP, MERGE, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
441  SC( FILENAME_SUBP, CHECK, PAR8,PAR8, 0,0,0,0,0,0 ),
442  SC( FILENAME_SUBP, PACK, PAR8, 0,0,0,0,0,0,0 ),
443  SC( FILENAME_SUBP, UNPACK, PAR8, 0,0,0,0,0,0,0 ),
444  SC( FILENAME_SUBP, GET_FOLDERNAME, PAR8,PAR8, 0,0,0,0,0,0 ),
445 
446  // VM
447  SC( VM_SUBP, SET_ERROR, PAR8, 0,0,0,0,0,0,0 ),
448  SC( VM_SUBP, GET_ERROR, PAR8, 0,0,0,0,0,0,0 ),
449  SC( VM_SUBP, ERRORTEXT, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
450 
451  SC( VM_SUBP, GET_VOLUME, PAR8, 0,0,0,0,0,0,0 ),
452  SC( VM_SUBP, SET_VOLUME, PAR8, 0,0,0,0,0,0,0 ),
453  SC( VM_SUBP, GET_MINUTES, PAR8, 0,0,0,0,0,0,0 ),
454  SC( VM_SUBP, SET_MINUTES, PAR8, 0,0,0,0,0,0,0 ),
455 
456  SC( TST_SUBP, TST_OPEN, 0, 0,0,0,0,0,0,0 ),
457  SC( TST_SUBP, TST_CLOSE, 0, 0,0,0,0,0,0,0 ),
458  SC( TST_SUBP, TST_READ_PINS, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
459  SC( TST_SUBP, TST_WRITE_PINS, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
460  SC( TST_SUBP, TST_READ_ADC, PAR8,PAR16, 0,0,0,0,0,0 ),
461  SC( TST_SUBP, TST_WRITE_UART, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
462  SC( TST_SUBP, TST_READ_UART, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
463  SC( TST_SUBP, TST_ENABLE_UART, PAR32, 0,0,0,0,0,0,0 ),
464  SC( TST_SUBP, TST_DISABLE_UART, 0, 0,0,0,0,0,0,0 ),
465  SC( TST_SUBP, TST_ACCU_SWITCH, PAR8, 0,0,0,0,0,0,0 ),
466  SC( TST_SUBP, TST_BOOT_MODE2, 0, 0,0,0,0,0,0,0 ),
467  SC( TST_SUBP, TST_POLL_MODE2, PAR8, 0,0,0,0,0,0,0 ),
468  SC( TST_SUBP, TST_CLOSE_MODE2, 0, 0,0,0,0,0,0,0 ),
469  SC( TST_SUBP, TST_RAM_CHECK, PAR8, 0,0,0,0,0,0,0 ),
470 
471  SC( STRING_SUBP, GET_SIZE, PAR8,PAR16, 0,0,0,0,0,0 ),
472  SC( STRING_SUBP, ADD, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
473  SC( STRING_SUBP, COMPARE, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
474  SC( STRING_SUBP, DUPLICATE, PAR8,PAR8, 0,0,0,0,0,0 ),
475  SC( STRING_SUBP, VALUE_TO_STRING, PARF,PAR8,PAR8,PAR8, 0,0,0,0 ),
476  SC( STRING_SUBP, STRING_TO_VALUE, PAR8,PARF, 0,0,0,0,0,0 ),
477  SC( STRING_SUBP, STRIP, PAR8,PAR8, 0,0,0,0,0,0 ),
478  SC( STRING_SUBP, NUMBER_TO_STRING, PAR16,PAR8,PAR8, 0,0,0,0,0 ),
479  SC( STRING_SUBP, SUB, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
480  SC( STRING_SUBP, VALUE_FORMATTED, PARF,PAR8,PAR8,PAR8, 0,0,0,0 ),
481  SC( STRING_SUBP, NUMBER_FORMATTED, PAR32,PAR8,PAR8,PAR8, 0,0,0,0 ),
482 
483  // UI
484  SC( UI_READ_SUBP, GET_VBATT, PARF, 0,0,0,0,0,0,0 ),
485  SC( UI_READ_SUBP, GET_IBATT, PARF, 0,0,0,0,0,0,0 ),
486  SC( UI_READ_SUBP, GET_OS_VERS, PAR8,PAR8, 0,0,0,0,0,0 ),
487  SC( UI_READ_SUBP, GET_EVENT, PAR8, 0,0,0,0,0,0,0 ),
488  SC( UI_READ_SUBP, GET_TBATT, PARF, 0,0,0,0,0,0,0 ),
489  SC( UI_READ_SUBP, GET_IINT, PARF, 0,0,0,0,0,0,0 ),
490  SC( UI_READ_SUBP, GET_IMOTOR, PARF, 0,0,0,0,0,0,0 ),
491  SC( UI_READ_SUBP, GET_STRING, PAR8,PAR8, 0,0,0,0,0,0 ),
492  SC( UI_READ_SUBP, KEY, PAR8, 0,0,0,0,0,0,0 ),
493  SC( UI_READ_SUBP, GET_SHUTDOWN, PAR8, 0,0,0,0,0,0,0 ),
494  SC( UI_READ_SUBP, GET_WARNING, PAR8, 0,0,0,0,0,0,0 ),
495  SC( UI_READ_SUBP, GET_LBATT, PAR8, 0,0,0,0,0,0,0 ),
496  SC( UI_READ_SUBP, GET_ADDRESS, PAR32, 0,0,0,0,0,0,0 ),
497  SC( UI_READ_SUBP, GET_CODE, PAR32,PAR32,PAR32,PAR8, 0,0,0,0 ),
498  SC( UI_READ_SUBP, TEXTBOX_READ, PAR8,PAR32,PAR8,PAR8,PAR16,PAR8, 0,0 ),
499  SC( UI_READ_SUBP, GET_HW_VERS, PAR8,PAR8, 0,0,0,0,0,0 ),
500  SC( UI_READ_SUBP, GET_FW_VERS, PAR8,PAR8, 0,0,0,0,0,0 ),
501  SC( UI_READ_SUBP, GET_FW_BUILD, PAR8,PAR8, 0,0,0,0,0,0 ),
502  SC( UI_READ_SUBP, GET_OS_BUILD, PAR8,PAR8, 0,0,0,0,0,0 ),
503  SC( UI_READ_SUBP, GET_VERSION, PAR8,PAR8, 0,0,0,0,0,0 ),
504  SC( UI_READ_SUBP, GET_IP, PAR8,PAR8, 0,0,0,0,0,0 ),
505  SC( UI_READ_SUBP, GET_SDCARD, PAR8,PAR32,PAR32, 0,0,0,0,0 ),
506  SC( UI_READ_SUBP, GET_USBSTICK, PAR8,PAR32,PAR32, 0,0,0,0,0 ),
507 
508  SC( UI_WRITE_SUBP, WRITE_FLUSH, 0, 0,0,0,0,0,0,0 ),
509  SC( UI_WRITE_SUBP, FLOATVALUE, PARF,PAR8,PAR8, 0,0,0,0,0 ),
510  SC( UI_WRITE_SUBP, STAMP, PAR8, 0,0,0,0,0,0,0 ),
511  SC( UI_WRITE_SUBP, PUT_STRING, PAR8, 0,0,0,0,0,0,0 ),
512  SC( UI_WRITE_SUBP, CODE, PAR8,PAR32, 0,0,0,0,0,0 ),
513  SC( UI_WRITE_SUBP, DOWNLOAD_END, 0, 0,0,0,0,0,0,0 ),
514  SC( UI_WRITE_SUBP, SCREEN_BLOCK, PAR8, 0,0,0,0,0,0,0 ),
515  SC( UI_WRITE_SUBP, TEXTBOX_APPEND, PAR8,PAR32,PAR8,PAR8, 0,0,0,0 ),
516  SC( UI_WRITE_SUBP, SET_BUSY, PAR8, 0,0,0,0,0,0,0 ),
517  SC( UI_WRITE_SUBP, VALUE8, PAR8, 0,0,0,0,0,0,0 ),
518  SC( UI_WRITE_SUBP, VALUE16, PAR16, 0,0,0,0,0,0,0 ),
519  SC( UI_WRITE_SUBP, VALUE32, PAR32, 0,0,0,0,0,0,0 ),
520  SC( UI_WRITE_SUBP, VALUEF, PARF, 0,0,0,0,0,0,0 ),
521  SC( UI_WRITE_SUBP, INIT_RUN, 0, 0,0,0,0,0,0,0 ),
522  SC( UI_WRITE_SUBP, UPDATE_RUN, 0, 0,0,0,0,0,0,0 ),
523  SC( UI_WRITE_SUBP, LED, PAR8, 0,0,0,0,0,0,0 ),
524  SC( UI_WRITE_SUBP, POWER, PAR8, 0,0,0,0,0,0,0 ),
525  SC( UI_WRITE_SUBP, TERMINAL, PAR8, 0,0,0,0,0,0,0 ),
526  SC( UI_WRITE_SUBP, GRAPH_SAMPLE, 0, 0,0,0,0,0,0,0 ),
527  SC( UI_WRITE_SUBP, SET_TESTPIN, PAR8, 0,0,0,0,0,0,0 ),
528 
529  SC( UI_DRAW_SUBP, UPDATE, 0, 0,0,0,0,0,0,0 ),
530  SC( UI_DRAW_SUBP, CLEAN, 0, 0,0,0,0,0,0,0 ),
531  SC( UI_DRAW_SUBP, FILLRECT, PAR8,PAR16,PAR16,PAR16,PAR16, 0,0,0 ),
532  SC( UI_DRAW_SUBP, RECT, PAR8,PAR16,PAR16,PAR16,PAR16, 0,0,0 ),
533  SC( UI_DRAW_SUBP, PIXEL, PAR8,PAR16,PAR16, 0,0,0,0,0 ),
534  SC( UI_DRAW_SUBP, LINE, PAR8,PAR16,PAR16,PAR16,PAR16, 0,0,0 ),
535  SC( UI_DRAW_SUBP, CIRCLE, PAR8,PAR16,PAR16,PAR16, 0,0,0,0 ),
536  SC( UI_DRAW_SUBP, TEXT, PAR8,PAR16,PAR16,PAR8, 0,0,0,0 ),
537  SC( UI_DRAW_SUBP, ICON, PAR8,PAR16,PAR16,PAR8,PAR8, 0,0,0 ),
538  SC( UI_DRAW_SUBP, PICTURE, PAR8,PAR16,PAR16,PAR32, 0,0,0,0 ),
539  SC( UI_DRAW_SUBP, VALUE, PAR8,PAR16,PAR16,PARF,PAR8,PAR8, 0,0 ),
540  SC( UI_DRAW_SUBP, NOTIFICATION, PAR8,PAR16,PAR16,PAR8,PAR8,PAR8,PAR8,PAR8 ),
545  SC( UI_DRAW_SUBP, INVERSERECT, PAR16,PAR16,PAR16,PAR16, 0,0,0,0 ),
546  SC( UI_DRAW_SUBP, SELECT_FONT, PAR8, 0,0,0,0,0,0,0 ),
547  SC( UI_DRAW_SUBP, TOPLINE, PAR8, 0,0,0,0,0,0,0 ),
548  SC( UI_DRAW_SUBP, FILLWINDOW, PAR8,PAR16,PAR16, 0,0,0,0,0 ),
549  SC( UI_DRAW_SUBP, SCROLL, PAR16, 0,0,0,0,0,0,0 ),
550  SC( UI_DRAW_SUBP, DOTLINE, PAR8,PAR16,PAR16,PAR16,PAR16,PAR16,PAR16, 0 ),
551  SC( UI_DRAW_SUBP, VIEW_VALUE, PAR8,PAR16,PAR16,PARF,PAR8,PAR8, 0,0 ),
552  SC( UI_DRAW_SUBP, VIEW_UNIT, PAR8,PAR16,PAR16,PARF,PAR8,PAR8,PAR8,PAR8 ),
553  SC( UI_DRAW_SUBP, FILLCIRCLE, PAR8,PAR16,PAR16,PAR16, 0,0,0,0 ),
554  SC( UI_DRAW_SUBP, STORE, PAR8, 0,0,0,0,0,0,0 ),
555  SC( UI_DRAW_SUBP, RESTORE, PAR8, 0,0,0,0,0,0,0 ),
556  SC( UI_DRAW_SUBP, ICON_QUESTION, PAR8,PAR16,PAR16,PAR8,PAR32, 0,0,0 ),
557  SC( UI_DRAW_SUBP, BMPFILE, PAR8,PAR16,PAR16,PAR8, 0,0,0,0 ),
559  SC( UI_DRAW_SUBP, GRAPH_DRAW, PAR8,PARF,PARF,PARF,PARF, 0,0,0 ),
560  SC( UI_DRAW_SUBP, POPUP, PAR8, 0,0,0,0,0,0,0 ),
562 
563  SC( UI_BUTTON_SUBP, SHORTPRESS, PAR8,PAR8, 0,0,0,0,0,0 ),
564  SC( UI_BUTTON_SUBP, LONGPRESS, PAR8,PAR8, 0,0,0,0,0,0 ),
565  SC( UI_BUTTON_SUBP, FLUSH, 0, 0,0,0,0,0,0,0 ),
566  SC( UI_BUTTON_SUBP, WAIT_FOR_PRESS, 0, 0,0,0,0,0,0,0 ),
567  SC( UI_BUTTON_SUBP, PRESS, PAR8, 0,0,0,0,0,0,0 ),
568  SC( UI_BUTTON_SUBP, RELEASE, PAR8, 0,0,0,0,0,0,0 ),
569  SC( UI_BUTTON_SUBP, GET_HORZ, PAR16, 0,0,0,0,0,0,0 ),
570  SC( UI_BUTTON_SUBP, GET_VERT, PAR16, 0,0,0,0,0,0,0 ),
571  SC( UI_BUTTON_SUBP, PRESSED, PAR8,PAR8, 0,0,0,0,0,0 ),
572  SC( UI_BUTTON_SUBP, SET_BACK_BLOCK, PAR8, 0,0,0,0,0,0,0 ),
573  SC( UI_BUTTON_SUBP, GET_BACK_BLOCK, PAR8, 0,0,0,0,0,0,0 ),
574  SC( UI_BUTTON_SUBP, TESTSHORTPRESS, PAR8,PAR8, 0,0,0,0,0,0 ),
575  SC( UI_BUTTON_SUBP, TESTLONGPRESS, PAR8,PAR8, 0,0,0,0,0,0 ),
576  SC( UI_BUTTON_SUBP, GET_BUMBED, PAR8,PAR8, 0,0,0,0,0,0 ),
577  SC( UI_BUTTON_SUBP, GET_CLICK, PAR8, 0,0,0,0,0,0,0 ),
578 
579  // Com
580  SC( COM_READ_SUBP, COMMAND, PAR32,PAR32,PAR32,PAR8, 0,0,0,0 ),
581  SC( COM_WRITE_SUBP, REPLY, PAR32,PAR32,PAR8, 0,0,0,0,0 ),
582 
583  // Sound
584  SC( SOUND_SUBP, BREAK, 0, 0,0,0,0,0,0,0 ),
585  SC( SOUND_SUBP, TONE, PAR8,PAR16,PAR16, 0,0,0,0,0 ),
586  SC( SOUND_SUBP, PLAY, PAR8,PARS, 0,0,0,0,0,0 ),
587  SC( SOUND_SUBP, REPEAT, PAR8,PARS, 0,0,0,0,0,0 ),
588  SC( SOUND_SUBP, SERVICE, 0, 0,0,0,0,0,0,0 ),
589 
590  // Input
591  SC( INPUT_SUBP, GET_TYPEMODE, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
592  SC( INPUT_SUBP, GET_CONNECTION, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
593  SC( INPUT_SUBP, GET_NAME, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
594  SC( INPUT_SUBP, GET_SYMBOL, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
595  SC( INPUT_SUBP, GET_FORMAT, PAR8,PAR8,PAR8,PAR8,PAR8,PAR8, 0,0 ),
596  SC( INPUT_SUBP, GET_RAW, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
597  SC( INPUT_SUBP, GET_MODENAME, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
598  SC( INPUT_SUBP, SET_RAW, PAR8,PAR8,PAR8,PAR32, 0,0,0,0 ),
599  SC( INPUT_SUBP, GET_FIGURES, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
600  SC( INPUT_SUBP, GET_CHANGES, PAR8,PAR8,PARF, 0,0,0,0,0 ),
601  SC( INPUT_SUBP, CLR_CHANGES, PAR8,PAR8,0, 0,0,0,0,0 ),
602  SC( INPUT_SUBP, READY_PCT, PAR8,PAR8,PAR8,PAR8,PARNO, 0,0,0 ),
603  SC( INPUT_SUBP, READY_RAW, PAR8,PAR8,PAR8,PAR8,PARNO, 0,0,0 ),
604  SC( INPUT_SUBP, READY_SI, PAR8,PAR8,PAR8,PAR8,PARNO, 0,0,0 ),
605  SC( INPUT_SUBP, GET_MINMAX, PAR8,PAR8,PARF,PARF, 0,0,0,0 ),
606  SC( INPUT_SUBP, CAL_MINMAX, PAR8,PAR8,PAR32,PAR32, 0,0,0,0 ),
607  SC( INPUT_SUBP, CAL_DEFAULT, PAR8,PAR8,0, 0,0,0,0,0 ),
608  SC( INPUT_SUBP, CAL_MIN, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
609  SC( INPUT_SUBP, CAL_MAX, PAR8,PAR8,PAR32, 0,0,0,0,0 ),
610  SC( INPUT_SUBP, GET_BUMPS, PAR8,PAR8,PARF, 0,0,0,0,0 ),
612  SC( INPUT_SUBP, CLR_ALL, PAR8, 0,0,0,0,0,0,0 ),
613  SC( INPUT_SUBP, STOP_ALL, PAR8, 0,0,0,0,0,0,0 ),
614 
615  // Math
616  SC( MATH_SUBP, EXP, PARF,PARF, 0,0,0,0,0,0 ),
617  SC( MATH_SUBP, MOD, PARF,PARF,PARF, 0,0,0,0,0 ),
618  SC( MATH_SUBP, FLOOR, PARF,PARF, 0,0,0,0,0,0 ),
619  SC( MATH_SUBP, CEIL, PARF,PARF, 0,0,0,0,0,0 ),
620  SC( MATH_SUBP, ROUND, PARF,PARF, 0,0,0,0,0,0 ),
621  SC( MATH_SUBP, ABS, PARF,PARF, 0,0,0,0,0,0 ),
622  SC( MATH_SUBP, NEGATE, PARF,PARF, 0,0,0,0,0,0 ),
623  SC( MATH_SUBP, SQRT, PARF,PARF, 0,0,0,0,0,0 ),
624  SC( MATH_SUBP, LOG, PARF,PARF, 0,0,0,0,0,0 ),
625  SC( MATH_SUBP, LN, PARF,PARF, 0,0,0,0,0,0 ),
626  SC( MATH_SUBP, SIN, PARF,PARF, 0,0,0,0,0,0 ),
627  SC( MATH_SUBP, COS, PARF,PARF, 0,0,0,0,0,0 ),
628  SC( MATH_SUBP, TAN, PARF,PARF, 0,0,0,0,0,0 ),
629  SC( MATH_SUBP, ASIN, PARF,PARF, 0,0,0,0,0,0 ),
630  SC( MATH_SUBP, ACOS, PARF,PARF, 0,0,0,0,0,0 ),
631  SC( MATH_SUBP, ATAN, PARF,PARF, 0,0,0,0,0,0 ),
632  SC( MATH_SUBP, MOD8, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
633  SC( MATH_SUBP, MOD16, PAR16,PAR16,PAR16, 0,0,0,0,0 ),
634  SC( MATH_SUBP, MOD32, PAR32,PAR32,PAR32, 0,0,0,0,0 ),
635  SC( MATH_SUBP, POW, PARF,PARF,PARF, 0,0,0,0,0 ),
636  SC( MATH_SUBP, TRUNC, PARF,PAR8,PARF, 0,0,0,0,0 ),
637 
638  // ComGet
639  SC( COM_GET_SUBP, GET_ON_OFF, PAR8,PAR8, 0,0,0,0,0,0 ),
640  SC( COM_GET_SUBP, GET_VISIBLE, PAR8,PAR8, 0,0,0,0,0,0 ),
641  SC( COM_GET_SUBP, GET_RESULT, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
642  SC( COM_GET_SUBP, GET_PIN, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
643  SC( COM_GET_SUBP, SEARCH_ITEMS, PAR8,PAR8, 0,0,0,0,0,0 ),
644  SC( COM_GET_SUBP, SEARCH_ITEM, PAR8,PAR8,PAR8,PAR8,PAR8,PAR8,PAR8,PAR8 ),
645  SC( COM_GET_SUBP, FAVOUR_ITEMS, PAR8,PAR8, 0,0,0,0,0,0 ),
646  SC( COM_GET_SUBP, FAVOUR_ITEM, PAR8,PAR8,PAR8,PAR8,PAR8,PAR8,PAR8, 0 ),
647  SC( COM_GET_SUBP, GET_ID, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
648  SC( COM_GET_SUBP, GET_BRICKNAME, PAR8,PAR8, 0,0,0,0,0,0 ),
649  SC( COM_GET_SUBP, GET_NETWORK, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
650  SC( COM_GET_SUBP, GET_PRESENT, PAR8,PAR8, 0,0,0,0,0,0 ),
651  SC( COM_GET_SUBP, GET_ENCRYPT, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
652  SC( COM_GET_SUBP, CONNEC_ITEMS, PAR8,PAR8, 0,0,0,0,0,0 ),
653  SC( COM_GET_SUBP, CONNEC_ITEM, PAR8,PAR8,PAR8,PAR8,PAR8, 0,0,0 ),
654  SC( COM_GET_SUBP, GET_INCOMING, PAR8,PAR8,PAR8,PAR8, 0,0,0,0 ),
655  SC( COM_GET_SUBP, GET_MODE2, PAR8,PAR8, 0,0,0,0,0,0 ),
656 
657  // ComSet
658  SC( COM_SET_SUBP, SET_ON_OFF, PAR8,PAR8, 0,0,0,0,0,0 ),
659  SC( COM_SET_SUBP, SET_VISIBLE, PAR8,PAR8, 0,0,0,0,0,0 ),
660  SC( COM_SET_SUBP, SET_SEARCH, PAR8,PAR8, 0,0,0,0,0,0 ),
661  SC( COM_SET_SUBP, SET_PIN, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
662  SC( COM_SET_SUBP, SET_PASSKEY, PAR8,PAR8, 0,0,0,0,0,0 ),
663  SC( COM_SET_SUBP, SET_CONNECTION, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
664  SC( COM_SET_SUBP, SET_BRICKNAME, PAR8, 0,0,0,0,0,0,0 ),
665  SC( COM_SET_SUBP, SET_MOVEUP, PAR8,PAR8, 0,0,0,0,0,0 ),
666  SC( COM_SET_SUBP, SET_MOVEDOWN, PAR8,PAR8, 0,0,0,0,0,0 ),
667  SC( COM_SET_SUBP, SET_ENCRYPT, PAR8,PAR8,PAR8, 0,0,0,0,0 ),
668  SC( COM_SET_SUBP, SET_SSID, PAR8,PAR8, 0,0,0,0,0,0 ),
669  SC( COM_SET_SUBP, SET_MODE2, PAR8,PAR8, 0,0,0,0,0,0 ),
670 
671 };
#define PARNO
Defines no of following parameters.
Definition: bytecodes.c:72
UBYTE PARS
NoOfParameters type.
Definition: lmstypes.h:82
#define PAR8
DATA8 parameter.
Definition: bytecodes.c:77
#define DATA8_MIN
Definition: bytecodes.h:1497
#define PARF
DATAF parameter.
Definition: bytecodes.c:80
#define DATA32_MAX
Definition: bytecodes.h:1502
#define TST_SUBP
Definition: bytecodes.c:136
SLONG DATA32
VM Type for 4 byte signed value.
Definition: lmstypes.h:63
#define SC(ParameterFormat, SubCode, Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8)
Definition: bytecodes.c:56
const char * Name
Opcode name.
Definition: bytecodes.c:30
const char * Name
Sub code name.
Definition: bytecodes.c:37
#define DATA16_MAX
Definition: bytecodes.h:1500
const ULONG Pars
Contains parameter info nibbles (max 8)
Definition: bytecodes.c:29
#define PAR32
DATA32 parameter.
Definition: bytecodes.c:79
#define FILENAME_SUBP
Definition: bytecodes.c:135
unsigned int ULONG
Basic Type used to symbolise 32 bit unsigned values.
Definition: lmstypes.h:31
#define DATA32_MIN
Definition: bytecodes.h:1501
#define PAR16
DATA16 parameter.
Definition: bytecodes.c:78
#define MAX_SUBCODES
Max number of sub codes.
Definition: bytecodes.c:22
#define SUBP
Next nibble is sub parameter table no.
Definition: bytecodes.c:71
#define PARV
Parameter type variable.
Definition: bytecodes.c:82
#define OC(OpCode, Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8)
Definition: bytecodes.c:41
#define PARVALUES
Last parameter defines number of values to follow.
Definition: bytecodes.c:74
#define DATA16_MIN
Definition: bytecodes.h:1499
#define PARLAB
Defines label no.
Definition: bytecodes.c:73
const ULONG Pars
Contains parameter info nibbles (max 8)
Definition: bytecodes.c:36
#define DATA8_MAX
Definition: bytecodes.h:1498