JAVAOPS.H 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /* javaops.h: Copyright (C) Codemist Ltd., 1996. */
  2. /* Java operators. */
  3. /* The operators below are taken from */
  4. /* "The Java Virtual Machine Specification" (dated Aug 21, 1995). */
  5. /* They are listed in section order, rather than numerical order, but */
  6. /* I note there are 203 of them: 0..202 and 209 with 186 unused. */
  7. /* section 3.2: pushing constants onto the stack */
  8. #define j_bipush 16
  9. #define j_sipush 17
  10. #define j_ldc1 18
  11. #define j_ldc2 19
  12. #define j_ldc2w 20
  13. #define j_aconst_null 1
  14. #define j_iconst_m1 2
  15. #define j_iconst_0 3
  16. #define j_iconst_1 4
  17. #define j_iconst_2 5
  18. #define j_iconst_3 6
  19. #define j_iconst_4 7
  20. #define j_iconst_5 8
  21. #define j_lconst_0 9
  22. #define j_lconst_1 10
  23. #define j_fconst_0 11
  24. #define j_fconst_1 12
  25. #define j_fconst_2 13
  26. #define j_dconst_0 14
  27. #define j_dconst_1 15
  28. /* section 3.3: loading locals onto the stack */
  29. #define j_iload 21
  30. #define j_iload_0 26
  31. #define j_iload_1 27
  32. #define j_iload_2 28
  33. #define j_iload_3 29
  34. #define j_lload 22
  35. #define j_lload_0 30
  36. #define j_lload_1 31
  37. #define j_lload_2 32
  38. #define j_lload_3 33
  39. #define j_fload 23
  40. #define j_fload_0 34
  41. #define j_fload_1 35
  42. #define j_fload_2 36
  43. #define j_fload_3 37
  44. #define j_dload 24
  45. #define j_dload_0 38
  46. #define j_dload_1 39
  47. #define j_dload_2 40
  48. #define j_dload_3 41
  49. #define j_aload 25
  50. #define j_aload_0 42
  51. #define j_aload_1 43
  52. #define j_aload_2 44
  53. #define j_aload_3 45
  54. /* section 3.4 storing stack values into locals */
  55. #define j_istore 54
  56. #define j_istore_0 59
  57. #define j_istore_1 60
  58. #define j_istore_2 61
  59. #define j_istore_3 62
  60. #define j_lstore 55
  61. #define j_lstore_0 63
  62. #define j_lstore_1 64
  63. #define j_lstore_2 65
  64. #define j_lstore_3 66
  65. #define j_fstore 56
  66. #define j_fstore_0 67
  67. #define j_fstore_1 68
  68. #define j_fstore_2 69
  69. #define j_fstore_3 70
  70. #define j_dstore 57
  71. #define j_dstore_0 71
  72. #define j_dstore_1 72
  73. #define j_dstore_2 73
  74. #define j_dstore_3 74
  75. #define j_astore 58
  76. #define j_astore_0 75
  77. #define j_astore_1 76
  78. #define j_astore_2 77
  79. #define j_astore_3 78
  80. #define j_iinc 132
  81. /* section 3.5: wider index for loading etc. */
  82. #define j_wide 196
  83. /* section 3.6: managing arrays */
  84. #define j_newarray 188
  85. #define j_anewarray 189
  86. #define j_multinewarray 197
  87. #define j_arraylength 190
  88. #define j_iaload 46
  89. #define j_laload 47
  90. #define j_faload 48
  91. #define j_daload 49
  92. #define j_aaload 50
  93. #define j_baload 51
  94. #define j_caload 52
  95. #define j_saload 53
  96. #define j_iastore 79
  97. #define j_lastore 80
  98. #define j_fastore 81
  99. #define j_dastore 82
  100. #define j_aastore 83
  101. #define j_bastore 84
  102. #define j_castore 85
  103. #define j_sastore 86
  104. /* 3.7 stack instructions */
  105. #define j_nop 0
  106. #define j_pop 87
  107. #define j_pop2 88
  108. #define j_dup 89
  109. #define j_dup2 92
  110. #define j_dup_x1 90
  111. #define j_dup2_x1 93
  112. #define j_dup_x2 91
  113. #define j_dup2_x2 94
  114. #define j_swap 95
  115. /* 3.8 arithmetic instructions */
  116. #define j_iadd 96
  117. #define j_ladd 97
  118. #define j_fadd 98
  119. #define j_dadd 99
  120. #define j_isub 100
  121. #define j_lsub 101
  122. #define j_fsub 102
  123. #define j_dsub 103
  124. #define j_imul 104
  125. #define j_lmul 105
  126. #define j_fmul 106
  127. #define j_dmul 107
  128. #define j_idiv 108
  129. #define j_ldiv 109
  130. #define j_fdiv 110
  131. #define j_ddiv 111
  132. #define j_irem 112
  133. #define j_lrem 113
  134. #define j_frem 114
  135. #define j_drem 115
  136. #define j_ineg 116
  137. #define j_lneg 117
  138. #define j_fneg 118
  139. #define j_dneg 119
  140. /* 3.9 logical instructions */
  141. #define j_ishl 120
  142. #define j_ishr 121
  143. #define j_iushr 122
  144. #define j_lshl 123
  145. #define j_lshr 124
  146. #define j_lushr 125
  147. #define j_iand 126
  148. #define j_land 127
  149. #define j_ior 128
  150. #define j_lor 129
  151. #define j_ixor 130
  152. #define j_lxor 131
  153. /* 3.10 conversion instructions */
  154. #define j_i2l 133
  155. #define j_i2f 134
  156. #define j_i2d 135
  157. #define j_l2i 136
  158. #define j_l2f 137
  159. #define j_l2d 138
  160. #define j_f2i 139
  161. #define j_f2l 140
  162. #define j_f2d 141
  163. #define j_d2i 142
  164. #define j_d2l 143
  165. #define j_d2f 144
  166. #define j_int2byte 145
  167. #define j_int2char 146
  168. #define j_int2short 147
  169. /* 3.11 control transfer instructions */
  170. #define j_ifeq 153
  171. #define j_ifnull 198
  172. #define j_iflt 155
  173. #define j_ifle 158
  174. #define j_ifne 154
  175. #define j_ifnonnull 199
  176. #define j_ifgt 157
  177. #define j_ifge 156
  178. #define j_if_icmpeq 159
  179. #define j_if_icmpne 160
  180. #define j_if_icmplt 161
  181. #define j_if_icmpgt 163
  182. #define j_if_icmple 164
  183. #define j_if_icmpge 162
  184. #define j_lcmp 148
  185. #define j_fcmpl 149
  186. #define j_fcmpg 150
  187. #define j_dcmpl 151
  188. #define j_dcmpg 152
  189. #define j_if_acmpeq 165
  190. #define j_if_acmpne 166
  191. #define j_goto 167
  192. #define j_goto_w 200
  193. #define j_jsr 168
  194. #define j_jsr_w 201
  195. #define j_ret 169
  196. #define j_ret_w 209
  197. /* 3.12 function return */
  198. #define j_ireturn 172
  199. #define j_lreturn 173
  200. #define j_freturn 174
  201. #define j_dreturn 175
  202. #define j_areturn 176
  203. #define j_return 177
  204. #define j_breakpoint 202
  205. /* 3.13 table jumping */
  206. #define j_tableswitch 170
  207. #define j_lookupswitch 171
  208. /* 3.14 manipulating object fields */
  209. #define j_putfield 181
  210. #define j_getfield 180
  211. #define j_putstatic 179
  212. #define j_getstatic 178
  213. /* 3.15 method invokation */
  214. #define j_invokevirtual 182
  215. #define j_invokenonvirtual 183
  216. #define j_invokestatic 184
  217. #define j_invokeinterface 185
  218. /* 3.16 exception handling */
  219. #define j_athrow 191
  220. /* 3.17 miscellaneous object operation */
  221. #define j_new 187
  222. #define j_checkcast 192
  223. #define j_instanceof 193
  224. #define j_monitorenter 194
  225. #define j_monitorexit 195
  226. /* Quick variants of opcodes are not currently supported. */
  227. /* Java type codes. */
  228. #define T_BOOLEAN 4
  229. #define T_CHAR 5
  230. #define T_FLOAT 6
  231. #define T_DOUBLE 7
  232. #define T_BYTE 8
  233. #define T_SHORT 9
  234. #define T_INT 10
  235. #define T_LONG 11
  236. /* end of javaops.h */
  237.