-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOPCodes.h
240 lines (233 loc) · 5.23 KB
/
OPCodes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/**
* Copyright 2010 by Benjamin J. Land (a.k.a. BenLand100)
*
* This file is part of SJVM the Simple Java Virtual Machine.
*
* SJVM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* SJVM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with SJVM. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* File: OPCodes.h
* Author: Benjamin J. Land
*
* Created on November 27, 2008, 1:57 PM
*/
#ifndef _OPCODES_H
#define _OPCODES_H
#define nop 0x00
#define aconst_null 0x01
#define iconst_m1 0x02
#define iconst_0 0x03
#define iconst_1 0x04
#define iconst_2 0x05
#define iconst_3 0x06
#define iconst_4 0x07
#define iconst_5 0x08
#define lconst_0 0x09
#define lconst_1 0x0a
#define fconst_0 0x0b
#define fconst_1 0x0c
#define fconst_2 0x0d
#define dconst_0 0x0e
#define dconst_1 0x0f
#define bipush 0x10
#define sipush 0x11
#define ldc 0x12
#define ldc_w 0x13
#define ldc2_w 0x14
#define iload 0x15
#define lload 0x16
#define fload 0x17
#define dload 0x18
#define aload 0x19
#define iload_0 0x1a
#define iload_1 0x1b
#define iload_2 0x1c
#define iload_3 0x1d
#define lload_0 0x1e
#define lload_1 0x1f
#define lload_2 0x20
#define lload_3 0x21
#define fload_0 0x22
#define fload_1 0x23
#define fload_2 0x24
#define fload_3 0x25
#define dload_0 0x26
#define dload_1 0x27
#define dload_2 0x28
#define dload_3 0x29
#define aload_0 0x2a
#define aload_1 0x2b
#define aload_2 0x2c
#define aload_3 0x2d
#define iaload 0x2e
#define laload 0x2f
#define faload 0x30
#define daload 0x31
#define aaload 0x32
#define baload 0x33
#define caload 0x34
#define saload 0x35
#define istore 0x36
#define lstore 0x37
#define fstore 0x38
#define dstore 0x39
#define astore 0x3a
#define istore_0 0x3b
#define istore_1 0x3c
#define istore_2 0x3d
#define istore_3 0x3e
#define lstore_0 0x3f
#define lstore_1 0x40
#define lstore_2 0x41
#define lstore_3 0x42
#define fstore_0 0x43
#define fstore_1 0x44
#define fstore_2 0x45
#define fstore_3 0x46
#define dstore_0 0x47
#define dstore_1 0x48
#define dstore_2 0x49
#define dstore_3 0x4a
#define astore_0 0x4b
#define astore_1 0x4c
#define astore_2 0x4d
#define astore_3 0x4e
#define iastore 0x4f
#define lastore 0x50
#define fastore 0x51
#define dastore 0x52
#define aastore 0x53
#define bastore 0x54
#define castore 0x55
#define sastore 0x56
#define pop 0x57
#define pop2 0x58
#define dup 0x59
#define dup_x1 0x5a
#define dup_x2 0x5b
#define dup2 0x5c
#define dup2_x1 0x5d
#define dup2_x2 0x5e
#define swap 0x5f
#define iadd 0x60
#define ladd 0x61
#define fadd 0x62
#define dadd 0x63
#define isub 0x64
#define lsub 0x65
#define fsub 0x66
#define dsub 0x67
#define imul 0x68
#define lmul 0x69
#define fmul 0x6a
#define dmul 0x6b
#define idiv 0x6c
#define ldiv 0x6d
#define fdiv 0x6e
#define ddiv 0x6f
#define irem 0x70
#define lrem 0x71
#define frem 0x72
#define drem 0x73
#define ineg 0x74
#define lneg 0x75
#define fneg 0x76
#define dneg 0x77
#define ishl 0x78
#define lshl 0x79
#define ishr 0x7a
#define lshr 0x7b
#define iushr 0x7c
#define lushr 0x7d
#define iand 0x7e
#define land 0x7f
#define ior 0x80
#define lor 0x81
#define ixor 0x82
#define lxor 0x83
#define iinc 0x84
#define i2l 0x85
#define i2f 0x86
#define i2d 0x87
#define l2i 0x88
#define l2f 0x89
#define l2d 0x8a
#define f2i 0x8b
#define f2l 0x8c
#define f2d 0x8d
#define d2i 0x8e
#define d2l 0x8f
#define d2f 0x90
#define i2b 0x91
#define i2c 0x92
#define i2s 0x93
#define lcmp 0x94
#define fcmpl 0x95
#define fcmpg 0x96
#define dcmpl 0x97
#define dcmpg 0x98
#define ifeq 0x99
#define ifne 0x9a
#define iflt 0x9b
#define ifge 0x9c
#define ifgt 0x9d
#define ifle 0x9e
#define if_icmpeq 0x9f
#define if_icmpne 0xa0
#define if_icmplt 0xa1
#define if_icmpge 0xa2
#define if_icmpgt 0xa3
#define if_icmple 0xa4
#define if_acmpeq 0xa5
#define if_acmpne 0xa6
#define jump 0xa7
#define jsr 0xa8
#define ret 0xa9
#define tableswitch 0xaa
#define lookupswitch 0xab
#define ireturn 0xac
#define lreturn 0xad
#define freturn 0xae
#define dreturn 0xaf
#define areturn 0xb0
#define vreturn 0xb1
#define getstatic 0xb2
#define putstatic 0xb3
#define getfield 0xb4
#define putfield 0xb5
#define invokevirtual 0xb6
#define invokespecial 0xb7
#define invokestatic 0xb8
#define invokeinterface 0xb9
#define xxxunusedxxx 0xba
#define newobj 0xbb
#define newarray 0xbc
#define anewarray 0xbd
#define arraylength 0xbe
#define athrow 0xbf
#define checkcast 0xc0
#define instanceof 0xc1
#define monitorenter 0xc2
#define monitorexit 0xc3
#define wide 0xc4
#define multianewarray 0xc5
#define ifnull 0xc6
#define ifnonnull 0xc7
#define jump_w 0xc8
#define jsr_w 0xc9
//Reserved opcodes:
#define breakpoint 0xca
#define impdep1 0xfe
#define impdep2 0xff
#endif /* _OPCODES_H */