Source code: com/chaoswg/xtc4y/classdesc/code/instructions/UnaryInstruction.java
1 //$Header: /cvsroot/xtc4y/xtc4y/src/com/chaoswg/xtc4y/classdesc/code/instructions/UnaryInstruction.java,v 1.2 2003/08/26 12:35:25 toggm Exp $
2 /******************************************************************************
3 * XTC4y - eXtreme Testing Collection 4 you *
4 * -------------------------------------------------------------------------- *
5 * URL: http://www.chaoswg.com/xtc4y *
6 * Author: Mike Toggweiler (2.dog@gmx.ch) *
7 * *
8 * Last Updated: $Date: 2003/08/26 12:35:25 $, by $Author: toggm $ *
9 * Version: $Revision: 1.2 $ *
10 * -------------------------------------------------------------------------- *
11 * COPYRIGHT: (c) 2003 by Mike Toggweiler *
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 *****************************************************************************/
18 package com.chaoswg.xtc4y.classdesc.code.instructions;
19
20 import java.io.DataInputStream;
21 import java.io.DataOutputStream;
22 import java.io.IOException;
23
24 /**
25 * An unaryinstruction consists only of a command with no operands.
26 * the size of such an instruction is 1 byte
27 * @author Mike Toggweiler
28 **/
29 public class UnaryInstruction extends Instruction {
30
31 /**
32 * Opcode of unary instructions
33 **/
34
35 /**
36 * nop (no operation)
37 **/
38 public static final byte NOP = (byte)0;
39 /**
40 * null
41 **/
42 public static final byte ACONST_NULL = (byte)1;
43 /**
44 * constant int value -1
45 **/
46 public static final byte ICONST_M1 = (byte)2;
47 /**
48 * constant int value 0
49 **/
50 public static final byte ICONST_0 = (byte)3;
51 /**
52 * constant int value 1
53 **/
54 public static final byte ICONST_1 = (byte)4;
55 /**
56 * constant int value 2
57 **/
58 public static final byte ICONST_2 = (byte)5;
59 /**
60 * constant int value 3
61 **/
62 public static final byte ICONST_3 = (byte)6;
63 /**
64 * constant int value 4
65 **/
66 public static final byte ICONST_4 = (byte)7;
67 /**
68 * constant int value 5
69 **/
70 public static final byte ICONST_5 = (byte)8;
71 /**
72 * constant long value 0
73 **/
74 public static final byte LCONST_0 = (byte)9;
75 /**
76 * constant long value 1
77 **/
78 public static final byte LCONST_1 = (byte)10;
79 /**
80 * constant float value 0
81 **/
82 public static final byte FCONST_0 = (byte)11;
83 /**
84 * constant float value 1
85 **/
86 public static final byte FCONST_1 = (byte)12;
87 /**
88 * constant float value 2
89 **/
90 public static final byte FCONST_2 = (byte)13;
91 /**
92 * constant double value 0
93 **/
94 public static final byte DCONST_0 = (byte)14;
95 /**
96 * constant double value 1
97 **/
98 public static final byte DCONST_1 = (byte)15;
99
100 /**
101 * load local int at indexed position
102 **/
103 public static final byte ILOAD_0 = (byte)26;
104 public static final byte ILOAD_1 = (byte)27;
105 public static final byte ILOAD_2 = (byte)28;
106 public static final byte ILOAD_3 = (byte)29;
107 /**
108 * load local long at indexed position
109 **/
110 public static final byte LLOAD_0 = (byte)30;
111 public static final byte LLOAD_1 = (byte)31;
112 public static final byte LLOAD_2 = (byte)32;
113 public static final byte LLOAD_3 = (byte)33;
114 /**
115 * load local float at indexed position
116 **/
117 public static final byte FLOAD_0 = (byte)34;
118 public static final byte FLOAD_1 = (byte)35;
119 public static final byte FLOAD_2 = (byte)36;
120 public static final byte FLOAD_3 = (byte)37;
121 /**
122 * load local double at indexed position
123 **/
124 public static final byte DLOAD_0 = (byte)38;
125 public static final byte DLOAD_1 = (byte)39;
126 public static final byte DLOAD_2 = (byte)40;
127 public static final byte DLOAD_3 = (byte)41;
128 /**
129 * load local object at indexed position
130 **/
131 public static final byte ALOAD_0 = (byte)42;
132 public static final byte ALOAD_1 = (byte)43;
133 public static final byte ALOAD_2 = (byte)44;
134 public static final byte ALOAD_3 = (byte)45;
135 /**
136 * load local int of array at position stored on stack
137 **/
138 public static final byte IALOAD = (byte)46;
139 /**
140 * load local long of array at position stored on stack
141 **/
142 public static final byte LALOAD = (byte)47;
143 /**
144 * load local float of array at position stored on stack
145 **/
146 public static final byte FALOAD = (byte)48;
147 /**
148 * load local double of array at position stored on stack
149 **/
150 public static final byte DALOAD = (byte)49;
151 /**
152 * load local object of array at position stored on stack
153 **/
154 public static final byte AALOAD = (byte)50;
155 /**
156 * load local byte of array at position stored on stack
157 **/
158 public static final byte BALOAD = (byte)51;
159 /**
160 * load local char of array at position stored on stack
161 **/
162 public static final byte CALOAD = (byte)52;
163 /**
164 * load local short of array at position stored on stack
165 **/
166 public static final byte SALOAD = (byte)53;
167 /**
168 * store local int at indexed position
169 **/
170 public static final byte ISTORE_0 = (byte)59;
171 public static final byte ISTORE_1 = (byte)60;
172 public static final byte ISTORE_2 = (byte)61;
173 public static final byte ISTORE_3 = (byte)62;
174 /**
175 * store local long at indexed position
176 **/
177 public static final byte LSTORE_0 = (byte)63;
178 public static final byte LSTORE_1 = (byte)64;
179 public static final byte LSTORE_2 = (byte)65;
180 public static final byte LSTORE_3 = (byte)66;
181 /**
182 * store local float at indexed position
183 **/
184 public static final byte FSTORE_0 = (byte)67;
185 public static final byte FSTORE_1 = (byte)68;
186 public static final byte FSTORE_2 = (byte)69;
187 public static final byte FSTORE_3 = (byte)70;
188 /**
189 * store local double at indexed position
190 **/
191 public static final byte DSTORE_0 = (byte)71;
192 public static final byte DSTORE_1 = (byte)72;
193 public static final byte DSTORE_2 = (byte)73;
194 public static final byte DSTORE_3 = (byte)74;
195 /**
196 * store local object at indexed position
197 **/
198 public static final byte ASTORE_0 = (byte)75;
199 public static final byte ASTORE_1 = (byte)76;
200 public static final byte ASTORE_2 = (byte)77;
201 public static final byte ASTORE_3 = (byte)78;
202 /**
203 * store local int of array at position stored on stack
204 **/
205 public static final byte IASTORE = (byte)79;
206 /**
207 * store local long of array at position stored on stack
208 **/
209 public static final byte LASTORE = (byte)80;
210 /**
211 * store local float of array at position stored on stack
212 **/
213 public static final byte FASTORE = (byte)81;
214 /**
215 * store local double of array at position stored on stack
216 **/
217 public static final byte DASTORE = (byte)82;
218 /**
219 * store local object of array at position stored on stack
220 **/
221 public static final byte AASTORE = (byte)83;
222 /**
223 * store local byte of array at position stored on stack
224 **/
225 public static final byte BASTORE = (byte)84;
226 /**
227 * store local char of array at position stored on stack
228 **/
229 public static final byte CASTORE = (byte)85;
230 /**
231 * store local short of array at position stored on stack
232 **/
233 public static final byte SASTORE = (byte)86;
234 /**
235 * pop last entry of stack for byte, char, short, int, float and
236 * string values
237 **/
238 public static final byte POP = (byte)87;
239 /**
240 * pop last entry of stack for long and double values
241 **/
242 public static final byte POP2 = (byte)88;
243 /**
244 * duplicate the last value on the stack of a byte, char, short, int,
245 * flaot or string value
246 **/
247 public static final byte DUP = (byte)89;
248 /**
249 * duplicate the last value on the stack of a byte, char, short, int,
250 * flaot or string value
251 **/
252 public static final byte DUP_X1 = (byte)90;
253 /**
254 * duplicate the last value on the stack of a byte, char, short, int,
255 * flaot or string value
256 **/
257 public static final byte DUP_X2 = (byte)91;
258 /**
259 * duplicate the last value on the stack of a double or float
260 **/
261 public static final byte DUP2 = (byte)92;
262 /**
263 * duplicate the last value on the stack of a double or float
264 **/
265 public static final byte DUP2_X1 = (byte)93;
266 /**
267 * duplicate the last value on the stack of a double or float
268 **/
269 public static final byte DUP2_X2 = (byte)94;
270 /**
271 * swap the last two stack entries
272 **/
273 public static final byte SWAP = (byte)95;
274 /**
275 * add the last two int values on the stack
276 **/
277 public static final byte IADD = (byte)96;
278 /**
279 * add the last two long values on the stack
280 **/
281 public static final byte LADD = (byte)97;
282 /**
283 * add the last two float values on the stack
284 **/
285 public static final byte FADD = (byte)98;
286 /**
287 * add the last two double values on the stack
288 **/
289 public static final byte DADD = (byte)99;
290 /**
291 * subtract the last from the second last int value on the stack
292 **/
293 public static final byte ISUB = (byte)100;
294 /**
295 * subtract the last from the second last long value on the stack
296 **/
297 public static final byte LSUB = (byte)101;
298 /**
299 * subtract the last from the second last float value on the stack
300 **/
301 public static final byte FSUB = (byte)102;
302 /**
303 * subtract the last from the second last double value on the stack
304 **/
305 public static final byte DSUB = (byte)103;
306 /**
307 * multiplicate the last two int values on the stack
308 **/
309 public static final byte IMUL = (byte)104;
310 /**
311 * multiplicate the last two long values on the stack
312 **/
313 public static final byte LMUL = (byte)105;
314 /**
315 * multiplicate the last two float values on the stack
316 **/
317 public static final byte FMUL = (byte)106;
318 /**
319 * multiplicate the last two double values on the stack
320 **/
321 public static final byte DMUL = (byte)107;
322 /**
323 * divide the second last from the last int value on the stack
324 **/
325 public static final byte IDIV = (byte)108;
326 /**
327 * divide the second last from the last long value on the stack
328 **/
329 public static final byte LDIV = (byte)109;
330 /**
331 * divide the second last from the last float value on the stack
332 **/
333 public static final byte FDIV = (byte)110;
334 /**
335 * divide the second last from the last double value on the stack
336 **/
337 public static final byte DDIV = (byte)111;
338 /**
339 * calculate the modulus of the last to the second last int value on the
340 * stack
341 **/
342 public static final byte IREM = (byte)112;
343 /**
344 * calculate the modulus of the last to the second last long value on the
345 * stack
346 **/
347 public static final byte LREM = (byte)113;
348 /**
349 * calculate the modulus of the last to the second last float value on the
350 * stack
351 **/
352 public static final byte FREM = (byte)114;
353 /**
354 * calculate the modulus of the last to the second last double value on the
355 * stack
356 **/
357 public static final byte DREM = (byte)115;
358 /**
359 * negate the last int value on the stack
360 **/
361 public static final byte INEG = (byte)116;
362 /**
363 * negate the last long value on the stack
364 **/
365 public static final byte LNEG = (byte)117;
366 /**
367 * negate the last float value on the stack
368 **/
369 public static final byte FNEG = (byte)118;
370 /**
371 * negate the last double value on the stack
372 **/
373 public static final byte DNEG = (byte)119;
374 /**
375 * shift left the last int value on the stack by one byte
376 **/
377 public static final byte ISHL = (byte)120;
378 /**
379 * shift left the last long value on the stack by one byte
380 **/
381 public static final byte LSHL = (byte)121;
382 /**
383 * shift right the last int value on the stack by one byte
384 **/
385 public static final byte ISHR = (byte)122;
386 /**
387 * shift right the last long value on the stack by one byte
388 **/
389 public static final byte LSHR = (byte)123;
390 /**
391 * unsigned shift right the last int value on the stack by one byte
392 **/
393 public static final byte IUSHR = (byte)124;
394 /**
395 * unsigned shift right the last long value on the stack by one byte
396 **/
397 public static final byte LUSHR = (byte)125;
398 /**
399 * logical And the last two int values on the stack
400 **/
401 public static final byte IAND = (byte)126;
402 /**
403 * logical And the last two long values on the stack
404 **/
405 public static final byte LAND = (byte)127;
406 /**
407 * logical or the last two int values on the stack
408 **/
409 public static final byte IOR = (byte)128;
410 /**
411 * logical or the last two long values on the stack
412 **/
413 public static final byte LOR = (byte)129;
414 /**
415 * logical xor the last two int values on the stack
416 **/
417 public static final byte IXOR = (byte)130;
418 /**
419 * logical xor the last two long values on the stack
420 **/
421 public static final byte LXOR = (byte)131;
422 /**
423 * converts the last int value on the stack to a long value
424 **/
425 public static final byte I2L = (byte)133;
426 /**
427 * converts the last int value on the stack to a float value
428 **/
429 public static final byte I2F = (byte)134;
430 /**
431 * converts the last int value on the stack to a double value
432 **/
433 public static final byte I2D = (byte)135;
434 /**
435 * converts the last long value on the stack to a int value
436 **/
437 public static final byte L2I = (byte)136;
438 /**
439 * converts the last long value on the stack to a float value
440 **/
441 public static final byte L2F = (byte)137;
442 /**
443 * converts the last long value on the stack to a double value
444 **/
445 public static final byte L2D = (byte)138;
446 /**
447 * converts the last float value on the stack to a int value
448 **/
449 public static final byte F2I = (byte)139;
450 /**
451 * converts the last float value on the stack to a long value
452 **/
453 public static final byte F2L = (byte)140;
454 /**
455 * converts the last float value on the stack to a double value
456 **/
457 public static final byte F2D = (byte)141;
458 /**
459 * converts the last double value on the stack to a int value
460 **/
461 public static final byte D2I = (byte)142;
462 /**
463 * converts the last double value on the stack to a long value
464 **/
465 public static final byte D2L = (byte)143;
466 /**
467 * converts the last double value on the stack to a float value
468 **/
469 public static final byte D2F = (byte)144;
470 /**
471 * converts the last int value on the stack to a byte value
472 **/
473 public static final byte I2B = (byte)145;
474 /**
475 * converts the last int value on the stack to a char value
476 **/
477 public static final byte I2C = (byte)146;
478 /**
479 * converts the last int value on the stack to a short value
480 **/
481 public static final byte I2S = (byte)147;
482 /**
483 * compare a two long value
484 **/
485 public static final byte LCMP = (byte)148;
486 /**
487 * compare if the second last float value on the stack is lower than the
488 * last one
489 **/
490 public static final byte FCMPL = (byte)149;
491 /**
492 * compare if the second last float value on the stack is greater than the
493 * last one
494 **/
495 public static final byte FCMPG = (byte)150;
496 /**
497 * compare if the second last double value on the stack is lower than the
498 * last one
499 **/
500 public static final byte DCMPL = (byte)151;
501 /**
502 * compare if the second last double value on the stack is greater than the
503 * last one
504 **/
505 public static final byte DCMPG = (byte)152;
506 /**
507 * return an int, byte or short value
508 **/
509 public static final byte IRETURN = (byte)172;
510 /**
511 * return a long value
512 **/
513 public static final byte LRETURN = (byte)173;
514 /**
515 * return a float value
516 **/
517 public static final byte FRETURN = (byte)174;
518 /**
519 * return a double value
520 **/
521 public static final byte DRETURN = (byte)175;
522 /**
523 * return an object
524 **/
525 public static final byte ARETURN = (byte)176;
526 /**
527 * return void
528 **/
529 public static final byte RETURN = (byte)177;
530 /**
531 * Evaluates the length of an array
532 **/
533 public static final byte ARRAYLENGTH = (byte)190;
534 /**
535 * throw an exceptions
536 **/
537 public static final byte ATHROW = (byte)191;
538 /**
539 * enters a synchronized area
540 **/
541 public static final byte MONITORENTER = (byte)194;
542 /**
543 * ends a synchronized area
544 **/
545 public static final byte MONITOREXIT = (byte)195;
546 /**
547 * reads a wide value
548 **/
549 public static final byte WIDE = (byte)196;
550
551 //reserved opcodes
552 /**
553 * a breakpoint
554 **/
555 public static final byte BREAKPOINT = (byte)202;
556 /**
557 * impdep1
558 **/
559 public static final byte IMPDEP1 = (byte)254;
560 /**
561 * impdep2
562 **/
563 public static final byte IMPDEP2 = (byte)255;
564
565 /**
566 * Creates an UnaryInstruction and initializes it from a
567 * DataInputStream
568 * @param the opcode of the command
569 **/
570 public UnaryInstruction(byte command) {
571 super(command);
572 }
573
574 /**
575 * @return the number of bytes used in this command
576 **/
577 public final int getNumberOfUsedBytes() {
578 return 1;
579 }
580 }