axe_gencode.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. /*
  2. * Andrea Di Biagio
  3. * Politecnico di Milano, 2007
  4. *
  5. * axe_gencode.h
  6. * Formal Languages & Compilers Machine, 2007/2008
  7. *
  8. */
  9. #ifndef _AXE_GENCODE_H
  10. #define _AXE_GENCODE_H
  11. #include "axe_engine.h"
  12. #include "axe_struct.h"
  13. /*----------------------------------------------------
  14. * NOP & HALT
  15. *---------------------------------------------------*/
  16. /* By calling this function, a new NOP instruction will be added
  17. * to `program'. A NOP instruction doesn't make use of
  18. * any kind of parameter */
  19. extern t_axe_instruction * gen_nop_instruction
  20. (t_program_infos *program);
  21. /* By calling this function, a new HALT instruction will be added
  22. * to `program'. An HALT instruction doesn't require
  23. * any kind of parameter */
  24. extern t_axe_instruction * gen_halt_instruction
  25. (t_program_infos *program);
  26. /*----------------------------------------------------
  27. * UNARY OPERATIONS
  28. *---------------------------------------------------*/
  29. /* A LOAD instruction requires the following parameters:
  30. * 1. A destination register (where will be loaded the requested value)
  31. * 2. A label information (can be a NULL pointer. If so, the addess
  32. * value will be taken into consideration)
  33. * 3. A direct address (if label is different from NULL) */
  34. extern t_axe_instruction * gen_load_instruction
  35. (t_program_infos *program, int r_dest, t_axe_label *label, int address);
  36. /* A READ instruction requires only one parameter:
  37. * A destination register (where will be loaded the value
  38. * read from standard input). */
  39. extern t_axe_instruction * gen_read_instruction
  40. (t_program_infos *program, int r_dest);
  41. /* A WRITE instruction requires only one parameter:
  42. * A destination register (where is located the value
  43. * that will be written to the standard output). */
  44. extern t_axe_instruction * gen_write_instruction
  45. (t_program_infos *program, int r_dest);
  46. /* A STORE instruction copies a value from a register to a
  47. * specific memory location. The memory location can be
  48. * either a label identifier or a address reference.
  49. * In order to create a STORE instruction the caller must
  50. * privide a valid register location (`r_dest') and an
  51. * instance of `t_axe_label' or a numeric address */
  52. extern t_axe_instruction * gen_store_instruction
  53. (t_program_infos *program, int r_dest, t_axe_label *label, int address);
  54. /* A MOVA instruction copies an address value into a register.
  55. * An address can be either an instance of `t_axe_label'
  56. * or a number (numeric address) */
  57. extern t_axe_instruction * gen_mova_instruction
  58. (t_program_infos *program, int r_dest, t_axe_label *label, int address);
  59. /* A SGE instruction tests the content of the STATUS REGISTER. To be more
  60. * specific, an SGE instruction set to #1 the content of the register
  61. * `r_dest' if the condition (N.V + ~N.~V) is TRUE; otherwise the content
  62. * of `r_dest' is set to 0.
  63. * (I.e.: r_dest will be set to #1 only if the value computed by
  64. * the last numeric operation returned a value
  65. * greater or equal to zero). */
  66. extern t_axe_instruction * gen_sge_instruction
  67. (t_program_infos *program, int r_dest);
  68. /* A SEQ instruction tests the content of the STATUS REGISTER. In particular,
  69. * an SEQ instruction set to #1 the content of the register
  70. * `r_dest' if the condition Z is TRUE; otherwise the content of `r_dest' is set
  71. * to 0. (I.e.: r_dest will be set to #1 only if the value computed by
  72. * the last numeric operation returned a value equal to zero). */
  73. extern t_axe_instruction * gen_seq_instruction
  74. (t_program_infos *program, int r_dest);
  75. /* A SGT instruction tests the content of the STATUS REGISTER. In particular,
  76. * an SGT instruction set to #1 the content of the register
  77. * `r_dest' if the condition (N.V.~Z + ~N.~V.~Z) is TRUE;
  78. * otherwise the content of `r_dest' is set to 0. (I.e.: r_dest will be
  79. * set to #1 only if the value computed by the last numeric operation
  80. * returned a value greater than zero). */
  81. extern t_axe_instruction * gen_sgt_instruction
  82. (t_program_infos *program, int r_dest);
  83. /* A SLE instruction tests the content of the STATUS REGISTER. In particular,
  84. * an SLE instruction set to #1 the content of the register
  85. * `r_dest' if the condition (Z + N.~V + ~N.V) is TRUE;
  86. * otherwise the content of `r_dest' is set to 0. (I.e.: r_dest will be
  87. * set to #1 only if the value computed by the last numeric operation
  88. * returned a value less than zero). */
  89. extern t_axe_instruction * gen_sle_instruction
  90. (t_program_infos *program, int r_dest);
  91. /* A SLT instruction tests the content of the STATUS REGISTER. In particular,
  92. * an SLT instruction set to #1 the content of the register
  93. * `r_dest' if the condition (N.~V + ~N.V) is TRUE;
  94. * otherwise the content of `r_dest' is set to 0. (I.e.: r_dest will be
  95. * set to #1 only if the value computed by the last numeric operation
  96. * returned a value less than or equal to zero). */
  97. extern t_axe_instruction * gen_slt_instruction
  98. (t_program_infos *program, int r_dest);
  99. /* A SNE instruction tests the content of the STATUS REGISTER. In particular,
  100. * an SNE instruction set to #1 the content of the register
  101. * `r_dest' if the condition ~N is TRUE;
  102. * otherwise the content of `r_dest' is set to 0. (I.e.: r_dest will be
  103. * set to #1 only if the value computed by the last numeric operation
  104. * returned a value different from zero). */
  105. extern t_axe_instruction * gen_sne_instruction
  106. (t_program_infos *program, int r_dest);
  107. /*----------------------------------------------------
  108. * BINARY OPERATIONS
  109. *---------------------------------------------------*/
  110. /* Used in order to create and assign to the current `program'
  111. * an ADDI instruction. The semantic of an ADDI instruction
  112. * is the following: ADDI r_dest, r_source1, immediate. `RDest' is a register
  113. * location identifier: the result of the ADDI instruction will be
  114. * stored in that register. Using an RTL representation we can say
  115. * that an ADDI instruction of the form: ADDI R1 R2 #IMM can be represented
  116. * in the following manner: R1 <-- R2 + IMM.
  117. * `Rsource1' and `#IMM' are the two operands of the binary numeric
  118. * operation. `r_dest' is a register location, `immediate' is an immediate
  119. * value. The content of `r_source1' is added to the value of `immediate'
  120. * and the result is then stored into the register `RDest'. */
  121. extern t_axe_instruction * gen_addi_instruction
  122. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  123. /* Used in order to create and assign to the current `program'
  124. * a SUBI instruction. The semantic of an SUBI instruction
  125. * is the following: SUBI r_dest, r_source1, immediate. `RDest' is a register
  126. * location identifier: the result of the SUBI instruction will be
  127. * stored in that register. Using an RTL representation we can say
  128. * that a SUBI instruction of the form: SUBI R1 R2 #IMM can be represented
  129. * in the following manner: R1 <-- R2 - IMM.
  130. * `Rsource1' and `#IMM' are the two operands of the binary numeric
  131. * operation. `r_dest' is a register location, `immediate' is an immediate
  132. * value. The content of `r_source1' is subtracted to the value of `immediate'
  133. * and the result is then stored into the register `RDest'. */
  134. extern t_axe_instruction * gen_subi_instruction
  135. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  136. /* Used in order to create and assign to the current `program'
  137. * a ANDLI instruction.An RTL representation for an ANDLI instruction
  138. * of the form: ANDLI R1 R2 #IMM can be represented
  139. * as follows: R1 <-- R2 && IMM.
  140. * `r_source1' and `immediate' are the two operands of the binary numeric
  141. * comparison. `r_dest' is a register location, `immediate' is an immediate
  142. * value. */
  143. extern t_axe_instruction * gen_andli_instruction
  144. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  145. /* Used in order to create and assign to the current `program'
  146. * a ORLI instruction.An RTL representation for an ORLI instruction
  147. * of the form: ORLI R1 R2 #IMM can be represented
  148. * as follows: R1 <-- R2 || IMM.
  149. * `r_source1' and `immediate' are the two operands of the binary numeric
  150. * comparison. `r_dest' is a register location, `immediate' is an immediate
  151. * value. */
  152. extern t_axe_instruction * gen_orli_instruction
  153. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  154. /* Used in order to create and assign to the current `program'
  155. * a EORLI instruction.An RTL representation for an EORLI instruction
  156. * of the form: EORLI R1 R2 #IMM can be represented as follows:
  157. * R1 <-- R2 XOR IMM (Where XOR is the operator: logical exclusive OR).
  158. * `r_source1' and `immediate' are the two operands of the binary numeric
  159. * comparison. `r_dest' is a register location, `immediate' is an immediate
  160. * value. */
  161. extern t_axe_instruction * gen_eorli_instruction
  162. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  163. /* Used in order to create and assign to the current `program'
  164. * a ANDBI instruction. An RTL representation for an ANDBI instruction
  165. * of the form: ANDBI R1 R2 #IMM can be represented
  166. * as follows: R1 <-- R2 & IMM (bitwise AND).
  167. * `r_source1' and `immediate' are the two operands of the binary numeric
  168. * comparison. `r_dest' is a register location, `immediate' is an immediate
  169. * value. */
  170. extern t_axe_instruction * gen_andbi_instruction
  171. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  172. /* Used in order to create and assign to the current `program'
  173. * a MULI instruction.An RTL representation for an MULI instruction
  174. * of the form: MULI R1 R2 #IMM can be represented as follows:
  175. * R1 <-- R2 * IMM.
  176. * `r_source1' and `immediate' are the two operands of the binary numeric
  177. * comparison. `r_dest' is a register location, `immediate' is an immediate
  178. * value. */
  179. extern t_axe_instruction * gen_muli_instruction
  180. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  181. /* Used in order to create and assign to the current `program'
  182. * a ORBI instruction.An RTL representation for an ORBI instruction
  183. * of the form: ORBI R1 R2 #IMM can be represented as follows:
  184. * R1 <-- R2 | IMM.
  185. * `r_source1' and `immediate' are the two operands of the binary numeric
  186. * comparison. `r_dest' is a register location, `immediate' is an immediate
  187. * value. */
  188. extern t_axe_instruction * gen_orbi_instruction
  189. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  190. /* Used in order to create and assign to the current `program'
  191. * a EORBI instruction.An RTL representation for an EORBI instruction
  192. * of the form: EORBI R1 R2 #IMM can be represented as follows:
  193. * R1 <-- R2 ^ IMM.
  194. * `r_source1' and `immediate' are the two operands of the binary numeric
  195. * comparison. `r_dest' is a register location, `immediate' is an immediate
  196. * value. */
  197. extern t_axe_instruction * gen_eorbi_instruction
  198. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  199. /* Used in order to create and assign to the current `program'
  200. * a DIVI instruction.An RTL representation for an DIVI instruction
  201. * of the form: DIVI R1 R2 #IMM can be represented as follows:
  202. * R1 <-- R2 / IMM.
  203. * `r_source1' and `immediate' are the two operands of the binary numeric
  204. * comparison. `r_dest' is a register location, `immediate' is an immediate
  205. * value. */
  206. extern t_axe_instruction * gen_divi_instruction
  207. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  208. /* Used in order to create and assign to the current `program'
  209. * a SHLI instruction. An RTL representation for an SHLI instruction
  210. * of the form: SHLI R1 R2 #IMM can be represented as follows:
  211. * R1 <-- R2 / IMM.
  212. * `r_source1' and `immediate' are the two operands of the binary numeric
  213. * comparison. `r_dest' is a register location, `immediate' is an immediate
  214. * value. */
  215. extern t_axe_instruction * gen_shli_instruction
  216. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  217. /* Used in order to create and assign to the current `program'
  218. * a SHRI instruction. An RTL representation for an SHRI instruction
  219. * of the form: SHRI R1 R2 #IMM can be represented as follows:
  220. * R1 <-- R2 / IMM.
  221. * `r_source1' and `immediate' are the two operands of the binary numeric
  222. * comparison. `r_dest' is a register location, `immediate' is an immediate
  223. * value. */
  224. extern t_axe_instruction * gen_shri_instruction
  225. (t_program_infos *program, int r_dest, int r_source1, int immediate);
  226. /* Used in order to create and assign to the current `program'
  227. * a NOTL instruction. An RTL representation for an NOTL instruction
  228. * of the form: NOTL R1 R2 can be represented as follows:
  229. * R1 <-- !R2. */
  230. extern t_axe_instruction * gen_notl_instruction
  231. (t_program_infos *program, int r_dest, int r_source1);
  232. /* Used in order to create and assign to the current `program'
  233. * a NOTB instruction. An RTL representation for an NOTB instruction
  234. * of the form: NOTB R1 R2 can be represented as follows:
  235. * R1 <-- ~R2. */
  236. extern t_axe_instruction * gen_notb_instruction
  237. (t_program_infos *program, int r_dest, int r_source1);
  238. /*----------------------------------------------------
  239. * TERNARY OPERATIONS
  240. *---------------------------------------------------*/
  241. /* Used in order to create and assign to the current `program'
  242. * a ADD instruction.An RTL representation for an ADD instruction
  243. * of the form: ADD R1 R2 R3 can be represented
  244. * as follows: R1 <-- R2 + R3.
  245. * `r_source1' and `r_source2' are the two operands of the binary numeric
  246. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  247. * are register locations that can be directly or indirectly addressed. */
  248. extern t_axe_instruction * gen_add_instruction (t_program_infos *program
  249. , int r_dest, int r_source1, int r_source2, int flags);
  250. /* Used in order to create and assign to the current `program'
  251. * a SUB instruction.An RTL representation for an SUB instruction
  252. * of the form: SUB R1 R2 R3 can be represented
  253. * as follows: R1 <-- R2 - R3.
  254. * `r_source1' and `r_source2' are the two operands of the binary numeric
  255. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  256. * are register locations that can be directly or indirectly addressed. */
  257. extern t_axe_instruction * gen_sub_instruction (t_program_infos *program
  258. , int r_dest, int r_source1, int r_source2, int flags);
  259. /* Used in order to create and assign to the current `program'
  260. * a ANDL instruction.An RTL representation for an ANDL instruction
  261. * of the form: ANDL R1 R2 R3 can be represented
  262. * as follows: R1 <-- R2 && R3.
  263. * `r_source1' and `r_source2' are the two operands of the binary numeric
  264. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  265. * are register locations that can be directly or indirectly addressed. */
  266. extern t_axe_instruction * gen_andl_instruction (t_program_infos *program
  267. , int r_dest, int r_source1, int r_source2, int flags);
  268. /* Used in order to create and assign to the current `program'
  269. * a ORL instruction.An RTL representation for an ORL instruction
  270. * of the form: ORL R1 R2 R3 can be represented
  271. * as follows: R1 <-- R2 || R3.
  272. * `r_source1' and `r_source2' are the two operands of the binary numeric
  273. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  274. * are register locations that can be directly or indirectly addressed. */
  275. extern t_axe_instruction * gen_orl_instruction (t_program_infos *program
  276. , int r_dest, int r_source1, int r_source2, int flags);
  277. /* Used in order to create and assign to the current `program'
  278. * a EORL instruction.An RTL representation for an EORL instruction
  279. * of the form: EORL R1 R2 R3 can be represented
  280. * as follows: R1 <-- R2 XORL R3.
  281. * `r_source1' and `r_source2' are the two operands of the binary numeric
  282. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  283. * are register locations that can be directly or indirectly addressed. */
  284. extern t_axe_instruction * gen_eorl_instruction (t_program_infos *program
  285. , int r_dest, int r_source1, int r_source2, int flags);
  286. /* Used in order to create and assign to the current `program'
  287. * a ANDB instruction.An RTL representation for an ANDB instruction
  288. * of the form: ANDB R1 R2 R3 can be represented
  289. * as follows: R1 <-- R2 & R3.
  290. * `r_source1' and `r_source2' are the two operands of the binary numeric
  291. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  292. * are register locations that can be directly or indirectly addressed. */
  293. extern t_axe_instruction * gen_andb_instruction (t_program_infos *program
  294. , int r_dest, int r_source1, int r_source2, int flags);
  295. /* Used in order to create and assign to the current `program'
  296. * a ORB instruction.An RTL representation for an ORB instruction
  297. * of the form: ORB R1 R2 R3 can be represented
  298. * as follows: R1 <-- R2 | R3.
  299. * `r_source1' and `r_source2' are the two operands of the binary numeric
  300. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  301. * are register locations that can be directly or indirectly addressed. */
  302. extern t_axe_instruction * gen_orb_instruction (t_program_infos *program
  303. , int r_dest, int r_source1, int r_source2, int flags);
  304. /* Used in order to create and assign to the current `program'
  305. * a EORB instruction.An RTL representation for an EORB instruction
  306. * of the form: EORB R1 R2 R3 can be represented
  307. * as follows: R1 <-- R2 XORB R3.
  308. * `r_source1' and `r_source2' are the two operands of the binary numeric
  309. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  310. * are register locations that can be directly or indirectly addressed. */
  311. extern t_axe_instruction * gen_eorb_instruction (t_program_infos *program
  312. , int r_dest, int r_source1, int r_source2, int flags);
  313. /* Used in order to create and assign to the current `program'
  314. * a MUL instruction. An RTL representation for an MUL instruction
  315. * of the form: MUL R1 R2 R3 can be represented
  316. * as follows: R1 <-- R2 * R3.
  317. * `r_source1' and `r_source2' are the two operands of the binary numeric
  318. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  319. * are register locations that can be directly or indirectly addressed. */
  320. extern t_axe_instruction * gen_mul_instruction (t_program_infos *program
  321. , int r_dest, int r_source1, int r_source2, int flags);
  322. /* Used in order to create and assign to the current `program'
  323. * a DIV instruction. An RTL representation for an DIV instruction
  324. * of the form: DIV R1 R2 R3 can be represented
  325. * as follows: R1 <-- R2 / R3.
  326. * `r_source1' and `r_source2' are the two operands of the binary numeric
  327. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  328. * are register locations that can be directly or indirectly addressed. */
  329. extern t_axe_instruction * gen_div_instruction (t_program_infos *program
  330. , int r_dest, int r_source1, int r_source2, int flags);
  331. /* Used in order to create and assign to the current `program'
  332. * a SHL instruction. An RTL representation for an SHL instruction
  333. * of the form: SHL R1 R2 R3 can be represented
  334. * as follows: R1 <-- R2 shifted to left by R3.
  335. * `r_source1' and `r_source2' are the two operands of the binary numeric
  336. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  337. * are register locations that can be directly or indirectly addressed. */
  338. extern t_axe_instruction * gen_shl_instruction (t_program_infos *program
  339. , int r_dest, int r_source1, int r_source2, int flags);
  340. /* Used in order to create and assign to the current `program'
  341. * a SHR instruction. An RTL representation for an SHR instruction
  342. * of the form: SHR R1 R2 R3 can be represented
  343. * as follows: R1 <-- R2 shifted to right by R3.
  344. * `r_source1' and `r_source2' are the two operands of the binary numeric
  345. * comparison. `r_dest' is a register location. `r_dest' and `r_source2'
  346. * are register locations that can be directly or indirectly addressed. */
  347. extern t_axe_instruction * gen_shr_instruction (t_program_infos *program
  348. , int r_dest, int r_source1, int r_source2, int flags);
  349. /* Used in order to create and assign to the current `program'
  350. * a NEG instruction. An RTL representation for an NEG instruction
  351. * of the form: NEG R1 R2 can be represented
  352. * as follows: R1 <-- (-)R2.
  353. * `r_source' is the only operand for this instruction.
  354. * `r_dest' is a register location. `r_dest' and `r_source'
  355. * are register locations that can be directly or indirectly addressed. */
  356. extern t_axe_instruction * gen_neg_instruction (t_program_infos *program
  357. , int r_dest, int r_source, int flags);
  358. /* Actually this instruction is not used.
  359. * This will be used for future implementations. */
  360. extern t_axe_instruction * gen_spcl_instruction (t_program_infos *program
  361. , int r_dest, int r_source1, int r_source2, int flags);
  362. /*----------------------------------------------------
  363. * JUMP INSTRUCTIONS
  364. *---------------------------------------------------*/
  365. /* create a branch true instruction. By executing this instruction
  366. * the control is always passed to either the instruction with the label `label'
  367. * associated with, or (if `label' is a NULL pointer) to the explicit `address' */
  368. extern t_axe_instruction * gen_bt_instruction
  369. (t_program_infos *program, t_axe_label *label, int addr);
  370. /* create a branch true instruction. By executing this instruction
  371. * the control is always passed to the next instruction in the program
  372. * (i.e.: the instruction pointed by PC + 1). */
  373. extern t_axe_instruction * gen_bf_instruction
  374. (t_program_infos *program, t_axe_label *label, int addr);
  375. /* create a "branch on higher than" instruction. */
  376. extern t_axe_instruction * gen_bhi_instruction
  377. (t_program_infos *program, t_axe_label *label, int addr);
  378. /* create a "branch on less than" instruction. According to the value
  379. * of the status register, the branch will be taken if the expression
  380. * (~C.~Z) is TRUE. */
  381. extern t_axe_instruction * gen_bls_instruction
  382. (t_program_infos *program, t_axe_label *label, int addr);
  383. /* create a "branch on carry clear" instruction. If the bit `C' of the
  384. * status register is not set, then the branch is taken. */
  385. extern t_axe_instruction * gen_bcc_instruction
  386. (t_program_infos *program, t_axe_label *label, int addr);
  387. /* create a "branch on carry clear" instruction. If the bit `C' of the
  388. * status register is set, then the branch is taken. */
  389. extern t_axe_instruction * gen_bcs_instruction
  390. (t_program_infos *program, t_axe_label *label, int addr);
  391. /* create a "branch on not equal" instruction. If the bit `Z' of the
  392. * status register is not set, then the branch is taken. */
  393. extern t_axe_instruction * gen_bne_instruction
  394. (t_program_infos *program, t_axe_label *label, int addr);
  395. /* create a "branch on equal" instruction. If the bit `Z' of the
  396. * status register is set, then the branch is taken. */
  397. extern t_axe_instruction * gen_beq_instruction
  398. (t_program_infos *program, t_axe_label *label, int addr);
  399. /* create a "branch on overflow clear" instruction. If the bit `V' of the
  400. * status register is not set, then the branch is taken. */
  401. extern t_axe_instruction * gen_bvc_instruction
  402. (t_program_infos *program, t_axe_label *label, int addr);
  403. /* create a "branch on overflow set" instruction. If the bit `V' of the
  404. * status register is set, then the branch is taken. */
  405. extern t_axe_instruction * gen_bvs_instruction
  406. (t_program_infos *program, t_axe_label *label, int addr);
  407. /* create a "branch on plus (i.e. positive)" instruction. If the bit `N' of the
  408. * status register is not set, then the branch is taken. */
  409. extern t_axe_instruction * gen_bpl_instruction
  410. (t_program_infos *program, t_axe_label *label, int addr);
  411. /* create a "branch on minus (i.e. negative)" instruction. If the bit `N' of the
  412. * status register is set, then the branch is taken. */
  413. extern t_axe_instruction * gen_bmi_instruction
  414. (t_program_infos *program, t_axe_label *label, int addr);
  415. /* create a "branch on greater or equal" instruction. According to the value
  416. * of the status register, the branch will be taken if the expression
  417. * (N.V + ~N.~V) is TRUE. */
  418. extern t_axe_instruction * gen_bge_instruction
  419. (t_program_infos *program, t_axe_label *label, int addr);
  420. /* create a "branch on less than" instruction. According to the value
  421. * of the status register, the branch will be taken if the expression
  422. * (N.~V + ~N.V) is TRUE. */
  423. extern t_axe_instruction * gen_blt_instruction
  424. (t_program_infos *program, t_axe_label *label, int addr);
  425. /* create a "branch on less than" instruction. According to the value
  426. * of the status register, the branch will be taken if the expression
  427. * (N.V.~Z + ~N.~V.~Z) is TRUE. */
  428. extern t_axe_instruction * gen_bgt_instruction
  429. (t_program_infos *program, t_axe_label *label, int addr);
  430. /* create a "branch on less than or equal" instruction. According to the value
  431. * of the status register, the branch will be taken if the expression
  432. * (Z + N.~V + ~N.V) is TRUE. */
  433. extern t_axe_instruction * gen_ble_instruction
  434. (t_program_infos *program, t_axe_label *label, int addr);
  435. #endif