bytes.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /* bytes.h Copyright (C) Codemist 1993-2002 */
  2. /*
  3. * This code may be used and modified, and redistributed in binary
  4. * or source form, subject to the "CCL Public License", which should
  5. * accompany it. This license is a variant on the BSD license, and thus
  6. * permits use of code derived from this in either open and commercial
  7. * projects: but it does require that updates to this code be made
  8. * available back to the originators of the package.
  9. * Before merging other code in with this or linking this code
  10. * with other packages or libraries please check that the license terms
  11. * of the other material are compatible with those of this.
  12. */
  13. /* Signature: 314b22cb 08-Apr-2002 */
  14. /*
  15. * Bytecode interpreter support.
  16. */
  17. #ifndef header_bytes_h
  18. #define header_bytes_h 1
  19. #define JUMP_BACK 0x01 /* select direction of jump */
  20. #define JUMP_LONG 0x02 /* select 16 vs 8 bit offset */
  21. #define OP_LOADLOC 0x00
  22. #define OP_LOADLOC0 0x01
  23. #define OP_LOADLOC1 0x02
  24. #define OP_LOADLOC2 0x03
  25. #define OP_LOADLOC3 0x04
  26. #define OP_LOADLOC4 0x05
  27. #define OP_LOADLOC5 0x06
  28. #define OP_LOADLOC6 0x07
  29. #define OP_LOADLOC7 0x08
  30. #define OP_LOADLOC8 0x09
  31. #define OP_LOADLOC9 0x0a
  32. #define OP_LOADLOC10 0x0b
  33. #define OP_LOADLOC11 0x0c
  34. #define OP_LOC0LOC1 0x0d
  35. #define OP_LOC1LOC2 0x0e
  36. #define OP_LOC2LOC3 0x0f
  37. #define OP_LOC1LOC0 0x10
  38. #define OP_LOC2LOC1 0x11
  39. #define OP_LOC3LOC2 0x12
  40. #define OP_VNIL 0x13
  41. #define OP_LOADLIT 0x14
  42. #define OP_LOADLIT1 0x15
  43. #define OP_LOADLIT2 0x16
  44. #define OP_LOADLIT3 0x17
  45. #define OP_LOADLIT4 0x18
  46. #define OP_LOADLIT5 0x19
  47. #define OP_LOADLIT6 0x1a
  48. #define OP_LOADLIT7 0x1b
  49. #define OP_LOADFREE 0x1c
  50. #define OP_LOADFREE1 0x1d
  51. #define OP_LOADFREE2 0x1e
  52. #define OP_LOADFREE3 0x1f
  53. #define OP_LOADFREE4 0x20
  54. #define OP_STORELOC 0x21
  55. #define OP_STORELOC0 0x22
  56. #define OP_STORELOC1 0x23
  57. #define OP_STORELOC2 0x24
  58. #define OP_STORELOC3 0x25
  59. #define OP_STORELOC4 0x26
  60. #define OP_STORELOC5 0x27
  61. #define OP_STORELOC6 0x28
  62. #define OP_STORELOC7 0x29
  63. #define OP_STOREFREE 0x2a
  64. #define OP_STOREFREE1 0x2b
  65. #define OP_STOREFREE2 0x2c
  66. #define OP_STOREFREE3 0x2d
  67. #define OP_LOADLEX 0x2e
  68. #define OP_STORELEX 0x2f
  69. #define OP_CLOSURE 0x30
  70. #define OP_CARLOC0 0x31
  71. #define OP_CARLOC1 0x32
  72. #define OP_CARLOC2 0x33
  73. #define OP_CARLOC3 0x34
  74. #define OP_CARLOC4 0x35
  75. #define OP_CARLOC5 0x36
  76. #define OP_CARLOC6 0x37
  77. #define OP_CARLOC7 0x38
  78. #define OP_CARLOC8 0x39
  79. #define OP_CARLOC9 0x3a
  80. #define OP_CARLOC10 0x3b
  81. #define OP_CARLOC11 0x3c
  82. #define OP_CDRLOC0 0x3d
  83. #define OP_CDRLOC1 0x3e
  84. #define OP_CDRLOC2 0x3f
  85. #define OP_CDRLOC3 0x40
  86. #define OP_CDRLOC4 0x41
  87. #define OP_CDRLOC5 0x42
  88. #define OP_CAARLOC0 0x43
  89. #define OP_CAARLOC1 0x44
  90. #define OP_CAARLOC2 0x45
  91. #define OP_CAARLOC3 0x46
  92. #define OP_CALL0 0x47
  93. #define OP_CALL1 0x48
  94. #define OP_CALL2 0x49
  95. #define OP_CALL2R 0x4a
  96. #define OP_CALL3 0x4b
  97. #define OP_CALLN 0x4c
  98. #define OP_CALL0_0 0x4d
  99. #define OP_CALL0_1 0x4e
  100. #define OP_CALL0_2 0x4f
  101. #define OP_CALL0_3 0x50
  102. #define OP_CALL1_0 0x51
  103. #define OP_CALL1_1 0x52
  104. #define OP_CALL1_2 0x53
  105. #define OP_CALL1_3 0x54
  106. #define OP_CALL1_4 0x55
  107. #define OP_CALL1_5 0x56
  108. #define OP_CALL2_0 0x57
  109. #define OP_CALL2_1 0x58
  110. #define OP_CALL2_2 0x59
  111. #define OP_CALL2_3 0x5a
  112. #define OP_CALL2_4 0x5b
  113. #define OP_BUILTIN0 0x5c
  114. #define OP_BUILTIN1 0x5d
  115. #define OP_BUILTIN2 0x5e
  116. #define OP_BUILTIN2R 0x5f
  117. #define OP_BUILTIN3 0x60
  118. #define OP_APPLY1 0x61
  119. #define OP_APPLY2 0x62
  120. #define OP_APPLY3 0x63
  121. #define OP_APPLY4 0x64
  122. #define OP_JCALL 0x65
  123. #define OP_JCALLN 0x66
  124. #define OP_JUMP 0x67
  125. #define OP_JUMP_B 0x68
  126. #define OP_JUMP_L 0x69
  127. #define OP_JUMP_BL 0x6a
  128. #define OP_JUMPNIL 0x6b
  129. #define OP_JUMPNIL_B 0x6c
  130. #define OP_JUMPNIL_L 0x6d
  131. #define OP_JUMPNIL_BL 0x6e
  132. #define OP_JUMPT 0x6f
  133. #define OP_JUMPT_B 0x70
  134. #define OP_JUMPT_L 0x71
  135. #define OP_JUMPT_BL 0x72
  136. #define OP_JUMPATOM 0x73
  137. #define OP_JUMPATOM_B 0x74
  138. #define OP_JUMPATOM_L 0x75
  139. #define OP_JUMPATOM_BL 0x76
  140. #define OP_JUMPNATOM 0x77
  141. #define OP_JUMPNATOM_B 0x78
  142. #define OP_JUMPNATOM_L 0x79
  143. #define OP_JUMPNATOM_BL 0x7a
  144. #define OP_JUMPEQ 0x7b
  145. #define OP_JUMPEQ_B 0x7c
  146. #define OP_JUMPEQ_L 0x7d
  147. #define OP_JUMPEQ_BL 0x7e
  148. #define OP_JUMPNE 0x7f
  149. #define OP_JUMPNE_B 0x80
  150. #define OP_JUMPNE_L 0x81
  151. #define OP_JUMPNE_BL 0x82
  152. #define OP_JUMPEQUAL 0x83
  153. #define OP_JUMPEQUAL_B 0x84
  154. #define OP_JUMPEQUAL_L 0x85
  155. #define OP_JUMPEQUAL_BL 0x86
  156. #define OP_JUMPNEQUAL 0x87
  157. #define OP_JUMPNEQUAL_B 0x88
  158. #define OP_JUMPNEQUAL_L 0x89
  159. #define OP_JUMPNEQUAL_BL 0x8a
  160. #define OP_JUMPL0NIL 0x8b
  161. #define OP_JUMPL0T 0x8c
  162. #define OP_JUMPL1NIL 0x8d
  163. #define OP_JUMPL1T 0x8e
  164. #define OP_JUMPL2NIL 0x8f
  165. #define OP_JUMPL2T 0x90
  166. #define OP_JUMPL3NIL 0x91
  167. #define OP_JUMPL3T 0x92
  168. #define OP_JUMPL4NIL 0x93
  169. #define OP_JUMPL4T 0x94
  170. #define OP_JUMPST0NIL 0x95
  171. #define OP_JUMPST0T 0x96
  172. #define OP_JUMPST1NIL 0x97
  173. #define OP_JUMPST1T 0x98
  174. #define OP_JUMPST2NIL 0x99
  175. #define OP_JUMPST2T 0x9a
  176. #define OP_JUMPL0ATOM 0x9b
  177. #define OP_JUMPL0NATOM 0x9c
  178. #define OP_JUMPL1ATOM 0x9d
  179. #define OP_JUMPL1NATOM 0x9e
  180. #define OP_JUMPL2ATOM 0x9f
  181. #define OP_JUMPL2NATOM 0xa0
  182. #define OP_JUMPL3ATOM 0xa1
  183. #define OP_JUMPL3NATOM 0xa2
  184. #define OP_JUMPFREE1NIL 0xa3
  185. #define OP_JUMPFREE1T 0xa4
  186. #define OP_JUMPFREE2NIL 0xa5
  187. #define OP_JUMPFREE2T 0xa6
  188. #define OP_JUMPFREE3NIL 0xa7
  189. #define OP_JUMPFREE3T 0xa8
  190. #define OP_JUMPFREE4NIL 0xa9
  191. #define OP_JUMPFREE4T 0xaa
  192. #define OP_JUMPFREENIL 0xab
  193. #define OP_JUMPFREET 0xac
  194. #define OP_JUMPLIT1EQ 0xad
  195. #define OP_JUMPLIT1NE 0xae
  196. #define OP_JUMPLIT2EQ 0xaf
  197. #define OP_JUMPLIT2NE 0xb0
  198. #define OP_JUMPLIT3EQ 0xb1
  199. #define OP_JUMPLIT3NE 0xb2
  200. #define OP_JUMPLIT4EQ 0xb3
  201. #define OP_JUMPLIT4NE 0xb4
  202. #define OP_JUMPLITEQ 0xb5
  203. #define OP_JUMPLITNE 0xb6
  204. #define OP_JUMPB1NIL 0xb7
  205. #define OP_JUMPB1T 0xb8
  206. #define OP_JUMPB2NIL 0xb9
  207. #define OP_JUMPB2T 0xba
  208. #define OP_JUMPFLAGP 0xbb
  209. #define OP_JUMPNFLAGP 0xbc
  210. #define OP_JUMPEQCAR 0xbd
  211. #define OP_JUMPNEQCAR 0xbe
  212. #define OP_CATCH 0xbf
  213. #define OP_CATCH_B 0xc0
  214. #define OP_CATCH_L 0xc1
  215. #define OP_CATCH_BL 0xc2
  216. #define OP_UNCATCH 0xc3
  217. #define OP_THROW 0xc4
  218. #define OP_PROTECT 0xc5
  219. #define OP_UNPROTECT 0xc6
  220. #define OP_PVBIND 0xc7
  221. #define OP_PVRESTORE 0xc8
  222. #define OP_FREEBIND 0xc9
  223. #define OP_FREERSTR 0xca
  224. #define OP_EXIT 0xcb
  225. #define OP_NILEXIT 0xcc
  226. #define OP_LOC0EXIT 0xcd
  227. #define OP_LOC1EXIT 0xce
  228. #define OP_LOC2EXIT 0xcf
  229. #define OP_PUSH 0xd0
  230. #define OP_PUSHNIL 0xd1
  231. #define OP_PUSHNIL2 0xd2
  232. #define OP_PUSHNIL3 0xd3
  233. #define OP_PUSHNILS 0xd4
  234. #define OP_POP 0xd5
  235. #define OP_LOSE 0xd6
  236. #define OP_LOSE2 0xd7
  237. #define OP_LOSE3 0xd8
  238. #define OP_LOSES 0xd9
  239. #define OP_SWOP 0xda
  240. #define OP_EQ 0xdb
  241. #define OP_EQCAR 0xdc
  242. #define OP_EQUAL 0xdd
  243. #define OP_NUMBERP 0xde
  244. #define OP_CAR 0xdf
  245. #define OP_CDR 0xe0
  246. #define OP_CAAR 0xe1
  247. #define OP_CADR 0xe2
  248. #define OP_CDAR 0xe3
  249. #define OP_CDDR 0xe4
  250. #define OP_CONS 0xe5
  251. #define OP_NCONS 0xe6
  252. #define OP_XCONS 0xe7
  253. #define OP_ACONS 0xe8
  254. #define OP_LENGTH 0xe9
  255. #define OP_LIST2 0xea
  256. #define OP_LIST2STAR 0xeb
  257. #define OP_LIST3 0xec
  258. #define OP_PLUS2 0xed
  259. #define OP_ADD1 0xee
  260. #define OP_DIFFERENCE 0xef
  261. #define OP_SUB1 0xf0
  262. #define OP_TIMES2 0xf1
  263. #define OP_GREATERP 0xf2
  264. #define OP_LESSP 0xf3
  265. #define OP_FLAGP 0xf4
  266. #define OP_GET 0xf5
  267. #define OP_LITGET 0xf6
  268. #define OP_GETV 0xf7
  269. #define OP_QGETV 0xf8
  270. #define OP_QGETVN 0xf9
  271. #define OP_BIGSTACK 0xfa
  272. #define OP_BIGCALL 0xfb
  273. #define OP_ICASE 0xfc
  274. #define OP_FASTGET 0xfd
  275. #define OP_SPARE1 0xfe
  276. #define OP_SPARE2 0xff
  277. #endif /* header_bytes_h */
  278. /* end of bytes.h */