aasm.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by Florian Klaempfl
  4. This unit implements an abstract asmoutput class for all processor types
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit aasm;
  19. interface
  20. uses
  21. cobjects,files,globals;
  22. type
  23. {$ifdef i386}
  24. {$ifndef VER0_99_5}
  25. bestreal = extended;
  26. {$else}
  27. bestreal = double;
  28. {$endif}
  29. {$endif}
  30. {$ifdef m68k}
  31. bestreal = real;
  32. {$endif}
  33. pbestreal=^bestreal;
  34. tait = (
  35. ait_string,
  36. ait_label,
  37. ait_direct,
  38. ait_labeled_instruction,
  39. ait_comment,
  40. ait_instruction,
  41. ait_datablock,
  42. ait_symbol,
  43. ait_const_32bit,
  44. ait_const_symbol,
  45. ait_const_16bit,
  46. ait_const_8bit,
  47. ait_real_64bit,
  48. ait_real_32bit,
  49. ait_real_extended,
  50. ait_comp,
  51. ait_external,
  52. ait_align,
  53. ait_section,
  54. { the following is only used by the win32 version of the compiler }
  55. { and only the GNU AS Win32 is able to write it }
  56. ait_const_rva,
  57. ait_stabn,
  58. ait_stabs,
  59. ait_stab_function_name,
  60. ait_cut, { used to split into tiny assembler files }
  61. ait_regalloc,
  62. ait_regdealloc,
  63. ait_marker,
  64. { never used, makes insertation of new ait_ easier to type }
  65. ait_dummy);
  66. type
  67. { the short name makes typing easier }
  68. pai = ^tai;
  69. tai = object(tlinkedlist_item)
  70. typ : tait;
  71. fileinfo : tfileposinfo;
  72. constructor init;
  73. end;
  74. pai_string = ^tai_string;
  75. tai_string = object(tai)
  76. str : pchar;
  77. { extra len so the string can contain an \0 }
  78. len : longint;
  79. constructor init(const _str : string);
  80. constructor init_pchar(_str : pchar);
  81. constructor init_length_pchar(_str : pchar;length : longint);
  82. destructor done;virtual;
  83. end;
  84. { generates a common label }
  85. pai_symbol = ^tai_symbol;
  86. tai_symbol = object(tai)
  87. name : pchar;
  88. is_global : boolean;
  89. constructor init(const _name : string);
  90. constructor init_global(const _name : string);
  91. destructor done;virtual;
  92. end;
  93. { external types defined for TASM }
  94. { EXT_ANY for search purposes }
  95. texternal_typ = (EXT_ANY,EXT_NEAR, EXT_FAR, EXT_PROC, EXT_BYTE,
  96. EXT_WORD, EXT_DWORD, EXT_CODEPTR, EXT_DATAPTR,
  97. EXT_FWORD, EXT_PWORD, EXT_QWORD, EXT_TBYTE, EXT_ABS);
  98. { generates an symbol which is marked as external }
  99. pai_external = ^tai_external;
  100. tai_external = object(tai)
  101. name : pchar;
  102. exttyp : texternal_typ;
  103. constructor init(const _name : string;exttype : texternal_typ);
  104. destructor done; virtual;
  105. end;
  106. { type for a temporary label test if used for dispose of
  107. unnecessary labels }
  108. plabel = ^tlabel;
  109. tlabel = record
  110. nb : longint;
  111. is_data : boolean;
  112. is_used : boolean;
  113. is_set : boolean;
  114. refcount : word;
  115. end;
  116. pai_label = ^tai_label;
  117. tai_label = object(tai)
  118. l : plabel;
  119. constructor init(_l : plabel);
  120. destructor done; virtual;
  121. end;
  122. pai_direct = ^tai_direct;
  123. tai_direct = object(tai)
  124. str : pchar;
  125. constructor init(_str : pchar);
  126. destructor done; virtual;
  127. end;
  128. { to insert a comment into the generated assembler file }
  129. pai_asm_comment = ^tai_asm_comment;
  130. tai_asm_comment = object(tai)
  131. str : pchar;
  132. constructor init(_str : pchar);
  133. destructor done; virtual;
  134. end;
  135. { alignment for operator }
  136. pai_align = ^tai_align;
  137. tai_align = object(tai)
  138. aligntype: byte; { 1 = no align, 2 = word align, 4 = dword align }
  139. op: byte; { value to fill with - optional }
  140. constructor init(b:byte);
  141. constructor init_op(b: byte; use_op: byte);
  142. destructor done;virtual;
  143. end;
  144. tsection=(sec_none,sec_code,sec_data,sec_bss,sec_idata);
  145. { Insert a section/segment directive }
  146. pai_section = ^tai_section;
  147. tai_section = object(tai)
  148. sec : tsection;
  149. idataidx : longint;
  150. constructor init(s : tsection);
  151. constructor init_idata(i:longint);
  152. destructor done;virtual;
  153. end;
  154. { generates an uninitializised data block }
  155. pai_datablock = ^tai_datablock;
  156. tai_datablock = object(tai)
  157. size : longint;
  158. name : pchar;
  159. is_global : boolean;
  160. constructor init(const _name : string;_size : longint);
  161. constructor init_global(const _name : string;_size : longint);
  162. destructor done; virtual;
  163. end;
  164. { generates a long integer (32 bit) }
  165. pai_const = ^tai_const;
  166. tai_const = object(tai)
  167. value : longint;
  168. constructor init_32bit(_value : longint);
  169. constructor init_16bit(_value : word);
  170. constructor init_8bit(_value : byte);
  171. constructor init_symbol(p : pchar);
  172. constructor init_rva(p : pchar);
  173. destructor done;virtual;
  174. end;
  175. { generates a double (64 bit real) }
  176. pai_double = ^tai_double;
  177. tai_double = object(tai)
  178. value : double;
  179. constructor init(_value : double);
  180. end;
  181. { generates an comp (integer over 64 bits) }
  182. pai_comp = ^tai_comp;
  183. tai_comp = object(tai)
  184. value : bestreal;
  185. constructor init(_value : bestreal);
  186. { usefull for 64 bits apps, maybe later }
  187. constructor init_comp(_value : comp);
  188. end;
  189. { generates a single (32 bit real) }
  190. pai_single = ^tai_single;
  191. tai_single = object(tai)
  192. value : single;
  193. constructor init(_value : single);
  194. end;
  195. { generates an extended (80 bit real) }
  196. pai_extended = ^tai_extended;
  197. tai_extended = object(tai)
  198. value : bestreal;
  199. constructor init(_value : bestreal);
  200. end;
  201. { insert a cut to split into several smaller files }
  202. pai_cut = ^tai_cut;
  203. tai_cut = object(tai)
  204. endname : boolean;
  205. constructor init;
  206. constructor init_end;
  207. end;
  208. TMarker = (NoPropInfoStart, NoPropInfoEnd);
  209. pai_marker = ^tai_marker;
  210. tai_marker = object(tai)
  211. Kind: TMarker;
  212. Constructor init(_Kind: TMarker);
  213. end;
  214. { for each processor define the best precision }
  215. { bestreal is defined in globals }
  216. {$ifdef i386}
  217. const
  218. ait_bestreal = ait_real_extended;
  219. type
  220. pai_bestreal = pai_extended;
  221. tai_bestreal = tai_extended;
  222. {$endif i386}
  223. {$ifdef m68k}
  224. const
  225. ait_bestreal = ait_real_32bit;
  226. type
  227. pai_bestreal = pai_single;
  228. tai_bestreal = tai_single;
  229. {$endif m68k}
  230. paasmoutput = ^taasmoutput;
  231. taasmoutput = object(tlinkedlist)
  232. function getlasttaifilepos : pfileposinfo;
  233. end;
  234. var
  235. { temporary lists }
  236. exprasmlist,
  237. { default lists }
  238. datasegment,codesegment,bsssegment,
  239. internals,externals,debuglist,consts,
  240. importssection,exportssection,
  241. resourcesection,rttilist : paasmoutput;
  242. { external symbols without repetition }
  243. function search_assembler_symbol(pl : paasmoutput;const _name : string;exttype : texternal_typ) : pai_external;
  244. procedure concat_external(const _name : string;exttype : texternal_typ);
  245. procedure concat_internal(const _name : string;exttype : texternal_typ);
  246. { label functions }
  247. const
  248. nextlabelnr : longint = 1;
  249. countlabelref : boolean = true;
  250. { convert label to string}
  251. function lab2str(l : plabel) : string;
  252. { make l as a new label }
  253. procedure getlabel(var l : plabel);
  254. { make l as a new label and flag is_data }
  255. procedure getdatalabel(var l : plabel);
  256. { frees the label if unused }
  257. procedure freelabel(var l : plabel);
  258. { make a new zero label }
  259. procedure getzerolabel(var l : plabel);
  260. { reset a label to a zero label }
  261. procedure setzerolabel(var l : plabel);
  262. {just get a label number }
  263. procedure getlabelnr(var l : longint);
  264. implementation
  265. uses
  266. strings,verbose,systems;
  267. {****************************************************************************
  268. TAI
  269. ****************************************************************************}
  270. constructor tai.init;
  271. begin
  272. fileinfo:=aktfilepos;
  273. end;
  274. {****************************************************************************
  275. TAI_SECTION
  276. ****************************************************************************}
  277. constructor tai_section.init(s : tsection);
  278. begin
  279. inherited init;
  280. typ:=ait_section;
  281. sec:=s;
  282. idataidx:=0;
  283. end;
  284. constructor tai_section.init_idata(i:longint);
  285. begin
  286. inherited init;
  287. typ:=ait_section;
  288. sec:=sec_idata;
  289. idataidx:=i;
  290. end;
  291. destructor tai_section.done;
  292. begin
  293. inherited done;
  294. end;
  295. {****************************************************************************
  296. TAI_DATABLOCK
  297. ****************************************************************************}
  298. constructor tai_datablock.init(const _name : string;_size : longint);
  299. begin
  300. inherited init;
  301. typ:=ait_datablock;
  302. name:=strpnew(_name);
  303. concat_internal(_name,EXT_ANY);
  304. size:=_size;
  305. is_global:=false;
  306. end;
  307. constructor tai_datablock.init_global(const _name : string;_size : longint);
  308. begin
  309. inherited init;
  310. typ:=ait_datablock;
  311. name:=strpnew(_name);
  312. concat_internal(_name,EXT_ANY);
  313. size:=_size;
  314. is_global:=true;
  315. end;
  316. destructor tai_datablock.done;
  317. begin
  318. strdispose(name);
  319. inherited done;
  320. end;
  321. {****************************************************************************
  322. TAI_SYMBOL
  323. ****************************************************************************}
  324. constructor tai_symbol.init(const _name : string);
  325. begin
  326. inherited init;
  327. typ:=ait_symbol;
  328. name:=strpnew(_name);
  329. concat_internal(_name,EXT_ANY);
  330. is_global:=false;
  331. end;
  332. constructor tai_symbol.init_global(const _name : string);
  333. begin
  334. inherited init;
  335. typ:=ait_symbol;
  336. name:=strpnew(_name);
  337. concat_internal(_name,EXT_ANY);
  338. is_global:=true;
  339. end;
  340. destructor tai_symbol.done;
  341. begin
  342. strdispose(name);
  343. inherited done;
  344. end;
  345. {****************************************************************************
  346. TAI_EXTERNAL
  347. ****************************************************************************}
  348. constructor tai_external.init(const _name : string;exttype : texternal_typ);
  349. begin
  350. inherited init;
  351. typ:=ait_external;
  352. exttyp:=exttype;
  353. name:=strpnew(_name);
  354. end;
  355. destructor tai_external.done;
  356. begin
  357. strdispose(name);
  358. inherited done;
  359. end;
  360. {****************************************************************************
  361. TAI_CONST
  362. ****************************************************************************}
  363. constructor tai_const.init_32bit(_value : longint);
  364. begin
  365. inherited init;
  366. typ:=ait_const_32bit;
  367. value:=_value;
  368. end;
  369. constructor tai_const.init_16bit(_value : word);
  370. begin
  371. inherited init;
  372. typ:=ait_const_16bit;
  373. value:=_value;
  374. end;
  375. constructor tai_const.init_8bit(_value : byte);
  376. begin
  377. inherited init;
  378. typ:=ait_const_8bit;
  379. value:=_value;
  380. end;
  381. constructor tai_const.init_symbol(p : pchar);
  382. begin
  383. inherited init;
  384. typ:=ait_const_symbol;
  385. value:=longint(p);
  386. end;
  387. constructor tai_const.init_rva(p : pchar);
  388. begin
  389. inherited init;
  390. typ:=ait_const_rva;
  391. value:=longint(p);
  392. end;
  393. destructor tai_const.done;
  394. begin
  395. if typ=ait_const_symbol then
  396. strdispose(pchar(value));
  397. inherited done;
  398. end;
  399. {****************************************************************************
  400. TAI_DOUBLE
  401. ****************************************************************************}
  402. constructor tai_double.init(_value : double);
  403. begin
  404. inherited init;
  405. typ:=ait_real_64bit;
  406. value:=_value;
  407. end;
  408. {****************************************************************************
  409. TAI_SINGLE
  410. ****************************************************************************}
  411. constructor tai_single.init(_value : single);
  412. begin
  413. inherited init;
  414. typ:=ait_real_32bit;
  415. value:=_value;
  416. end;
  417. {****************************************************************************
  418. TAI_EXTENDED
  419. ****************************************************************************}
  420. constructor tai_extended.init(_value : bestreal);
  421. begin
  422. inherited init;
  423. typ:=ait_real_extended;
  424. value:=_value;
  425. end;
  426. {****************************************************************************
  427. TAI_COMP
  428. ****************************************************************************}
  429. constructor tai_comp.init(_value : bestreal);
  430. begin
  431. inherited init;
  432. typ:=ait_comp;
  433. value:=_value;
  434. end;
  435. constructor tai_comp.init_comp(_value : comp);
  436. begin
  437. inherited init;
  438. typ:=ait_comp;
  439. value:=_value;
  440. end;
  441. {****************************************************************************
  442. TAI_STRING
  443. ****************************************************************************}
  444. constructor tai_string.init(const _str : string);
  445. begin
  446. inherited init;
  447. typ:=ait_string;
  448. getmem(str,length(_str)+1);
  449. strpcopy(str,_str);
  450. len:=length(_str);
  451. end;
  452. constructor tai_string.init_pchar(_str : pchar);
  453. begin
  454. inherited init;
  455. typ:=ait_string;
  456. str:=_str;
  457. len:=strlen(_str);
  458. end;
  459. constructor tai_string.init_length_pchar(_str : pchar;length : longint);
  460. begin
  461. inherited init;
  462. typ:=ait_string;
  463. str:=_str;
  464. len:=length;
  465. end;
  466. destructor tai_string.done;
  467. begin
  468. { you can have #0 inside the strings so }
  469. if str<>nil then
  470. freemem(str,len+1);
  471. inherited done;
  472. end;
  473. {****************************************************************************
  474. TAI_LABEL
  475. ****************************************************************************}
  476. constructor tai_label.init(_l : plabel);
  477. begin
  478. inherited init;
  479. typ:=ait_label;
  480. l:=_l;
  481. l^.is_set:=true;
  482. end;
  483. destructor tai_label.done;
  484. begin
  485. if (l^.is_used) then
  486. l^.is_set:=false
  487. else
  488. dispose(l);
  489. inherited done;
  490. end;
  491. {****************************************************************************
  492. TAI_DIRECT
  493. ****************************************************************************}
  494. constructor tai_direct.init(_str : pchar);
  495. begin
  496. inherited init;
  497. typ:=ait_direct;
  498. str:=_str;
  499. end;
  500. destructor tai_direct.done;
  501. begin
  502. strdispose(str);
  503. inherited done;
  504. end;
  505. {****************************************************************************
  506. TAI_ASM_COMMENT comment to be inserted in the assembler file
  507. ****************************************************************************}
  508. constructor tai_asm_comment.init(_str : pchar);
  509. begin
  510. inherited init;
  511. typ:=ait_comment;
  512. str:=_str;
  513. end;
  514. destructor tai_asm_comment.done;
  515. begin
  516. strdispose(str);
  517. inherited done;
  518. end;
  519. {****************************************************************************
  520. TAI_ALIGN
  521. ****************************************************************************}
  522. constructor tai_align.init(b: byte);
  523. begin
  524. inherited init;
  525. typ:=ait_align;
  526. if b in [1,2,4,8,16] then
  527. aligntype := b
  528. else
  529. aligntype := 1;
  530. op:=0;
  531. end;
  532. constructor tai_align.init_op(b: byte; use_op: byte);
  533. begin
  534. inherited init;
  535. typ:=ait_align;
  536. if b in [1,2,4,8,16] then
  537. aligntype := b
  538. else
  539. aligntype := 1;
  540. op:=use_op;
  541. end;
  542. destructor tai_align.done;
  543. begin
  544. inherited done;
  545. end;
  546. {****************************************************************************
  547. TAI_CUT
  548. ****************************************************************************}
  549. constructor tai_cut.init;
  550. begin
  551. inherited init;
  552. typ:=ait_cut;
  553. endname:=false;
  554. end;
  555. constructor tai_cut.init_end;
  556. begin
  557. inherited init;
  558. typ:=ait_cut;
  559. endname:=true;
  560. end;
  561. {****************************************************************************
  562. Tai_Marker
  563. ****************************************************************************}
  564. Constructor Tai_Marker.Init(_Kind: TMarker);
  565. Begin
  566. Inherited Init;
  567. typ := ait_marker;
  568. Kind := _Kind;
  569. End;
  570. {*****************************************************************************
  571. External Helpers
  572. *****************************************************************************}
  573. function search_assembler_symbol(pl : paasmoutput;const _name : string;exttype : texternal_typ) : pai_external;
  574. var
  575. p : pai;
  576. begin
  577. search_assembler_symbol:=nil;
  578. if pl=nil then
  579. internalerror(2001)
  580. else
  581. begin
  582. p:=pai(pl^.first);
  583. while (p<>nil) and
  584. (p<>pai(pl^.last)) do
  585. { if we get the same name with a different typ }
  586. { there is probably an error }
  587. if (p^.typ=ait_external) and
  588. ((exttype=EXT_ANY) or (pai_external(p)^.exttyp=exttype)) and
  589. (strpas(pai_external(p)^.name)=_name) then
  590. begin
  591. search_assembler_symbol:=pai_external(p);
  592. exit;
  593. end
  594. else
  595. p:=pai(p^.next);
  596. if (p<>nil) and
  597. (p^.typ=ait_external) and
  598. (pai_external(p)^.exttyp=exttype) and
  599. (strpas(pai_external(p)^.name)=_name) then
  600. begin
  601. search_assembler_symbol:=pai_external(p);
  602. exit;
  603. end;
  604. end;
  605. end;
  606. { insert each need external only once }
  607. procedure concat_external(const _name : string;exttype : texternal_typ);
  608. begin
  609. if not target_asm.externals then
  610. exit;
  611. if search_assembler_symbol(externals,_name,exttype)=nil then
  612. externals^.concat(new(pai_external,init(_name,exttype)));
  613. end;
  614. { insert each need internal only once }
  615. procedure concat_internal(const _name : string;exttype : texternal_typ);
  616. begin
  617. if not target_asm.externals then
  618. exit;
  619. if search_assembler_symbol(internals,_name,exttype)=nil then
  620. internals^.concat(new(pai_external,init(_name,exttype)));
  621. end;
  622. {*****************************************************************************
  623. Label Helpers
  624. *****************************************************************************}
  625. function lab2str(l : plabel) : string;
  626. begin
  627. if (l=nil) or (l^.nb=0) then
  628. begin
  629. {$ifdef EXTDEBUG}
  630. lab2str:='ILLEGAL'
  631. {$else EXTDEBUG}
  632. internalerror(2000);
  633. {$endif EXTDEBUG}
  634. end
  635. else
  636. begin
  637. if (l^.is_data) and (cs_smartlink in aktmoduleswitches) then
  638. lab2str:='_$'+current_module^.modulename^+'$_L'+tostr(l^.nb)
  639. else
  640. lab2str:=target_asm.labelprefix+tostr(l^.nb);
  641. end;
  642. { inside the WriteTree we must not count the refs PM }
  643. if countlabelref then
  644. inc(l^.refcount);
  645. l^.is_used:=true;
  646. end;
  647. procedure getlabel(var l : plabel);
  648. begin
  649. new(l);
  650. l^.nb:=nextlabelnr;
  651. l^.is_used:=false;
  652. l^.is_set:=false;
  653. l^.is_data:=false;
  654. l^.refcount:=0;
  655. inc(nextlabelnr);
  656. end;
  657. procedure getdatalabel(var l : plabel);
  658. begin
  659. new(l);
  660. l^.nb:=nextlabelnr;
  661. l^.is_used:=false;
  662. l^.is_set:=false;
  663. l^.is_data:=true;
  664. l^.refcount:=0;
  665. inc(nextlabelnr);
  666. end;
  667. procedure freelabel(var l : plabel);
  668. begin
  669. if (l<>nil) and (not l^.is_set) and (not l^.is_used) then
  670. dispose(l);
  671. l:=nil;
  672. end;
  673. procedure setzerolabel(var l : plabel);
  674. begin
  675. with l^ do
  676. begin
  677. nb:=0;
  678. is_used:=false;
  679. is_set:=false;
  680. is_data:=false;
  681. refcount:=0;
  682. end;
  683. end;
  684. procedure getzerolabel(var l : plabel);
  685. begin
  686. new(l);
  687. l^.nb:=0;
  688. l^.is_used:=false;
  689. l^.is_set:=false;
  690. l^.is_data:=false;
  691. l^.refcount:=0;
  692. end;
  693. procedure getlabelnr(var l : longint);
  694. begin
  695. l:=nextlabelnr;
  696. inc(nextlabelnr);
  697. end;
  698. function taasmoutput.getlasttaifilepos : pfileposinfo;
  699. begin
  700. if assigned(last) then
  701. getlasttaifilepos:=@pai(last)^.fileinfo
  702. else
  703. getlasttaifilepos:=nil;
  704. end;
  705. end.
  706. {
  707. $Log$
  708. Revision 1.20 1998-10-06 17:16:31 pierre
  709. * some memory leaks fixed (thanks to Peter for heaptrc !)
  710. Revision 1.19 1998/10/01 20:19:11 jonas
  711. + ait_marker support
  712. Revision 1.18 1998/09/20 17:11:25 jonas
  713. * released REGALLOC
  714. Revision 1.17 1998/09/07 18:33:31 peter
  715. + smartlinking for win95 imports
  716. Revision 1.16 1998/09/03 17:08:37 pierre
  717. * better lines for stabs
  718. (no scroll back to if before else part
  719. no return to case line at jump outside case)
  720. + source lines also if not in order
  721. Revision 1.15 1998/08/11 15:31:36 peter
  722. * write extended to ppu file
  723. * new version 0.99.7
  724. Revision 1.14 1998/08/10 23:56:03 peter
  725. * fixed extended writing
  726. Revision 1.13 1998/08/10 14:49:33 peter
  727. + localswitches, moduleswitches, globalswitches splitting
  728. Revision 1.12 1998/07/14 14:46:36 peter
  729. * released NEWINPUT
  730. Revision 1.11 1998/07/07 11:19:50 peter
  731. + NEWINPUT for a better inputfile and scanner object
  732. Revision 1.10 1998/06/08 22:59:41 peter
  733. * smartlinking works for win32
  734. * some defines to exclude some compiler parts
  735. Revision 1.9 1998/06/04 23:51:26 peter
  736. * m68k compiles
  737. + .def file creation moved to gendef.pas so it could also be used
  738. for win32
  739. Revision 1.8 1998/05/23 01:20:53 peter
  740. + aktasmmode, aktoptprocessor, aktoutputformat
  741. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  742. + $LIBNAME to set the library name where the unit will be put in
  743. * splitted cgi386 a bit (codeseg to large for bp7)
  744. * nasm, tasm works again. nasm moved to ag386nsm.pas
  745. Revision 1.7 1998/05/07 00:16:59 peter
  746. * smartlinking for sets
  747. + consts labels are now concated/generated in hcodegen
  748. * moved some cpu code to cga and some none cpu depended code from cga
  749. to tree and hcodegen and cleanup of hcodegen
  750. * assembling .. output reduced for smartlinking ;)
  751. Revision 1.6 1998/05/06 18:36:53 peter
  752. * tai_section extended with code,data,bss sections and enumerated type
  753. * ident 'compiled by FPC' moved to pmodules
  754. * small fix for smartlink
  755. Revision 1.5 1998/05/01 07:43:52 florian
  756. + basics for rtti implemented
  757. + switch $m (generate rtti for published sections)
  758. Revision 1.4 1998/04/29 10:33:40 pierre
  759. + added some code for ansistring (not complete nor working yet)
  760. * corrected operator overloading
  761. * corrected nasm output
  762. + started inline procedures
  763. + added starstarn : use ** for exponentiation (^ gave problems)
  764. + started UseTokenInfo cond to get accurate positions
  765. Revision 1.3 1998/04/27 23:10:27 peter
  766. + new scanner
  767. * $makelib -> if smartlink
  768. * small filename fixes pmodule.setfilename
  769. * moved import from files.pas -> import.pas
  770. Revision 1.2 1998/04/09 15:46:37 florian
  771. + register allocation tracing stuff added
  772. }