symcpu.pas 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. {
  2. Copyright (c) 2014 by Florian Klaempfl
  3. Symbol table overrides for i8086
  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. unit symcpu;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. globtype,
  22. symtype,symdef,symsym,symi86;
  23. type
  24. { defs }
  25. tcpufiledef = class(tfiledef)
  26. end;
  27. tcpuvariantdef = class(tvariantdef)
  28. end;
  29. tcpuformaldef = class(tformaldef)
  30. end;
  31. tcpuforwarddef = class(tforwarddef)
  32. end;
  33. tcpuundefineddef = class(tundefineddef)
  34. end;
  35. tcpuerrordef = class(terrordef)
  36. end;
  37. tcpupointerdef = class(tpointerdef)
  38. end;
  39. tcpurecorddef = class(trecorddef)
  40. end;
  41. tcpuimplementedinterface = class(timplementedinterface)
  42. end;
  43. tcpuobjectdef = class(tobjectdef)
  44. end;
  45. tcpuclassrefdef = class(tclassrefdef)
  46. end;
  47. tcpuarraydef = class(tarraydef)
  48. end;
  49. tcpuorddef = class(torddef)
  50. end;
  51. tcpufloatdef = class(tfloatdef)
  52. end;
  53. tcpuprocvardef = class(tprocvardef)
  54. end;
  55. tcpuprocdef = class(tprocdef)
  56. end;
  57. tcpustringdef = class(tstringdef)
  58. end;
  59. tcpuenumdef = class(tenumdef)
  60. end;
  61. tcpusetdef = class(tsetdef)
  62. end;
  63. { syms }
  64. tcpulabelsym = class(tlabelsym)
  65. end;
  66. tcpuunitsym = class(tunitsym)
  67. end;
  68. tcpunamespacesym = class(tnamespacesym)
  69. end;
  70. tcpuprocsym = class(tprocsym)
  71. end;
  72. tcpuypesym = class(ttypesym)
  73. end;
  74. tcpufieldvarsym = class(tfieldvarsym)
  75. end;
  76. tcpulocalvarsym = class(tlocalvarsym)
  77. end;
  78. tcpuparavarsym = class(tparavarsym)
  79. end;
  80. tcpustaticvarsym = class(tstaticvarsym)
  81. end;
  82. tcpuabsolutevarsym = class(ti86absolutevarsym)
  83. protected
  84. procedure ppuload_platform(ppufile: tcompilerppufile); override;
  85. procedure ppuwrite_platform(ppufile: tcompilerppufile); override;
  86. public
  87. addrsegment : aword;
  88. end;
  89. tcpupropertysym = class(tpropertysym)
  90. end;
  91. tcpuconstsym = class(tconstsym)
  92. end;
  93. tcpuenumsym = class(tenumsym)
  94. end;
  95. tcpusyssym = class(tsyssym)
  96. end;
  97. implementation
  98. procedure tcpuabsolutevarsym.ppuload_platform(ppufile: tcompilerppufile);
  99. begin
  100. inherited;
  101. if absseg then
  102. addrsegment:=ppufile.getaword;
  103. end;
  104. procedure tcpuabsolutevarsym.ppuwrite_platform(ppufile: tcompilerppufile);
  105. begin
  106. inherited;
  107. if absseg then
  108. ppufile.putaword(addrsegment);
  109. end;
  110. begin
  111. { used tdef classes }
  112. cfiledef:=tcpufiledef;
  113. cvariantdef:=tcpuvariantdef;
  114. cformaldef:=tcpuformaldef;
  115. cforwarddef:=tcpuforwarddef;
  116. cundefineddef:=tcpuundefineddef;
  117. cerrordef:=tcpuerrordef;
  118. cpointerdef:=tcpupointerdef;
  119. crecorddef:=tcpurecorddef;
  120. cimplementedinterface:=tcpuimplementedinterface;
  121. cobjectdef:=tcpuobjectdef;
  122. cclassrefdef:=tcpuclassrefdef;
  123. carraydef:=tcpuarraydef;
  124. corddef:=tcpuorddef;
  125. cfloatdef:=tcpufloatdef;
  126. cprocvardef:=tcpuprocvardef;
  127. cprocdef:=tcpuprocdef;
  128. cstringdef:=tcpustringdef;
  129. cenumdef:=tcpuenumdef;
  130. csetdef:=tcpusetdef;
  131. { used tsym classes }
  132. clabelsym:=tcpulabelsym;
  133. cunitsym:=tcpuunitsym;
  134. cnamespacesym:=tcpunamespacesym;
  135. cprocsym:=tcpuprocsym;
  136. ctypesym:=tcpuypesym;
  137. cfieldvarsym:=tcpufieldvarsym;
  138. clocalvarsym:=tcpulocalvarsym;
  139. cparavarsym:=tcpuparavarsym;
  140. cstaticvarsym:=tcpustaticvarsym;
  141. cabsolutevarsym:=tcpuabsolutevarsym;
  142. cpropertysym:=tcpupropertysym;
  143. cconstsym:=tcpuconstsym;
  144. cenumsym:=tcpuenumsym;
  145. csyssym:=tcpusyssym;
  146. end.