aasmcpu.pas 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. tai_ent = class(tai)
  33. Name : string;
  34. Constructor Create (const ProcName : String);
  35. end;
  36. taicpu = class(tai_cpu_abstract_sym)
  37. constructor op_none(op : tasmop);
  38. constructor op_reg(op : tasmop;_op1 : tregister);
  39. constructor op_const(op : tasmop;_op1 : longint);
  40. constructor op_ref(op : tasmop;_op1 : preference);
  41. constructor op_reg_reg(op : tasmop;_op1,_op2 : tregister);
  42. constructor op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
  43. constructor op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
  44. constructor op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
  45. constructor op_const_const(op : tasmop;_op1,_op2 : longint);
  46. constructor op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
  47. constructor op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
  48. { this is only allowed if _op1 is an int value (_op1^.isintvalue=true) }
  49. constructor op_ref_ref(op : tasmop;_op1,_op2 : preference);
  50. constructor op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
  51. constructor op_reg_const_reg(op : tasmop;_op1 : tregister;_op2 : longint;_op3 : tregister);
  52. constructor op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
  53. constructor op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister; _op3 : preference);
  54. constructor op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
  55. constructor op_reg_ref_const(op : tasmop;_op1 : tregister;_op2 : preference;_op3 : longint);
  56. { this is for Jmp instructions }
  57. constructor op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : tasmsymbol);
  58. constructor op_sym(op : tasmop;_op1 : tasmsymbol);
  59. constructor op_sym_ofs(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint);
  60. constructor op_sym_ofs_reg(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
  61. constructor op_sym_ofs_ref(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : preference);
  62. end;
  63. tai_align = class(tai_align_abstract)
  64. { nothing to add }
  65. end;
  66. procedure InitAsm;
  67. procedure DoneAsm;
  68. implementation
  69. {*****************************************************************************
  70. taicpu Constructors
  71. *****************************************************************************}
  72. constructor taicpu.op_none(op : tasmop);
  73. begin
  74. inherited create(op);
  75. end;
  76. constructor taicpu.op_reg(op : tasmop;_op1 : tregister);
  77. begin
  78. inherited create(op);
  79. ops:=1;
  80. end;
  81. constructor taicpu.op_const(op : tasmop;_op1 : longint);
  82. begin
  83. inherited create(op);
  84. ops:=1;
  85. end;
  86. constructor taicpu.op_ref(op : tasmop;_op1 : preference);
  87. begin
  88. inherited create(op);
  89. ops:=1;
  90. end;
  91. constructor taicpu.op_reg_reg(op : tasmop;_op1,_op2 : tregister);
  92. begin
  93. inherited create(op);
  94. ops:=2;
  95. end;
  96. constructor taicpu.op_reg_const(op:tasmop; _op1: tregister; _op2: longint);
  97. begin
  98. inherited create(op);
  99. ops:=2;
  100. end;
  101. constructor taicpu.op_reg_ref(op : tasmop;_op1 : tregister;_op2 : preference);
  102. begin
  103. inherited create(op);
  104. ops:=2;
  105. end;
  106. constructor taicpu.op_const_reg(op : tasmop;_op1 : longint;_op2 : tregister);
  107. begin
  108. inherited create(op);
  109. ops:=2;
  110. end;
  111. constructor taicpu.op_const_const(op : tasmop;_op1,_op2 : longint);
  112. begin
  113. inherited create(op);
  114. ops:=2;
  115. end;
  116. constructor taicpu.op_const_ref(op : tasmop;_op1 : longint;_op2 : preference);
  117. begin
  118. inherited create(op);
  119. ops:=2;
  120. end;
  121. constructor taicpu.op_ref_reg(op : tasmop;_op1 : preference;_op2 : tregister);
  122. begin
  123. inherited create(op);
  124. ops:=2;
  125. end;
  126. constructor taicpu.op_ref_ref(op : tasmop;_op1,_op2 : preference);
  127. begin
  128. inherited create(op);
  129. ops:=2;
  130. end;
  131. constructor taicpu.op_reg_reg_reg(op : tasmop;_op1,_op2,_op3 : tregister);
  132. begin
  133. inherited create(op);
  134. ops:=3;
  135. end;
  136. constructor taicpu.op_reg_const_reg(op : tasmop;_op1 : tregister;_op2 : longint;_op3 : tregister);
  137. begin
  138. inherited create(op);
  139. ops:=3;
  140. end;
  141. constructor taicpu.op_reg_reg_ref(op : tasmop;_op1,_op2 : tregister;_op3 : preference);
  142. begin
  143. inherited create(op);
  144. ops:=3;
  145. end;
  146. constructor taicpu.op_const_ref_reg(op : tasmop;_op1 : longint;_op2 : preference;_op3 : tregister);
  147. begin
  148. inherited create(op);
  149. ops:=3;
  150. end;
  151. constructor taicpu.op_const_reg_ref(op : tasmop;_op1 : longint;_op2 : tregister;_op3 : preference);
  152. begin
  153. inherited create(op);
  154. ops:=3;
  155. end;
  156. constructor taicpu.op_reg_ref_const(op : tasmop;_op1 : tregister;_op2 : preference;_op3 : longint);
  157. begin
  158. inherited create(op);
  159. ops:=3;
  160. end;
  161. constructor taicpu.op_cond_sym(op : tasmop;cond:TAsmCond;_op1 : tasmsymbol);
  162. begin
  163. inherited create(op);
  164. condition:=cond;
  165. ops:=1;
  166. end;
  167. constructor taicpu.op_sym(op : tasmop;_op1 : tasmsymbol);
  168. begin
  169. inherited create(op);
  170. ops:=1;
  171. end;
  172. constructor taicpu.op_sym_ofs(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint);
  173. begin
  174. inherited create(op);
  175. ops:=1;
  176. end;
  177. constructor taicpu.op_sym_ofs_reg(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : tregister);
  178. begin
  179. inherited create(op);
  180. ops:=2;
  181. end;
  182. constructor taicpu.op_sym_ofs_ref(op : tasmop;_op1 : tasmsymbol;_op1ofs:longint;_op2 : preference);
  183. begin
  184. inherited create(op);
  185. ops:=2;
  186. end;
  187. Constructor tai_frame.create (GP : Tregister; Localsize : Longint; RA : TRegister; L : longint);
  188. begin
  189. Inherited Create;
  190. typ:=ait_frame;
  191. G:=GP;
  192. R:=RA;
  193. LS:=LocalSize;
  194. LU:=L;
  195. end;
  196. Constructor tai_ent.Create (const ProcName : String);
  197. begin
  198. Inherited Create;
  199. typ:=ait_ent;
  200. Name:=ProcName;
  201. end;
  202. procedure InitAsm;
  203. begin
  204. end;
  205. procedure DoneAsm;
  206. begin
  207. end;
  208. end.