1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 using System;
6 
7 namespace Internal.IL
8 {
9     /// <summary>
10     /// An enumeration of all of the operation codes that are used in the CLI Common Intermediate Language.
11     /// </summary>
12     public enum ILOpcode
13     {
14         nop = 0x00,
15         break_ = 0x01,
16         ldarg_0 = 0x02,
17         ldarg_1 = 0x03,
18         ldarg_2 = 0x04,
19         ldarg_3 = 0x05,
20         ldloc_0 = 0x06,
21         ldloc_1 = 0x07,
22         ldloc_2 = 0x08,
23         ldloc_3 = 0x09,
24         stloc_0 = 0x0a,
25         stloc_1 = 0x0b,
26         stloc_2 = 0x0c,
27         stloc_3 = 0x0d,
28         ldarg_s = 0x0e,
29         ldarga_s = 0x0f,
30         starg_s = 0x10,
31         ldloc_s = 0x11,
32         ldloca_s = 0x12,
33         stloc_s = 0x13,
34         ldnull = 0x14,
35         ldc_i4_m1 = 0x15,
36         ldc_i4_0 = 0x16,
37         ldc_i4_1 = 0x17,
38         ldc_i4_2 = 0x18,
39         ldc_i4_3 = 0x19,
40         ldc_i4_4 = 0x1a,
41         ldc_i4_5 = 0x1b,
42         ldc_i4_6 = 0x1c,
43         ldc_i4_7 = 0x1d,
44         ldc_i4_8 = 0x1e,
45         ldc_i4_s = 0x1f,
46         ldc_i4 = 0x20,
47         ldc_i8 = 0x21,
48         ldc_r4 = 0x22,
49         ldc_r8 = 0x23,
50         dup = 0x25,
51         pop = 0x26,
52         jmp = 0x27,
53         call = 0x28,
54         calli = 0x29,
55         ret = 0x2a,
56         br_s = 0x2b,
57         brfalse_s = 0x2c,
58         brtrue_s = 0x2d,
59         beq_s = 0x2e,
60         bge_s = 0x2f,
61         bgt_s = 0x30,
62         ble_s = 0x31,
63         blt_s = 0x32,
64         bne_un_s = 0x33,
65         bge_un_s = 0x34,
66         bgt_un_s = 0x35,
67         ble_un_s = 0x36,
68         blt_un_s = 0x37,
69         br = 0x38,
70         brfalse = 0x39,
71         brtrue = 0x3a,
72         beq = 0x3b,
73         bge = 0x3c,
74         bgt = 0x3d,
75         ble = 0x3e,
76         blt = 0x3f,
77         bne_un = 0x40,
78         bge_un = 0x41,
79         bgt_un = 0x42,
80         ble_un = 0x43,
81         blt_un = 0x44,
82         switch_ = 0x45,
83         ldind_i1 = 0x46,
84         ldind_u1 = 0x47,
85         ldind_i2 = 0x48,
86         ldind_u2 = 0x49,
87         ldind_i4 = 0x4a,
88         ldind_u4 = 0x4b,
89         ldind_i8 = 0x4c,
90         ldind_i = 0x4d,
91         ldind_r4 = 0x4e,
92         ldind_r8 = 0x4f,
93         ldind_ref = 0x50,
94         stind_ref = 0x51,
95         stind_i1 = 0x52,
96         stind_i2 = 0x53,
97         stind_i4 = 0x54,
98         stind_i8 = 0x55,
99         stind_r4 = 0x56,
100         stind_r8 = 0x57,
101         add = 0x58,
102         sub = 0x59,
103         mul = 0x5a,
104         div = 0x5b,
105         div_un = 0x5c,
106         rem = 0x5d,
107         rem_un = 0x5e,
108         and = 0x5f,
109         or = 0x60,
110         xor = 0x61,
111         shl = 0x62,
112         shr = 0x63,
113         shr_un = 0x64,
114         neg = 0x65,
115         not = 0x66,
116         conv_i1 = 0x67,
117         conv_i2 = 0x68,
118         conv_i4 = 0x69,
119         conv_i8 = 0x6a,
120         conv_r4 = 0x6b,
121         conv_r8 = 0x6c,
122         conv_u4 = 0x6d,
123         conv_u8 = 0x6e,
124         callvirt = 0x6f,
125         cpobj = 0x70,
126         ldobj = 0x71,
127         ldstr = 0x72,
128         newobj = 0x73,
129         castclass = 0x74,
130         isinst = 0x75,
131         conv_r_un = 0x76,
132         unbox = 0x79,
133         throw_ = 0x7a,
134         ldfld = 0x7b,
135         ldflda = 0x7c,
136         stfld = 0x7d,
137         ldsfld = 0x7e,
138         ldsflda = 0x7f,
139         stsfld = 0x80,
140         stobj = 0x81,
141         conv_ovf_i1_un = 0x82,
142         conv_ovf_i2_un = 0x83,
143         conv_ovf_i4_un = 0x84,
144         conv_ovf_i8_un = 0x85,
145         conv_ovf_u1_un = 0x86,
146         conv_ovf_u2_un = 0x87,
147         conv_ovf_u4_un = 0x88,
148         conv_ovf_u8_un = 0x89,
149         conv_ovf_i_un = 0x8a,
150         conv_ovf_u_un = 0x8b,
151         box = 0x8c,
152         newarr = 0x8d,
153         ldlen = 0x8e,
154         ldelema = 0x8f,
155         ldelem_i1 = 0x90,
156         ldelem_u1 = 0x91,
157         ldelem_i2 = 0x92,
158         ldelem_u2 = 0x93,
159         ldelem_i4 = 0x94,
160         ldelem_u4 = 0x95,
161         ldelem_i8 = 0x96,
162         ldelem_i = 0x97,
163         ldelem_r4 = 0x98,
164         ldelem_r8 = 0x99,
165         ldelem_ref = 0x9a,
166         stelem_i = 0x9b,
167         stelem_i1 = 0x9c,
168         stelem_i2 = 0x9d,
169         stelem_i4 = 0x9e,
170         stelem_i8 = 0x9f,
171         stelem_r4 = 0xa0,
172         stelem_r8 = 0xa1,
173         stelem_ref = 0xa2,
174         ldelem = 0xa3,
175         stelem = 0xa4,
176         unbox_any = 0xa5,
177         conv_ovf_i1 = 0xb3,
178         conv_ovf_u1 = 0xb4,
179         conv_ovf_i2 = 0xb5,
180         conv_ovf_u2 = 0xb6,
181         conv_ovf_i4 = 0xb7,
182         conv_ovf_u4 = 0xb8,
183         conv_ovf_i8 = 0xb9,
184         conv_ovf_u8 = 0xba,
185         refanyval = 0xc2,
186         ckfinite = 0xc3,
187         mkrefany = 0xc6,
188         ldtoken = 0xd0,
189         conv_u2 = 0xd1,
190         conv_u1 = 0xd2,
191         conv_i = 0xd3,
192         conv_ovf_i = 0xd4,
193         conv_ovf_u = 0xd5,
194         add_ovf = 0xd6,
195         add_ovf_un = 0xd7,
196         mul_ovf = 0xd8,
197         mul_ovf_un = 0xd9,
198         sub_ovf = 0xda,
199         sub_ovf_un = 0xdb,
200         endfinally = 0xdc,
201         leave = 0xdd,
202         leave_s = 0xde,
203         stind_i = 0xdf,
204         conv_u = 0xe0,
205         prefix1 = 0xfe,
206         arglist = 0x100,
207         ceq = 0x101,
208         cgt = 0x102,
209         cgt_un = 0x103,
210         clt = 0x104,
211         clt_un = 0x105,
212         ldftn = 0x106,
213         ldvirtftn = 0x107,
214         ldarg = 0x109,
215         ldarga = 0x10a,
216         starg = 0x10b,
217         ldloc = 0x10c,
218         ldloca = 0x10d,
219         stloc = 0x10e,
220         localloc = 0x10f,
221         endfilter = 0x111,
222         unaligned = 0x112,
223         volatile_ = 0x113,
224         tail = 0x114,
225         initobj = 0x115,
226         constrained = 0x116,
227         cpblk = 0x117,
228         initblk = 0x118,
229         no = 0x119,
230         rethrow = 0x11a,
231         sizeof_ = 0x11c,
232         refanytype = 0x11d,
233         readonly_ = 0x11e,
234     }
235 }
236