aasmcpu.pas 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. {
  2. Copyright (c) 1998-2000 by Florian Klaempfl
  3. Implements the assembler classes specific for the Alpha
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. {
  18. Implements the assembler classes specific for the Alpha.
  19. }
  20. unit aasmcpu;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. aasmbase,globals,verbose,
  25. cpubase,aasmtai,aasmdata,aasmsym;
  26. type
  27. tai_frame = class(tai)
  28. G,R : TRegister;
  29. LS,LU : longint;
  30. Constructor Create (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
  31. end;
  32. taicpu = class(tai_cpu_abstract_sym)
  33. constructor op_none(op : tasmop);
  34. constructor op_reg(op : tasmop;_op1 : tregister);
  35. constructor op_const(op : tasmop;_op1 : longint);
  36. constructor op_ref(op : tasmop;_op1 : preference);
  37. constructor op_reg_reg(op : tasmop;_op1,_op2 : tregister);
  38. constructor op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
  39. constructor op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
  40. constructor op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
  41. constructor op_const_const(op : tasmop;_op1,_op2 : longint);
  42. constructor op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
  43. constructor op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
  44. { this is only allowed if _op1 is an int value (_op1^.isintvalue=true) }
  45. constructor op_ref_ref(op : tasmop;_op1,_op2 : preference);
  46. constructor op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
  47. constructor op_reg_const_reg(op : tasmop;_op1 : tregister;_op2 : longint;_op3 : tregister);
  48. constructor op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
  49. constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; _op3 : preference);
  50. constructor op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
  51. constructor op_reg_ref_const(op : tasmop;_op1 : tregister;_op2 : preference;_op3 : longint);
  52. { this is for Jmp instructions }
  53. constructor op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : tasmsymbol);
  54. constructor op_sym(op : tasmop;_op1 : tasmsymbol);
  55. constructor op_sym_ofs(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint);
  56. constructor op_sym_ofs_reg(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
  57. constructor op_sym_ofs_ref(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : preference);
  58. end;
  59. tai_align = class(tai_align_abstract)
  60. { nothing to add }
  61. end;
  62. procedure InitAsm;
  63. procedure DoneAsm;
  64. implementation
  65. {*****************************************************************************
  66. taicpu Constructors
  67. *****************************************************************************}
  68. constructor taicpu.op_none(op : tasmop);
  69. begin
  70. inherited create(op);
  71. end;
  72. constructor taicpu.op_reg(op : tasmop;_op1 : tregister);
  73. begin
  74. inherited create(op);
  75. ops:=1;
  76. end;
  77. constructor taicpu.op_const(op : tasmop;_op1 : longint);
  78. begin
  79. inherited create(op);
  80. ops:=1;
  81. end;
  82. constructor taicpu.op_ref(op : tasmop;_op1 : preference);
  83. begin
  84. inherited create(op);
  85. ops:=1;
  86. end;
  87. constructor taicpu.op_reg_reg(op : tasmop;_op1,_op2 : tregister);
  88. begin
  89. inherited create(op);
  90. ops:=2;
  91. end;
  92. constructor taicpu.op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
  93. begin
  94. inherited create(op);
  95. ops:=2;
  96. end;
  97. constructor taicpu.op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
  98. begin
  99. inherited create(op);
  100. ops:=2;
  101. end;
  102. constructor taicpu.op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
  103. begin
  104. inherited create(op);
  105. ops:=2;
  106. end;
  107. constructor taicpu.op_const_const(op : tasmop;_op1,_op2 : longint);
  108. begin
  109. inherited create(op);
  110. ops:=2;
  111. end;
  112. constructor taicpu.op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
  113. begin
  114. inherited create(op);
  115. ops:=2;
  116. end;
  117. constructor taicpu.op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
  118. begin
  119. inherited create(op);
  120. ops:=2;
  121. end;
  122. constructor taicpu.op_ref_ref(op : tasmop;_op1,_op2 : preference);
  123. begin
  124. inherited create(op);
  125. ops:=2;
  126. end;
  127. constructor taicpu.op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
  128. begin
  129. inherited create(op);
  130. ops:=3;
  131. end;
  132. constructor taicpu.op_reg_const_reg(op : tasmop;_op1 : tregister;_op2 : longint;_op3 : tregister);
  133. begin
  134. inherited create(op);
  135. ops:=3;
  136. end;
  137. constructor taicpu.op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister;_op3 : preference);
  138. begin
  139. inherited create(op);
  140. ops:=3;
  141. end;
  142. constructor taicpu.op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
  143. begin
  144. inherited create(op);
  145. ops:=3;
  146. end;
  147. constructor taicpu.op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
  148. begin
  149. inherited create(op);
  150. ops:=3;
  151. end;
  152. constructor taicpu.op_reg_ref_const(op : tasmop;_op1 : tregister;_op2 : preference;_op3 : longint);
  153. begin
  154. inherited create(op);
  155. ops:=3;
  156. end;
  157. constructor taicpu.op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : tasmsymbol);
  158. begin
  159. inherited create(op);
  160. condition:=cond;
  161. ops:=1;
  162. end;
  163. constructor taicpu.op_sym(op : tasmop;_op1 : tasmsymbol);
  164. begin
  165. inherited create(op);
  166. ops:=1;
  167. end;
  168. constructor taicpu.op_sym_ofs(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint);
  169. begin
  170. inherited create(op);
  171. ops:=1;
  172. end;
  173. constructor taicpu.op_sym_ofs_reg(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
  174. begin
  175. inherited create(op);
  176. ops:=2;
  177. end;
  178. constructor taicpu.op_sym_ofs_ref(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : preference);
  179. begin
  180. inherited create(op);
  181. ops:=2;
  182. end;
  183. Constructor tai_frame.create (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
  184. begin
  185. Inherited Create;
  186. typ:=ait_frame;
  187. G:=GP;
  188. R:=RA;
  189. LS:=LocalSize;
  190. LU:=L;
  191. end;
  192. procedure InitAsm;
  193. begin
  194. end;
  195. procedure DoneAsm;
  196. begin
  197. end;
  198. end.