Home | History | Annotate | Download | only in code
      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 
     17 package com.android.dexgen.dex.code;
     18 
     19 /**
     20  * All the Dalvik opcode value constants. See the related spec
     21  * document for the meaning and instruction format of each opcode.
     22  */
     23 public final class DalvOps {
     24     /** pseudo-opcode used for nonstandard format "instructions" */
     25     public static final int SPECIAL_FORMAT = -1;
     26 
     27     /** minimum valid opcode value */
     28     public static final int MIN_VALUE = -1;
     29 
     30     /** maximum valid opcode value */
     31     public static final int MAX_VALUE = 0xff;
     32 
     33     // BEGIN(opcodes); GENERATED AUTOMATICALLY BY opcode-gen
     34     public static final int NOP = 0x00;
     35     public static final int MOVE = 0x01;
     36     public static final int MOVE_FROM16 = 0x02;
     37     public static final int MOVE_16 = 0x03;
     38     public static final int MOVE_WIDE = 0x04;
     39     public static final int MOVE_WIDE_FROM16 = 0x05;
     40     public static final int MOVE_WIDE_16 = 0x06;
     41     public static final int MOVE_OBJECT = 0x07;
     42     public static final int MOVE_OBJECT_FROM16 = 0x08;
     43     public static final int MOVE_OBJECT_16 = 0x09;
     44     public static final int MOVE_RESULT = 0x0a;
     45     public static final int MOVE_RESULT_WIDE = 0x0b;
     46     public static final int MOVE_RESULT_OBJECT = 0x0c;
     47     public static final int MOVE_EXCEPTION = 0x0d;
     48     public static final int RETURN_VOID = 0x0e;
     49     public static final int RETURN = 0x0f;
     50     public static final int RETURN_WIDE = 0x10;
     51     public static final int RETURN_OBJECT = 0x11;
     52     public static final int CONST_4 = 0x12;
     53     public static final int CONST_16 = 0x13;
     54     public static final int CONST = 0x14;
     55     public static final int CONST_HIGH16 = 0x15;
     56     public static final int CONST_WIDE_16 = 0x16;
     57     public static final int CONST_WIDE_32 = 0x17;
     58     public static final int CONST_WIDE = 0x18;
     59     public static final int CONST_WIDE_HIGH16 = 0x19;
     60     public static final int CONST_STRING = 0x1a;
     61     public static final int CONST_STRING_JUMBO = 0x1b;
     62     public static final int CONST_CLASS = 0x1c;
     63     public static final int MONITOR_ENTER = 0x1d;
     64     public static final int MONITOR_EXIT = 0x1e;
     65     public static final int CHECK_CAST = 0x1f;
     66     public static final int INSTANCE_OF = 0x20;
     67     public static final int ARRAY_LENGTH = 0x21;
     68     public static final int NEW_INSTANCE = 0x22;
     69     public static final int NEW_ARRAY = 0x23;
     70     public static final int FILLED_NEW_ARRAY = 0x24;
     71     public static final int FILLED_NEW_ARRAY_RANGE = 0x25;
     72     public static final int FILL_ARRAY_DATA = 0x26;
     73     public static final int THROW = 0x27;
     74     public static final int GOTO = 0x28;
     75     public static final int GOTO_16 = 0x29;
     76     public static final int GOTO_32 = 0x2a;
     77     public static final int PACKED_SWITCH = 0x2b;
     78     public static final int SPARSE_SWITCH = 0x2c;
     79     public static final int CMPL_FLOAT = 0x2d;
     80     public static final int CMPG_FLOAT = 0x2e;
     81     public static final int CMPL_DOUBLE = 0x2f;
     82     public static final int CMPG_DOUBLE = 0x30;
     83     public static final int CMP_LONG = 0x31;
     84     public static final int IF_EQ = 0x32;
     85     public static final int IF_NE = 0x33;
     86     public static final int IF_LT = 0x34;
     87     public static final int IF_GE = 0x35;
     88     public static final int IF_GT = 0x36;
     89     public static final int IF_LE = 0x37;
     90     public static final int IF_EQZ = 0x38;
     91     public static final int IF_NEZ = 0x39;
     92     public static final int IF_LTZ = 0x3a;
     93     public static final int IF_GEZ = 0x3b;
     94     public static final int IF_GTZ = 0x3c;
     95     public static final int IF_LEZ = 0x3d;
     96     public static final int UNUSED_3E = 0x3e;
     97     public static final int UNUSED_3F = 0x3f;
     98     public static final int UNUSED_40 = 0x40;
     99     public static final int UNUSED_41 = 0x41;
    100     public static final int UNUSED_42 = 0x42;
    101     public static final int UNUSED_43 = 0x43;
    102     public static final int AGET = 0x44;
    103     public static final int AGET_WIDE = 0x45;
    104     public static final int AGET_OBJECT = 0x46;
    105     public static final int AGET_BOOLEAN = 0x47;
    106     public static final int AGET_BYTE = 0x48;
    107     public static final int AGET_CHAR = 0x49;
    108     public static final int AGET_SHORT = 0x4a;
    109     public static final int APUT = 0x4b;
    110     public static final int APUT_WIDE = 0x4c;
    111     public static final int APUT_OBJECT = 0x4d;
    112     public static final int APUT_BOOLEAN = 0x4e;
    113     public static final int APUT_BYTE = 0x4f;
    114     public static final int APUT_CHAR = 0x50;
    115     public static final int APUT_SHORT = 0x51;
    116     public static final int IGET = 0x52;
    117     public static final int IGET_WIDE = 0x53;
    118     public static final int IGET_OBJECT = 0x54;
    119     public static final int IGET_BOOLEAN = 0x55;
    120     public static final int IGET_BYTE = 0x56;
    121     public static final int IGET_CHAR = 0x57;
    122     public static final int IGET_SHORT = 0x58;
    123     public static final int IPUT = 0x59;
    124     public static final int IPUT_WIDE = 0x5a;
    125     public static final int IPUT_OBJECT = 0x5b;
    126     public static final int IPUT_BOOLEAN = 0x5c;
    127     public static final int IPUT_BYTE = 0x5d;
    128     public static final int IPUT_CHAR = 0x5e;
    129     public static final int IPUT_SHORT = 0x5f;
    130     public static final int SGET = 0x60;
    131     public static final int SGET_WIDE = 0x61;
    132     public static final int SGET_OBJECT = 0x62;
    133     public static final int SGET_BOOLEAN = 0x63;
    134     public static final int SGET_BYTE = 0x64;
    135     public static final int SGET_CHAR = 0x65;
    136     public static final int SGET_SHORT = 0x66;
    137     public static final int SPUT = 0x67;
    138     public static final int SPUT_WIDE = 0x68;
    139     public static final int SPUT_OBJECT = 0x69;
    140     public static final int SPUT_BOOLEAN = 0x6a;
    141     public static final int SPUT_BYTE = 0x6b;
    142     public static final int SPUT_CHAR = 0x6c;
    143     public static final int SPUT_SHORT = 0x6d;
    144     public static final int INVOKE_VIRTUAL = 0x6e;
    145     public static final int INVOKE_SUPER = 0x6f;
    146     public static final int INVOKE_DIRECT = 0x70;
    147     public static final int INVOKE_STATIC = 0x71;
    148     public static final int INVOKE_INTERFACE = 0x72;
    149     public static final int UNUSED_73 = 0x73;
    150     public static final int INVOKE_VIRTUAL_RANGE = 0x74;
    151     public static final int INVOKE_SUPER_RANGE = 0x75;
    152     public static final int INVOKE_DIRECT_RANGE = 0x76;
    153     public static final int INVOKE_STATIC_RANGE = 0x77;
    154     public static final int INVOKE_INTERFACE_RANGE = 0x78;
    155     public static final int UNUSED_79 = 0x79;
    156     public static final int UNUSED_7A = 0x7a;
    157     public static final int NEG_INT = 0x7b;
    158     public static final int NOT_INT = 0x7c;
    159     public static final int NEG_LONG = 0x7d;
    160     public static final int NOT_LONG = 0x7e;
    161     public static final int NEG_FLOAT = 0x7f;
    162     public static final int NEG_DOUBLE = 0x80;
    163     public static final int INT_TO_LONG = 0x81;
    164     public static final int INT_TO_FLOAT = 0x82;
    165     public static final int INT_TO_DOUBLE = 0x83;
    166     public static final int LONG_TO_INT = 0x84;
    167     public static final int LONG_TO_FLOAT = 0x85;
    168     public static final int LONG_TO_DOUBLE = 0x86;
    169     public static final int FLOAT_TO_INT = 0x87;
    170     public static final int FLOAT_TO_LONG = 0x88;
    171     public static final int FLOAT_TO_DOUBLE = 0x89;
    172     public static final int DOUBLE_TO_INT = 0x8a;
    173     public static final int DOUBLE_TO_LONG = 0x8b;
    174     public static final int DOUBLE_TO_FLOAT = 0x8c;
    175     public static final int INT_TO_BYTE = 0x8d;
    176     public static final int INT_TO_CHAR = 0x8e;
    177     public static final int INT_TO_SHORT = 0x8f;
    178     public static final int ADD_INT = 0x90;
    179     public static final int SUB_INT = 0x91;
    180     public static final int MUL_INT = 0x92;
    181     public static final int DIV_INT = 0x93;
    182     public static final int REM_INT = 0x94;
    183     public static final int AND_INT = 0x95;
    184     public static final int OR_INT = 0x96;
    185     public static final int XOR_INT = 0x97;
    186     public static final int SHL_INT = 0x98;
    187     public static final int SHR_INT = 0x99;
    188     public static final int USHR_INT = 0x9a;
    189     public static final int ADD_LONG = 0x9b;
    190     public static final int SUB_LONG = 0x9c;
    191     public static final int MUL_LONG = 0x9d;
    192     public static final int DIV_LONG = 0x9e;
    193     public static final int REM_LONG = 0x9f;
    194     public static final int AND_LONG = 0xa0;
    195     public static final int OR_LONG = 0xa1;
    196     public static final int XOR_LONG = 0xa2;
    197     public static final int SHL_LONG = 0xa3;
    198     public static final int SHR_LONG = 0xa4;
    199     public static final int USHR_LONG = 0xa5;
    200     public static final int ADD_FLOAT = 0xa6;
    201     public static final int SUB_FLOAT = 0xa7;
    202     public static final int MUL_FLOAT = 0xa8;
    203     public static final int DIV_FLOAT = 0xa9;
    204     public static final int REM_FLOAT = 0xaa;
    205     public static final int ADD_DOUBLE = 0xab;
    206     public static final int SUB_DOUBLE = 0xac;
    207     public static final int MUL_DOUBLE = 0xad;
    208     public static final int DIV_DOUBLE = 0xae;
    209     public static final int REM_DOUBLE = 0xaf;
    210     public static final int ADD_INT_2ADDR = 0xb0;
    211     public static final int SUB_INT_2ADDR = 0xb1;
    212     public static final int MUL_INT_2ADDR = 0xb2;
    213     public static final int DIV_INT_2ADDR = 0xb3;
    214     public static final int REM_INT_2ADDR = 0xb4;
    215     public static final int AND_INT_2ADDR = 0xb5;
    216     public static final int OR_INT_2ADDR = 0xb6;
    217     public static final int XOR_INT_2ADDR = 0xb7;
    218     public static final int SHL_INT_2ADDR = 0xb8;
    219     public static final int SHR_INT_2ADDR = 0xb9;
    220     public static final int USHR_INT_2ADDR = 0xba;
    221     public static final int ADD_LONG_2ADDR = 0xbb;
    222     public static final int SUB_LONG_2ADDR = 0xbc;
    223     public static final int MUL_LONG_2ADDR = 0xbd;
    224     public static final int DIV_LONG_2ADDR = 0xbe;
    225     public static final int REM_LONG_2ADDR = 0xbf;
    226     public static final int AND_LONG_2ADDR = 0xc0;
    227     public static final int OR_LONG_2ADDR = 0xc1;
    228     public static final int XOR_LONG_2ADDR = 0xc2;
    229     public static final int SHL_LONG_2ADDR = 0xc3;
    230     public static final int SHR_LONG_2ADDR = 0xc4;
    231     public static final int USHR_LONG_2ADDR = 0xc5;
    232     public static final int ADD_FLOAT_2ADDR = 0xc6;
    233     public static final int SUB_FLOAT_2ADDR = 0xc7;
    234     public static final int MUL_FLOAT_2ADDR = 0xc8;
    235     public static final int DIV_FLOAT_2ADDR = 0xc9;
    236     public static final int REM_FLOAT_2ADDR = 0xca;
    237     public static final int ADD_DOUBLE_2ADDR = 0xcb;
    238     public static final int SUB_DOUBLE_2ADDR = 0xcc;
    239     public static final int MUL_DOUBLE_2ADDR = 0xcd;
    240     public static final int DIV_DOUBLE_2ADDR = 0xce;
    241     public static final int REM_DOUBLE_2ADDR = 0xcf;
    242     public static final int ADD_INT_LIT16 = 0xd0;
    243     public static final int RSUB_INT = 0xd1;
    244     public static final int MUL_INT_LIT16 = 0xd2;
    245     public static final int DIV_INT_LIT16 = 0xd3;
    246     public static final int REM_INT_LIT16 = 0xd4;
    247     public static final int AND_INT_LIT16 = 0xd5;
    248     public static final int OR_INT_LIT16 = 0xd6;
    249     public static final int XOR_INT_LIT16 = 0xd7;
    250     public static final int ADD_INT_LIT8 = 0xd8;
    251     public static final int RSUB_INT_LIT8 = 0xd9;
    252     public static final int MUL_INT_LIT8 = 0xda;
    253     public static final int DIV_INT_LIT8 = 0xdb;
    254     public static final int REM_INT_LIT8 = 0xdc;
    255     public static final int AND_INT_LIT8 = 0xdd;
    256     public static final int OR_INT_LIT8 = 0xde;
    257     public static final int XOR_INT_LIT8 = 0xdf;
    258     public static final int SHL_INT_LIT8 = 0xe0;
    259     public static final int SHR_INT_LIT8 = 0xe1;
    260     public static final int USHR_INT_LIT8 = 0xe2;
    261     public static final int UNUSED_E3 = 0xe3;
    262     public static final int UNUSED_E4 = 0xe4;
    263     public static final int UNUSED_E5 = 0xe5;
    264     public static final int UNUSED_E6 = 0xe6;
    265     public static final int UNUSED_E7 = 0xe7;
    266     public static final int UNUSED_E8 = 0xe8;
    267     public static final int UNUSED_E9 = 0xe9;
    268     public static final int UNUSED_EA = 0xea;
    269     public static final int UNUSED_EB = 0xeb;
    270     public static final int UNUSED_EC = 0xec;
    271     public static final int UNUSED_ED = 0xed;
    272     public static final int UNUSED_EE = 0xee;
    273     public static final int UNUSED_EF = 0xef;
    274     public static final int UNUSED_F0 = 0xf0;
    275     public static final int UNUSED_F1 = 0xf1;
    276     public static final int UNUSED_F2 = 0xf2;
    277     public static final int UNUSED_F3 = 0xf3;
    278     public static final int UNUSED_F4 = 0xf4;
    279     public static final int UNUSED_F5 = 0xf5;
    280     public static final int UNUSED_F6 = 0xf6;
    281     public static final int UNUSED_F7 = 0xf7;
    282     public static final int UNUSED_F8 = 0xf8;
    283     public static final int UNUSED_F9 = 0xf9;
    284     public static final int UNUSED_FA = 0xfa;
    285     public static final int UNUSED_FB = 0xfb;
    286     public static final int UNUSED_FC = 0xfc;
    287     public static final int UNUSED_FD = 0xfd;
    288     public static final int UNUSED_FE = 0xfe;
    289     public static final int UNUSED_FF = 0xff;
    290     // END(opcodes)
    291 
    292     /**
    293      * This class is uninstantiable.
    294      */
    295     private DalvOps() {
    296         // This space intentionally left blank.
    297     }
    298 }
    299