1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package dalvik.bytecode;
18
19/**
20 * This is a list of Dalvik opcodes.
21 *
22 * (This was converted from //device/dalvik/libdex/OpCode.h)
23 */
24public interface Opcodes {
25    int OP_NOP                          = 0x00;
26
27    int OP_MOVE                         = 0x01;
28    int OP_MOVE_FROM16                  = 0x02;
29    int OP_MOVE_16                      = 0x03;
30    int OP_MOVE_WIDE                    = 0x04;
31    int OP_MOVE_WIDE_FROM16             = 0x05;
32    int OP_MOVE_WIDE_16                 = 0x06;
33    int OP_MOVE_OBJECT                  = 0x07;
34    int OP_MOVE_OBJECT_FROM16           = 0x08;
35    int OP_MOVE_OBJECT_16               = 0x09;
36
37    int OP_MOVE_RESULT                  = 0x0a;
38    int OP_MOVE_RESULT_WIDE             = 0x0b;
39    int OP_MOVE_RESULT_OBJECT           = 0x0c;
40    int OP_MOVE_EXCEPTION               = 0x0d;
41
42    int OP_RETURN_VOID                  = 0x0e;
43    int OP_RETURN                       = 0x0f;
44    int OP_RETURN_WIDE                  = 0x10;
45    int OP_RETURN_OBJECT                = 0x11;
46
47    int OP_CONST_4                      = 0x12;
48    int OP_CONST_16                     = 0x13;
49    int OP_CONST                        = 0x14;
50    int OP_CONST_HIGH16                 = 0x15;
51    int OP_CONST_WIDE_16                = 0x16;
52    int OP_CONST_WIDE_32                = 0x17;
53    int OP_CONST_WIDE                   = 0x18;
54    int OP_CONST_WIDE_HIGH16            = 0x19;
55    int OP_CONST_STRING                 = 0x1a;
56    int OP_CONST_STRING_JUMBO           = 0x1b;
57    int OP_CONST_CLASS                  = 0x1c;
58
59    int OP_MONITOR_ENTER                = 0x1d;
60    int OP_MONITOR_EXIT                 = 0x1e;
61
62    int OP_CHECK_CAST                   = 0x1f;
63    int OP_INSTANCE_OF                  = 0x20;
64
65    int OP_ARRAY_LENGTH                 = 0x21;
66
67    int OP_NEW_INSTANCE                 = 0x22;
68    int OP_NEW_ARRAY                    = 0x23;
69
70    int OP_FILLED_NEW_ARRAY             = 0x24;
71    int OP_FILLED_NEW_ARRAY_RANGE       = 0x25;
72    int OP_FILL_ARRAY_DATA              = 0x26;
73
74    int OP_THROW                        = 0x27;
75    int OP_GOTO                         = 0x28;
76    int OP_GOTO_16                      = 0x29;
77    int OP_GOTO_32                      = 0x2a;
78    int OP_PACKED_SWITCH                = 0x2b;
79    int OP_SPARSE_SWITCH                = 0x2c;
80
81    int OP_CMPL_FLOAT                   = 0x2d;
82    int OP_CMPG_FLOAT                   = 0x2e;
83    int OP_CMPL_DOUBLE                  = 0x2f;
84    int OP_CMPG_DOUBLE                  = 0x30;
85    int OP_CMP_LONG                     = 0x31;
86
87    int OP_IF_EQ                        = 0x32;
88    int OP_IF_NE                        = 0x33;
89    int OP_IF_LT                        = 0x34;
90    int OP_IF_GE                        = 0x35;
91    int OP_IF_GT                        = 0x36;
92    int OP_IF_LE                        = 0x37;
93    int OP_IF_EQZ                       = 0x38;
94    int OP_IF_NEZ                       = 0x39;
95    int OP_IF_LTZ                       = 0x3a;
96    int OP_IF_GEZ                       = 0x3b;
97    int OP_IF_GTZ                       = 0x3c;
98    int OP_IF_LEZ                       = 0x3d;
99
100    /* 3e-43 unused */
101
102    int OP_AGET                         = 0x44;
103    int OP_AGET_WIDE                    = 0x45;
104    int OP_AGET_OBJECT                  = 0x46;
105    int OP_AGET_BOOLEAN                 = 0x47;
106    int OP_AGET_BYTE                    = 0x48;
107    int OP_AGET_CHAR                    = 0x49;
108    int OP_AGET_SHORT                   = 0x4a;
109    int OP_APUT                         = 0x4b;
110    int OP_APUT_WIDE                    = 0x4c;
111    int OP_APUT_OBJECT                  = 0x4d;
112    int OP_APUT_BOOLEAN                 = 0x4e;
113    int OP_APUT_BYTE                    = 0x4f;
114    int OP_APUT_CHAR                    = 0x50;
115    int OP_APUT_SHORT                   = 0x51;
116
117    int OP_IGET                         = 0x52;
118    int OP_IGET_WIDE                    = 0x53;
119    int OP_IGET_OBJECT                  = 0x54;
120    int OP_IGET_BOOLEAN                 = 0x55;
121    int OP_IGET_BYTE                    = 0x56;
122    int OP_IGET_CHAR                    = 0x57;
123    int OP_IGET_SHORT                   = 0x58;
124    int OP_IPUT                         = 0x59;
125    int OP_IPUT_WIDE                    = 0x5a;
126    int OP_IPUT_OBJECT                  = 0x5b;
127    int OP_IPUT_BOOLEAN                 = 0x5c;
128    int OP_IPUT_BYTE                    = 0x5d;
129    int OP_IPUT_CHAR                    = 0x5e;
130    int OP_IPUT_SHORT                   = 0x5f;
131
132    int OP_SGET                         = 0x60;
133    int OP_SGET_WIDE                    = 0x61;
134    int OP_SGET_OBJECT                  = 0x62;
135    int OP_SGET_BOOLEAN                 = 0x63;
136    int OP_SGET_BYTE                    = 0x64;
137    int OP_SGET_CHAR                    = 0x65;
138    int OP_SGET_SHORT                   = 0x66;
139    int OP_SPUT                         = 0x67;
140    int OP_SPUT_WIDE                    = 0x68;
141    int OP_SPUT_OBJECT                  = 0x69;
142    int OP_SPUT_BOOLEAN                 = 0x6a;
143    int OP_SPUT_BYTE                    = 0x6b;
144    int OP_SPUT_CHAR                    = 0x6c;
145    int OP_SPUT_SHORT                   = 0x6d;
146
147    int OP_INVOKE_VIRTUAL               = 0x6e;
148    int OP_INVOKE_SUPER                 = 0x6f;
149    int OP_INVOKE_DIRECT                = 0x70;
150    int OP_INVOKE_STATIC                = 0x71;
151    int OP_INVOKE_INTERFACE             = 0x72;
152
153    /* 73 unused */
154
155    int OP_INVOKE_VIRTUAL_RANGE         = 0x74;
156    int OP_INVOKE_SUPER_RANGE           = 0x75;
157    int OP_INVOKE_DIRECT_RANGE          = 0x76;
158    int OP_INVOKE_STATIC_RANGE          = 0x77;
159    int OP_INVOKE_INTERFACE_RANGE       = 0x78;
160
161    /* 79-7a unused */
162
163    int OP_NEG_INT                      = 0x7b;
164    int OP_NOT_INT                      = 0x7c;
165    int OP_NEG_LONG                     = 0x7d;
166    int OP_NOT_LONG                     = 0x7e;
167    int OP_NEG_FLOAT                    = 0x7f;
168    int OP_NEG_DOUBLE                   = 0x80;
169    int OP_INT_TO_LONG                  = 0x81;
170    int OP_INT_TO_FLOAT                 = 0x82;
171    int OP_INT_TO_DOUBLE                = 0x83;
172    int OP_LONG_TO_INT                  = 0x84;
173    int OP_LONG_TO_FLOAT                = 0x85;
174    int OP_LONG_TO_DOUBLE               = 0x86;
175    int OP_FLOAT_TO_INT                 = 0x87;
176    int OP_FLOAT_TO_LONG                = 0x88;
177    int OP_FLOAT_TO_DOUBLE              = 0x89;
178    int OP_DOUBLE_TO_INT                = 0x8a;
179    int OP_DOUBLE_TO_LONG               = 0x8b;
180    int OP_DOUBLE_TO_FLOAT              = 0x8c;
181    int OP_INT_TO_BYTE                  = 0x8d;
182    int OP_INT_TO_CHAR                  = 0x8e;
183    int OP_INT_TO_SHORT                 = 0x8f;
184
185    int OP_ADD_INT                      = 0x90;
186    int OP_SUB_INT                      = 0x91;
187    int OP_MUL_INT                      = 0x92;
188    int OP_DIV_INT                      = 0x93;
189    int OP_REM_INT                      = 0x94;
190    int OP_AND_INT                      = 0x95;
191    int OP_OR_INT                       = 0x96;
192    int OP_XOR_INT                      = 0x97;
193    int OP_SHL_INT                      = 0x98;
194    int OP_SHR_INT                      = 0x99;
195    int OP_USHR_INT                     = 0x9a;
196
197    int OP_ADD_LONG                     = 0x9b;
198    int OP_SUB_LONG                     = 0x9c;
199    int OP_MUL_LONG                     = 0x9d;
200    int OP_DIV_LONG                     = 0x9e;
201    int OP_REM_LONG                     = 0x9f;
202    int OP_AND_LONG                     = 0xa0;
203    int OP_OR_LONG                      = 0xa1;
204    int OP_XOR_LONG                     = 0xa2;
205    int OP_SHL_LONG                     = 0xa3;
206    int OP_SHR_LONG                     = 0xa4;
207    int OP_USHR_LONG                    = 0xa5;
208
209    int OP_ADD_FLOAT                    = 0xa6;
210    int OP_SUB_FLOAT                    = 0xa7;
211    int OP_MUL_FLOAT                    = 0xa8;
212    int OP_DIV_FLOAT                    = 0xa9;
213    int OP_REM_FLOAT                    = 0xaa;
214    int OP_ADD_DOUBLE                   = 0xab;
215    int OP_SUB_DOUBLE                   = 0xac;
216    int OP_MUL_DOUBLE                   = 0xad;
217    int OP_DIV_DOUBLE                   = 0xae;
218    int OP_REM_DOUBLE                   = 0xaf;
219
220    int OP_ADD_INT_2ADDR                = 0xb0;
221    int OP_SUB_INT_2ADDR                = 0xb1;
222    int OP_MUL_INT_2ADDR                = 0xb2;
223    int OP_DIV_INT_2ADDR                = 0xb3;
224    int OP_REM_INT_2ADDR                = 0xb4;
225    int OP_AND_INT_2ADDR                = 0xb5;
226    int OP_OR_INT_2ADDR                 = 0xb6;
227    int OP_XOR_INT_2ADDR                = 0xb7;
228    int OP_SHL_INT_2ADDR                = 0xb8;
229    int OP_SHR_INT_2ADDR                = 0xb9;
230    int OP_USHR_INT_2ADDR               = 0xba;
231
232    int OP_ADD_LONG_2ADDR               = 0xbb;
233    int OP_SUB_LONG_2ADDR               = 0xbc;
234    int OP_MUL_LONG_2ADDR               = 0xbd;
235    int OP_DIV_LONG_2ADDR               = 0xbe;
236    int OP_REM_LONG_2ADDR               = 0xbf;
237    int OP_AND_LONG_2ADDR               = 0xc0;
238    int OP_OR_LONG_2ADDR                = 0xc1;
239    int OP_XOR_LONG_2ADDR               = 0xc2;
240    int OP_SHL_LONG_2ADDR               = 0xc3;
241    int OP_SHR_LONG_2ADDR               = 0xc4;
242    int OP_USHR_LONG_2ADDR              = 0xc5;
243
244    int OP_ADD_FLOAT_2ADDR              = 0xc6;
245    int OP_SUB_FLOAT_2ADDR              = 0xc7;
246    int OP_MUL_FLOAT_2ADDR              = 0xc8;
247    int OP_DIV_FLOAT_2ADDR              = 0xc9;
248    int OP_REM_FLOAT_2ADDR              = 0xca;
249    int OP_ADD_DOUBLE_2ADDR             = 0xcb;
250    int OP_SUB_DOUBLE_2ADDR             = 0xcc;
251    int OP_MUL_DOUBLE_2ADDR             = 0xcd;
252    int OP_DIV_DOUBLE_2ADDR             = 0xce;
253    int OP_REM_DOUBLE_2ADDR             = 0xcf;
254
255    int OP_ADD_INT_LIT16                = 0xd0;
256    int OP_RSUB_INT                     = 0xd1; /* no _LIT16 suffix for this */
257    int OP_MUL_INT_LIT16                = 0xd2;
258    int OP_DIV_INT_LIT16                = 0xd3;
259    int OP_REM_INT_LIT16                = 0xd4;
260    int OP_AND_INT_LIT16                = 0xd5;
261    int OP_OR_INT_LIT16                 = 0xd6;
262    int OP_XOR_INT_LIT16                = 0xd7;
263
264    int OP_ADD_INT_LIT8                 = 0xd8;
265    int OP_RSUB_INT_LIT8                = 0xd9;
266    int OP_MUL_INT_LIT8                 = 0xda;
267    int OP_DIV_INT_LIT8                 = 0xdb;
268    int OP_REM_INT_LIT8                 = 0xdc;
269    int OP_AND_INT_LIT8                 = 0xdd;
270    int OP_OR_INT_LIT8                  = 0xde;
271    int OP_XOR_INT_LIT8                 = 0xdf;
272    int OP_SHL_INT_LIT8                 = 0xe0;
273    int OP_SHR_INT_LIT8                 = 0xe1;
274    int OP_USHR_INT_LIT8                = 0xe2;
275
276    /* e3-eb unused */
277
278    /*
279     * The rest of these are either generated by dexopt for optimized
280     * code, or inserted by the VM at runtime.  They are never generated
281     * by "dx".
282     */
283    int OP_BREAKPOINT                   = 0xec;
284    int OP_THROW_VERIFICATION_ERROR     = 0xed;
285
286    int OP_EXECUTE_INLINE               = 0xee;
287    int OP_EXECUTE_INLINE_RANGE         = 0xef;
288
289    int OP_INVOKE_DIRECT_EMPTY          = 0xf0;
290    /* f1 unused (OP_INVOKE_DIRECT_EMPTY_RANGE?) */
291    int OP_IGET_QUICK                   = 0xf2;
292    int OP_IGET_WIDE_QUICK              = 0xf3;
293    int OP_IGET_OBJECT_QUICK            = 0xf4;
294    int OP_IPUT_QUICK                   = 0xf5;
295    int OP_IPUT_WIDE_QUICK              = 0xf6;
296    int OP_IPUT_OBJECT_QUICK            = 0xf7;
297
298    int OP_INVOKE_VIRTUAL_QUICK         = 0xf8;
299    int OP_INVOKE_VIRTUAL_QUICK_RANGE   = 0xf9;
300    int OP_INVOKE_SUPER_QUICK           = 0xfa;
301    int OP_INVOKE_SUPER_QUICK_RANGE     = 0xfb;
302    /* fc unused (OP_INVOKE_DIRECT_QUICK?) */
303    /* fd unused (OP_INVOKE_DIRECT_QUICK_RANGE?) */
304    /* fe unused (OP_INVOKE_INTERFACE_QUICK?) */
305    /* ff unused (OP_INVOKE_INTERFACE_QUICK_RANGE?) */
306}
307
308