ag386att.pas 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by the FPC development team
  4. This unit implements an asmoutput class for i386 AT&T syntax
  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. {$ifdef TP}
  19. {$N+,E+}
  20. {$endif}
  21. unit ag386att;
  22. interface
  23. uses cobjects,aasm,assemble;
  24. type
  25. pi386attasmlist=^ti386attasmlist;
  26. ti386attasmlist=object(tasmlist)
  27. procedure WriteTree(p:paasmoutput);virtual;
  28. procedure WriteAsmList;virtual;
  29. {$ifdef GDB}
  30. procedure WriteFileLineInfo(var fileinfo : tfileposinfo);
  31. {$endif}
  32. end;
  33. implementation
  34. uses
  35. {$ifdef Delphi}
  36. dmisc,
  37. {$else Delphi}
  38. dos,
  39. {$endif Delphi}
  40. strings,
  41. globtype,globals,systems,
  42. files,verbose,cpubase,cpuasm
  43. {$ifdef GDB}
  44. ,gdb
  45. {$endif GDB}
  46. ;
  47. const
  48. line_length = 70;
  49. var
  50. {$ifdef GDB}
  51. n_line : byte; { different types of source lines }
  52. linecount,
  53. includecount : longint;
  54. funcname : pchar;
  55. stabslastfileinfo : tfileposinfo;
  56. {$endif}
  57. lastsec : tsection; { last section type written }
  58. lastfileinfo : tfileposinfo;
  59. infile,
  60. lastinfile : pinputfile;
  61. symendcount : longint;
  62. function fixline(s:string):string;
  63. {
  64. return s with all leading and ending spaces and tabs removed
  65. }
  66. var
  67. i,j,k : longint;
  68. begin
  69. i:=length(s);
  70. while (i>0) and (s[i] in [#9,' ']) do
  71. dec(i);
  72. j:=1;
  73. while (j<i) and (s[j] in [#9,' ']) do
  74. inc(j);
  75. for k:=j to i do
  76. if s[k] in [#0..#31,#127..#255] then
  77. s[k]:='.';
  78. fixline:=Copy(s,j,i-j+1);
  79. end;
  80. function single2str(d : single) : string;
  81. var
  82. hs : string;
  83. begin
  84. str(d,hs);
  85. { replace space with + }
  86. if hs[1]=' ' then
  87. hs[1]:='+';
  88. single2str:='0d'+hs
  89. end;
  90. function double2str(d : double) : string;
  91. var
  92. hs : string;
  93. begin
  94. str(d,hs);
  95. { replace space with + }
  96. if hs[1]=' ' then
  97. hs[1]:='+';
  98. double2str:='0d'+hs
  99. end;
  100. function extended2str(e : extended) : string;
  101. var
  102. hs : string;
  103. begin
  104. str(e,hs);
  105. { replace space with + }
  106. if hs[1]=' ' then
  107. hs[1]:='+';
  108. extended2str:='0d'+hs
  109. end;
  110. type
  111. pdouble = ^double;
  112. function comp2str(d : bestreal) : string;
  113. var
  114. c : comp;
  115. dd : pdouble;
  116. begin
  117. {$ifdef FPC}
  118. c:=comp(d);
  119. {$else}
  120. c:=d;
  121. {$endif}
  122. dd:=pdouble(@c); { this makes a bitwise copy of c into a double }
  123. comp2str:=double2str(dd^);
  124. end;
  125. function getreferencestring(var ref : treference) : string;
  126. var
  127. s : string;
  128. begin
  129. if ref.is_immediate then
  130. begin
  131. internalerror(1000101);
  132. exit;
  133. end
  134. else
  135. begin
  136. with ref do
  137. begin
  138. inc(offset,offsetfixup);
  139. offsetfixup:=0;
  140. { have we a segment prefix ? }
  141. { These are probably not correctly handled under GAS }
  142. { should be replaced by coding the segment override }
  143. { directly! - DJGPP FAQ }
  144. if segment<>R_NO then
  145. s:=att_reg2str[segment]+':'
  146. else
  147. s:='';
  148. if assigned(symbol) then
  149. s:=s+symbol^.name;
  150. if offset<0 then
  151. s:=s+tostr(offset)
  152. else
  153. if (offset>0) then
  154. begin
  155. if assigned(symbol) then
  156. s:=s+'+'+tostr(offset)
  157. else
  158. s:=s+tostr(offset);
  159. end;
  160. if (index<>R_NO) and (base=R_NO) then
  161. Begin
  162. s:=s+'(,'+att_reg2str[index];
  163. if scalefactor<>0 then
  164. s:=s+','+tostr(scalefactor)+')'
  165. else
  166. s:=s+')';
  167. end
  168. else
  169. if (index=R_NO) and (base<>R_NO) then
  170. s:=s+'('+att_reg2str[base]+')'
  171. else
  172. if (index<>R_NO) and (base<>R_NO) then
  173. Begin
  174. s:=s+'('+att_reg2str[base]+','+att_reg2str[index];
  175. if scalefactor<>0 then
  176. s:=s+','+tostr(scalefactor)+')'
  177. else
  178. s := s+')';
  179. end;
  180. end;
  181. end;
  182. getreferencestring:=s;
  183. end;
  184. function getopstr(const o:toper) : string;
  185. var
  186. hs : string;
  187. begin
  188. case o.typ of
  189. top_reg :
  190. getopstr:=att_reg2str[o.reg];
  191. top_ref :
  192. getopstr:=getreferencestring(o.ref^);
  193. top_const :
  194. getopstr:='$'+tostr(o.val);
  195. top_symbol :
  196. begin
  197. if assigned(o.sym) then
  198. hs:='$'+o.sym^.name
  199. else
  200. hs:='$';
  201. if o.symofs>0 then
  202. hs:=hs+'+'+tostr(o.symofs)
  203. else
  204. if o.symofs<0 then
  205. hs:=hs+tostr(o.symofs)
  206. else
  207. if not(assigned(o.sym)) then
  208. hs:=hs+'0';
  209. getopstr:=hs;
  210. end;
  211. else
  212. internalerror(10001);
  213. end;
  214. end;
  215. function getopstr_jmp(const o:toper) : string;
  216. var
  217. hs : string;
  218. begin
  219. case o.typ of
  220. top_reg :
  221. getopstr_jmp:='*'+att_reg2str[o.reg];
  222. top_ref :
  223. getopstr_jmp:='*'+getreferencestring(o.ref^);
  224. top_const :
  225. getopstr_jmp:=tostr(o.val);
  226. top_symbol :
  227. begin
  228. hs:=o.sym^.name;
  229. if o.symofs>0 then
  230. hs:=hs+'+'+tostr(o.symofs)
  231. else
  232. if o.symofs<0 then
  233. hs:=hs+tostr(o.symofs);
  234. getopstr_jmp:=hs;
  235. end;
  236. else
  237. internalerror(10001);
  238. end;
  239. end;
  240. {****************************************************************************
  241. TI386ATTASMOUTPUT
  242. ****************************************************************************}
  243. const
  244. ait_const2str : array[ait_const_32bit..ait_const_8bit] of string[8]=
  245. (#9'.long'#9,#9'.short'#9,#9'.byte'#9);
  246. function ait_section2str(s:tsection):string;
  247. begin
  248. ait_section2str:=target_asm.secnames[s];
  249. {$ifdef GDB}
  250. { this is needed for line info in data }
  251. funcname:=nil;
  252. case s of
  253. sec_code : n_line:=n_textline;
  254. sec_data : n_line:=n_dataline;
  255. sec_bss : n_line:=n_bssline;
  256. else n_line:=n_dataline;
  257. end;
  258. {$endif GDB}
  259. LastSec:=s;
  260. end;
  261. {$ifdef GDB}
  262. procedure ti386attasmlist.WriteFileLineInfo(var fileinfo : tfileposinfo);
  263. var
  264. curr_n : byte;
  265. begin
  266. if not (cs_debuginfo in aktmoduleswitches) then
  267. exit;
  268. { file changed ? (must be before line info) }
  269. if (fileinfo.fileindex<>0) and
  270. (stabslastfileinfo.fileindex<>fileinfo.fileindex) then
  271. begin
  272. infile:=current_module^.sourcefiles^.get_file(fileinfo.fileindex);
  273. if assigned(infile) then
  274. begin
  275. if includecount=0 then
  276. curr_n:=n_sourcefile
  277. else
  278. curr_n:=n_includefile;
  279. if (infile^.path^<>'') then
  280. begin
  281. AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^,false)))+'",'+
  282. tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
  283. end;
  284. AsmWriteLn(#9'.stabs "'+lower(FixFileName(infile^.name^))+'",'+
  285. tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
  286. AsmWriteLn('Ltext'+ToStr(IncludeCount)+':');
  287. inc(includecount);
  288. end;
  289. end;
  290. { line changed ? }
  291. if (stabslastfileinfo.line<>fileinfo.line) and (fileinfo.line<>0) then
  292. begin
  293. if (n_line=n_textline) and assigned(funcname) and
  294. (target_os.use_function_relative_addresses) then
  295. begin
  296. AsmWriteLn(target_asm.labelprefix+'l'+tostr(linecount)+':');
  297. AsmWrite(#9'.stabn '+tostr(n_line)+',0,'+tostr(fileinfo.line)+','+
  298. target_asm.labelprefix+'l'+tostr(linecount)+' - ');
  299. AsmWritePChar(FuncName);
  300. AsmLn;
  301. inc(linecount);
  302. end
  303. else
  304. AsmWriteLn(#9'.stabd'#9+tostr(n_line)+',0,'+tostr(fileinfo.line));
  305. end;
  306. stabslastfileinfo:=fileinfo;
  307. end;
  308. {$endif GDB}
  309. procedure ti386attasmlist.WriteTree(p:paasmoutput);
  310. const
  311. allocstr : array[boolean] of string[10]=(' released',' allocated');
  312. nolinetai =[ait_label,
  313. ait_regalloc,ait_tempalloc,
  314. ait_stabn,ait_stabs,ait_section,
  315. ait_cut,ait_marker,ait_align,ait_stab_function_name];
  316. type
  317. t80bitarray = array[0..9] of byte;
  318. t64bitarray = array[0..7] of byte;
  319. t32bitarray = array[0..3] of byte;
  320. var
  321. ch : char;
  322. hp : pai;
  323. consttyp : tait;
  324. s : string;
  325. found : boolean;
  326. i,pos,l : longint;
  327. co : comp;
  328. sin : single;
  329. d : double;
  330. e : extended;
  331. op : tasmop;
  332. calljmp,
  333. do_line : boolean;
  334. sep : char;
  335. begin
  336. if not assigned(p) then
  337. exit;
  338. { lineinfo is only needed for codesegment (PFV) }
  339. do_line:=(cs_asm_source in aktglobalswitches) or
  340. ((cs_lineinfo in aktmoduleswitches) and (p=codesegment));
  341. hp:=pai(p^.first);
  342. while assigned(hp) do
  343. begin
  344. aktfilepos:=hp^.fileinfo;
  345. if not(hp^.typ in nolinetai) then
  346. begin
  347. {$ifdef GDB}
  348. { write stabs }
  349. if cs_debuginfo in aktmoduleswitches then
  350. WriteFileLineInfo(hp^.fileinfo);
  351. {$endif GDB}
  352. if do_line then
  353. begin
  354. { load infile }
  355. if lastfileinfo.fileindex<>hp^.fileinfo.fileindex then
  356. begin
  357. infile:=current_module^.sourcefiles^.get_file(hp^.fileinfo.fileindex);
  358. if assigned(infile) then
  359. begin
  360. { open only if needed !! }
  361. if (cs_asm_source in aktglobalswitches) then
  362. infile^.open;
  363. end;
  364. { avoid unnecessary reopens of the same file !! }
  365. lastfileinfo.fileindex:=hp^.fileinfo.fileindex;
  366. { be sure to change line !! }
  367. lastfileinfo.line:=-1;
  368. end;
  369. { write source }
  370. if (cs_asm_source in aktglobalswitches) and
  371. assigned(infile) then
  372. begin
  373. if (infile<>lastinfile) then
  374. begin
  375. AsmWriteLn(target_asm.comment+'['+infile^.name^+']');
  376. if assigned(lastinfile) then
  377. lastinfile^.close;
  378. end;
  379. if (hp^.fileinfo.line<>lastfileinfo.line) and
  380. (hp^.fileinfo.line<infile^.maxlinebuf) then
  381. begin
  382. if (hp^.fileinfo.line<>0) and
  383. (infile^.linebuf^[hp^.fileinfo.line]>=0) then
  384. AsmWriteLn(target_asm.comment+'['+tostr(hp^.fileinfo.line)+'] '+
  385. fixline(infile^.GetLineStr(hp^.fileinfo.line)));
  386. { set it to a negative value !
  387. to make that is has been read already !! PM }
  388. infile^.linebuf^[hp^.fileinfo.line]:=-infile^.linebuf^[hp^.fileinfo.line]-1;
  389. end;
  390. end;
  391. {$ifdef LINEINFO}
  392. { lineinfo }
  393. if (cs_lineinfo in aktmoduleswitches) then
  394. begin
  395. if (infile<>lastinfile) then
  396. begin
  397. lineinfolist^.concat(new(pai_const(init_8bit
  398. end
  399. else
  400. begin
  401. end;
  402. end;
  403. {$endif LINEINFO}
  404. lastfileinfo:=hp^.fileinfo;
  405. lastinfile:=infile;
  406. end;
  407. end;
  408. case hp^.typ of
  409. ait_comment :
  410. Begin
  411. AsmWrite(target_asm.comment);
  412. AsmWritePChar(pai_asm_comment(hp)^.str);
  413. AsmLn;
  414. End;
  415. ait_regalloc :
  416. begin
  417. if (cs_asm_regalloc in aktglobalswitches) then
  418. AsmWriteLn(target_asm.comment+'Register '+att_reg2str[pairegalloc(hp)^.reg]+
  419. allocstr[pairegalloc(hp)^.allocation]);
  420. end;
  421. ait_tempalloc :
  422. begin
  423. if (cs_asm_tempalloc in aktglobalswitches) then
  424. AsmWriteLn(target_asm.comment+'Temp '+tostr(paitempalloc(hp)^.temppos)+','+
  425. tostr(paitempalloc(hp)^.tempsize)+allocstr[paitempalloc(hp)^.allocation]);
  426. end;
  427. ait_align :
  428. begin
  429. AsmWrite(#9'.balign '+tostr(pai_align(hp)^.aligntype));
  430. if pai_align(hp)^.use_op then
  431. AsmWrite(','+tostr(pai_align(hp)^.fillop));
  432. AsmLn;
  433. end;
  434. ait_section :
  435. begin
  436. if pai_section(hp)^.sec<>sec_none then
  437. begin
  438. AsmLn;
  439. AsmWriteLn(ait_section2str(pai_section(hp)^.sec));
  440. {$ifdef GDB}
  441. lastfileinfo.line:=-1;
  442. {$endif GDB}
  443. end;
  444. end;
  445. ait_datablock :
  446. begin
  447. if pai_datablock(hp)^.is_global then
  448. AsmWrite(#9'.comm'#9)
  449. else
  450. AsmWrite(#9'.lcomm'#9);
  451. AsmWrite(pai_datablock(hp)^.sym^.name);
  452. AsmWriteLn(','+tostr(pai_datablock(hp)^.size));
  453. end;
  454. ait_const_32bit,
  455. ait_const_16bit,
  456. ait_const_8bit :
  457. begin
  458. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  459. consttyp:=hp^.typ;
  460. l:=0;
  461. repeat
  462. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  463. if found then
  464. begin
  465. hp:=Pai(hp^.next);
  466. s:=','+tostr(pai_const(hp)^.value);
  467. AsmWrite(s);
  468. inc(l,length(s));
  469. end;
  470. until (not found) or (l>line_length);
  471. AsmLn;
  472. end;
  473. ait_const_symbol :
  474. begin
  475. AsmWrite(#9'.long'#9+pai_const_symbol(hp)^.sym^.name);
  476. if pai_const_symbol(hp)^.offset>0 then
  477. AsmWrite('+'+tostr(pai_const_symbol(hp)^.offset))
  478. else if pai_const_symbol(hp)^.offset<0 then
  479. AsmWrite(tostr(pai_const_symbol(hp)^.offset));
  480. AsmLn;
  481. end;
  482. ait_const_rva :
  483. AsmWriteLn(#9'.rva'#9+pai_const_symbol(hp)^.sym^.name);
  484. ait_real_80bit :
  485. begin
  486. if do_line then
  487. AsmWriteLn(target_asm.comment+extended2str(pai_real_80bit(hp)^.value));
  488. { Make sure e is a extended type, bestreal could be
  489. a different type (bestreal) !! (PFV) }
  490. e:=pai_real_80bit(hp)^.value;
  491. AsmWrite(#9'.byte'#9);
  492. for i:=0 to 9 do
  493. begin
  494. if i<>0 then
  495. AsmWrite(',');
  496. AsmWrite(tostr(t80bitarray(e)[i]));
  497. end;
  498. AsmLn;
  499. end;
  500. ait_real_64bit :
  501. begin
  502. if do_line then
  503. AsmWriteLn(target_asm.comment+double2str(pai_real_64bit(hp)^.value));
  504. d:=pai_real_64bit(hp)^.value;
  505. AsmWrite(#9'.byte'#9);
  506. for i:=0 to 7 do
  507. begin
  508. if i<>0 then
  509. AsmWrite(',');
  510. AsmWrite(tostr(t64bitarray(d)[i]));
  511. end;
  512. AsmLn;
  513. end;
  514. ait_real_32bit :
  515. begin
  516. if do_line then
  517. AsmWriteLn(target_asm.comment+single2str(pai_real_32bit(hp)^.value));
  518. sin:=pai_real_32bit(hp)^.value;
  519. AsmWrite(#9'.byte'#9);
  520. for i:=0 to 3 do
  521. begin
  522. if i<>0 then
  523. AsmWrite(',');
  524. AsmWrite(tostr(t32bitarray(sin)[i]));
  525. end;
  526. AsmLn;
  527. end;
  528. ait_comp_64bit :
  529. begin
  530. if do_line then
  531. AsmWriteLn(target_asm.comment+comp2str(pai_comp_64bit(hp)^.value));
  532. AsmWrite(#9'.byte'#9);
  533. {$ifdef FPC}
  534. co:=comp(pai_comp_64bit(hp)^.value);
  535. {$else}
  536. co:=pai_comp_64bit(hp)^.value;
  537. {$endif}
  538. for i:=0 to 7 do
  539. begin
  540. if i<>0 then
  541. AsmWrite(',');
  542. AsmWrite(tostr(t64bitarray(co)[i]));
  543. end;
  544. AsmLn;
  545. end;
  546. ait_direct :
  547. begin
  548. AsmWritePChar(pai_direct(hp)^.str);
  549. AsmLn;
  550. {$IfDef GDB}
  551. if strpos(pai_direct(hp)^.str,'.data')<>nil then
  552. n_line:=n_dataline
  553. else if strpos(pai_direct(hp)^.str,'.text')<>nil then
  554. n_line:=n_textline
  555. else if strpos(pai_direct(hp)^.str,'.bss')<>nil then
  556. n_line:=n_bssline;
  557. {$endif GDB}
  558. end;
  559. ait_string :
  560. begin
  561. pos:=0;
  562. for i:=1 to pai_string(hp)^.len do
  563. begin
  564. if pos=0 then
  565. begin
  566. AsmWrite(#9'.ascii'#9'"');
  567. pos:=20;
  568. end;
  569. ch:=pai_string(hp)^.str[i-1];
  570. case ch of
  571. #0, {This can't be done by range, because a bug in FPC}
  572. #1..#31,
  573. #128..#255 : s:='\'+tostr(ord(ch) shr 6)+tostr((ord(ch) and 63) shr 3)+tostr(ord(ch) and 7);
  574. '"' : s:='\"';
  575. '\' : s:='\\';
  576. else
  577. s:=ch;
  578. end;
  579. AsmWrite(s);
  580. inc(pos,length(s));
  581. if (pos>line_length) or (i=pai_string(hp)^.len) then
  582. begin
  583. AsmWriteLn('"');
  584. pos:=0;
  585. end;
  586. end;
  587. end;
  588. ait_label :
  589. begin
  590. if (pai_label(hp)^.l^.is_used) then
  591. begin
  592. if pai_label(hp)^.l^.typ=AS_GLOBAL then
  593. begin
  594. AsmWrite('.globl'#9);
  595. AsmWriteLn(pai_label(hp)^.l^.name);
  596. end;
  597. AsmWrite(pai_label(hp)^.l^.name);
  598. AsmWriteLn(':');
  599. end;
  600. end;
  601. ait_symbol :
  602. begin
  603. if pai_symbol(hp)^.is_global then
  604. begin
  605. AsmWrite('.globl'#9);
  606. AsmWriteLn(pai_symbol(hp)^.sym^.name);
  607. end;
  608. if target_info.target=target_i386_linux then
  609. begin
  610. AsmWrite(#9'.type'#9);
  611. AsmWrite(pai_symbol(hp)^.sym^.name);
  612. if assigned(pai(hp^.next)) and
  613. (pai(hp^.next)^.typ in [ait_const_symbol,ait_const_rva,
  614. ait_const_32bit,ait_const_16bit,ait_const_8bit,ait_datablock,
  615. ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit]) then
  616. AsmWriteLn(',@object')
  617. else
  618. AsmWriteLn(',@function');
  619. if pai_symbol(hp)^.sym^.size>0 then
  620. begin
  621. AsmWrite(#9'.size'#9);
  622. AsmWrite(pai_symbol(hp)^.sym^.name);
  623. AsmWrite(', ');
  624. AsmWriteLn(tostr(pai_symbol(hp)^.sym^.size));
  625. end;
  626. end;
  627. AsmWrite(pai_symbol(hp)^.sym^.name);
  628. AsmWriteLn(':');
  629. end;
  630. ait_symbol_end :
  631. begin
  632. if target_info.target=target_i386_linux then
  633. begin
  634. s:=target_asm.labelprefix+'e'+tostr(symendcount);
  635. inc(symendcount);
  636. AsmWriteLn(s+':');
  637. AsmWrite(#9'.size'#9);
  638. AsmWrite(pai_symbol(hp)^.sym^.name);
  639. AsmWrite(', '+s+' - ');
  640. AsmWriteLn(pai_symbol(hp)^.sym^.name);
  641. end;
  642. end;
  643. ait_instruction :
  644. begin
  645. op:=paicpu(hp)^.opcode;
  646. calljmp:=is_calljmp(op);
  647. { call maybe not translated to call }
  648. s:=#9+att_op2str[op]+cond2str[paicpu(hp)^.condition];
  649. if (not calljmp) and
  650. (att_needsuffix[op]) and
  651. not(
  652. (paicpu(hp)^.oper[0].typ=top_reg) and
  653. (paicpu(hp)^.oper[0].reg in [R_ST..R_ST7])
  654. ) then
  655. s:=s+att_opsize2str[paicpu(hp)^.opsize];
  656. { process operands }
  657. if paicpu(hp)^.ops<>0 then
  658. begin
  659. { call and jmp need an extra handling }
  660. { this code is only called if jmp isn't a labeled instruction }
  661. { quick hack to overcome a problem with manglednames=255 chars }
  662. if calljmp then
  663. begin
  664. AsmWrite(s+#9);
  665. s:=+getopstr_jmp(paicpu(hp)^.oper[0]);
  666. end
  667. else
  668. begin
  669. for i:=0 to paicpu(hp)^.ops-1 do
  670. begin
  671. if i=0 then
  672. sep:=#9
  673. else
  674. sep:=',';
  675. s:=s+sep+getopstr(paicpu(hp)^.oper[i])
  676. end;
  677. end;
  678. end;
  679. AsmWriteLn(s);
  680. end;
  681. {$ifdef GDB}
  682. ait_stabs :
  683. begin
  684. AsmWrite(#9'.stabs ');
  685. AsmWritePChar(pai_stabs(hp)^.str);
  686. AsmLn;
  687. end;
  688. ait_stabn :
  689. begin
  690. AsmWrite(#9'.stabn ');
  691. AsmWritePChar(pai_stabn(hp)^.str);
  692. AsmLn;
  693. end;
  694. ait_force_line :
  695. stabslastfileinfo.line:=0;
  696. ait_stab_function_name:
  697. funcname:=pai_stab_function_name(hp)^.str;
  698. {$endif GDB}
  699. ait_cut :
  700. begin
  701. if SmartAsm then
  702. begin
  703. { only reset buffer if nothing has changed }
  704. if AsmSize=AsmStartSize then
  705. AsmClear
  706. else
  707. begin
  708. AsmClose;
  709. DoAssemble;
  710. AsmCreate(pai_cut(hp)^.place);
  711. end;
  712. { avoid empty files }
  713. while assigned(hp^.next) and (pai(hp^.next)^.typ in [ait_cut,ait_section,ait_comment]) do
  714. begin
  715. if pai(hp^.next)^.typ=ait_section then
  716. lastsec:=pai_section(hp^.next)^.sec;
  717. hp:=pai(hp^.next);
  718. end;
  719. {$ifdef GDB}
  720. { force write of filename }
  721. FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
  722. includecount:=0;
  723. funcname:=nil;
  724. WriteFileLineInfo(hp^.fileinfo);
  725. {$endif GDB}
  726. if lastsec<>sec_none then
  727. AsmWriteLn(ait_section2str(lastsec));
  728. AsmStartSize:=AsmSize;
  729. end;
  730. end;
  731. ait_marker :
  732. ;
  733. else
  734. internalerror(10000);
  735. end;
  736. hp:=pai(hp^.next);
  737. end;
  738. end;
  739. procedure ti386attasmlist.WriteAsmList;
  740. var
  741. p:dirstr;
  742. n:namestr;
  743. e:extstr;
  744. {$ifdef GDB}
  745. fileinfo : tfileposinfo;
  746. {$endif GDB}
  747. begin
  748. {$ifdef EXTDEBUG}
  749. if assigned(current_module^.mainsource) then
  750. Comment(v_info,'Start writing att-styled assembler output for '+current_module^.mainsource^);
  751. {$endif}
  752. LastSec:=sec_none;
  753. {$ifdef GDB}
  754. FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
  755. {$endif GDB}
  756. FillChar(lastfileinfo,sizeof(lastfileinfo),0);
  757. LastInfile:=nil;
  758. if assigned(current_module^.mainsource) then
  759. fsplit(current_module^.mainsource^,p,n,e)
  760. else
  761. begin
  762. p:=inputdir;
  763. n:=inputfile;
  764. e:=inputextension;
  765. end;
  766. { to get symify to work }
  767. AsmWriteLn(#9'.file "'+FixFileName(n+e)+'"');
  768. {$ifdef GDB}
  769. n_line:=n_bssline;
  770. funcname:=nil;
  771. linecount:=1;
  772. includecount:=0;
  773. fileinfo.fileindex:=1;
  774. fileinfo.line:=1;
  775. { Write main file }
  776. WriteFileLineInfo(fileinfo);
  777. {$endif GDB}
  778. AsmStartSize:=AsmSize;
  779. symendcount:=0;
  780. countlabelref:=false;
  781. If (cs_debuginfo in aktmoduleswitches) then
  782. WriteTree(debuglist);
  783. WriteTree(codesegment);
  784. WriteTree(datasegment);
  785. WriteTree(consts);
  786. WriteTree(rttilist);
  787. Writetree(resourcestringlist);
  788. WriteTree(bsssegment);
  789. Writetree(importssection);
  790. { exports are written by DLLTOOL
  791. if we use it so don't insert it twice (PM) }
  792. if not RelocSection then
  793. Writetree(exportssection);
  794. Writetree(resourcesection);
  795. countlabelref:=true;
  796. AsmLn;
  797. {$ifdef EXTDEBUG}
  798. if assigned(current_module^.mainsource) then
  799. comment(v_info,'Done writing att-styled assembler output for '+current_module^.mainsource^);
  800. {$endif EXTDEBUG}
  801. end;
  802. end.
  803. {
  804. $Log$
  805. Revision 1.19 1999-11-02 15:06:56 peter
  806. * import library fixes for win32
  807. * alignment works again
  808. Revision 1.18 1999/10/27 16:11:28 peter
  809. * insns.dat is used to generate all i386*.inc files
  810. Revision 1.17 1999/09/27 23:36:33 peter
  811. * fixed -al with macro's
  812. Revision 1.16 1999/09/21 20:53:21 florian
  813. * fixed 1/s problem from mailing list
  814. Revision 1.15 1999/09/19 20:55:11 florian
  815. * fixed calls to procedures with manglednames=255 chars
  816. (taking the address of such a procedure would still cause a problem!)
  817. Revision 1.14 1999/09/10 18:48:00 florian
  818. * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
  819. * most things for stored properties fixed
  820. Revision 1.13 1999/09/02 17:07:38 florian
  821. * problems with -Or fixed: tdef.isfpuregable was wrong!
  822. Revision 1.12 1999/08/25 16:03:46 peter
  823. * symbol name is now written using separate asmwrite() calls to overcome
  824. > 255 char strings
  825. Revision 1.11 1999/08/25 11:59:32 jonas
  826. * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
  827. Revision 1.10 1999/08/13 15:44:57 peter
  828. * first things to include lineinfo in the executable
  829. Revision 1.9 1999/08/10 12:26:20 pierre
  830. * avoid double .edata section if using DLLTOOL
  831. Revision 1.8 1999/08/04 00:22:34 florian
  832. * renamed i386asm and i386base to cpuasm and cpubase
  833. Revision 1.7 1999/07/30 12:26:07 peter
  834. * write .size only for linux
  835. Revision 1.6 1999/07/29 20:53:56 peter
  836. * write .size also
  837. Revision 1.5 1999/07/22 09:37:29 florian
  838. + resourcestring implemented
  839. + start of longstring support
  840. Revision 1.4 1999/07/18 10:19:38 florian
  841. * made it compilable with Dlephi 4 again
  842. + fixed problem with large stack allocations on win32
  843. Revision 1.3 1999/07/03 00:27:04 peter
  844. * better smartlinking support
  845. Revision 1.2 1999/06/22 15:25:14 peter
  846. * merged
  847. Revision 1.1.2.1 1999/06/22 15:23:08 peter
  848. * reinserted
  849. Revision 1.100 1999/06/22 14:41:20 peter
  850. * merged
  851. Revision 1.99 1999/06/14 17:47:44 peter
  852. * merged
  853. Revision 1.97.2.3 1999/06/22 14:40:27 peter
  854. * small change to fpureg check
  855. Revision 1.97.2.2 1999/06/22 14:20:19 peter
  856. * fixed parsing and writing of fpureg
  857. Revision 1.97.2.1 1999/06/14 17:30:41 peter
  858. * align fixes from pierre
  859. Revision 1.98 1999/06/11 22:54:10 pierre
  860. * .align problem treated :
  861. .align is considered as .p2align on go32v1 and go32v2
  862. and as .balign on other targets
  863. + ra386att supports also .balign and .p2align
  864. * ag386att uses .balign allways
  865. Revision 1.97 1999/06/09 23:00:06 peter
  866. * small ansistring fixes
  867. * val_ansistr_sint destsize changed to longint
  868. * don't write low/hi ascii with -al
  869. Revision 1.96 1999/06/06 15:53:13 peter
  870. * suffix adding can be turned of for some tasmops in att_nosuffix array
  871. Revision 1.95 1999/05/27 19:43:56 peter
  872. * removed oldasm
  873. * plabel -> pasmlabel
  874. * -a switches to source writing automaticly
  875. * assembler readers OOPed
  876. * asmsymbol automaticly external
  877. * jumptables and other label fixes for asm readers
  878. Revision 1.94 1999/05/23 18:41:54 florian
  879. * better error recovering in typed constants
  880. * some problems with arrays of const fixed, some problems
  881. due my previous
  882. - the location type of array constructor is now LOC_MEM
  883. - the pushing of high fixed
  884. - parameter copying fixed
  885. - zero temp. allocation removed
  886. * small problem in the assembler writers fixed:
  887. ref to nil wasn't written correctly
  888. Revision 1.93 1999/05/21 13:54:39 peter
  889. * NEWLAB for label as symbol
  890. Revision 1.92 1999/05/16 17:03:05 peter
  891. * better file position info
  892. Revision 1.91 1999/05/12 00:19:36 peter
  893. * removed R_DEFAULT_SEG
  894. * uniform float names
  895. Revision 1.90 1999/05/08 19:52:31 peter
  896. + MessagePos() which is enhanced Message() function but also gets the
  897. position info
  898. * Removed comp warnings
  899. Revision 1.89 1999/05/07 00:38:22 pierre
  900. * comp fixes 2
  901. Revision 1.88 1999/05/07 00:09:35 pierre
  902. * better comp output
  903. Revision 1.87 1999/05/06 09:05:06 peter
  904. * generic write_float and str_float
  905. * fixed constant float conversions
  906. Revision 1.86 1999/05/04 21:44:29 florian
  907. * changes to compile it with Delphi 4.0
  908. Revision 1.85 1999/05/02 23:29:57 peter
  909. * readded condition, becuase it's needed for set<cond> and cmov<cond> !
  910. Revision 1.84 1999/05/02 22:41:47 peter
  911. * moved section names to systems
  912. * fixed nasm,intel writer
  913. Revision 1.83 1999/05/02 21:33:51 florian
  914. * several bugs regarding -Or fixed
  915. Revision 1.82 1999/05/01 13:47:51 peter
  916. * fix hack for fsub
  917. Revision 1.81 1999/05/01 13:23:56 peter
  918. * merged nasm compiler
  919. * old asm moved to oldasm/
  920. Revision 1.80 1999/04/17 22:17:04 pierre
  921. * ifdef USE_OP3 released (changed into ifndef NO_OP3)
  922. * SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
  923. Revision 1.79 1999/04/16 11:49:37 peter
  924. + tempalloc
  925. + -at to show temp alloc info in .s file
  926. Revision 1.78 1999/04/16 10:00:54 pierre
  927. + ifdef USE_OP3 code :
  928. added all missing op_... constructors for taicpu needed
  929. for SHRD,SHLD and IMUL code in assembler readers
  930. (check in tests/tbs0123.pp)
  931. Revision 1.77 1999/04/14 12:44:46 daniel
  932. * Proper fix for the .bss conflict
  933. Revision 1.76 1999/04/14 11:43:25 michael
  934. + reverted back to .section .bss
  935. Revision 1.75 1999/04/13 08:45:33 daniel
  936. * EMX assembler prefers .bss instead of .section .bss
  937. Revision 1.74 1999/04/10 16:14:59 peter
  938. * fixed browcol
  939. + -ar to show regalloc info in .s file
  940. Revision 1.73 1999/04/09 08:33:45 peter
  941. * write * before register with call for the stricter as versions
  942. Revision 1.72 1999/03/31 13:55:02 peter
  943. * assembler inlining working for ag386bin
  944. Revision 1.71 1999/03/29 16:05:42 peter
  945. * optimizer working for ag386bin
  946. Revision 1.70 1999/03/10 21:48:21 florian
  947. * bug0218 fixed, ag386att writes now all real types as byte
  948. sequences to minimize rouding error, in -al mode the
  949. value is written as comment
  950. Revision 1.69 1999/03/10 13:25:43 pierre
  951. section order changed to get closer output from coff writer
  952. Revision 1.68 1999/03/02 02:56:09 peter
  953. + stabs support for binary writers
  954. * more fixes and missing updates from the previous commit :(
  955. Revision 1.67 1999/03/01 15:46:15 peter
  956. * ag386bin finally make cycles correct
  957. * prefixes are now also normal opcodes
  958. Revision 1.66 1999/02/26 00:48:12 peter
  959. * assembler writers fixed for ag386bin
  960. Revision 1.65 1999/02/25 21:02:17 peter
  961. * ag386bin updates
  962. + coff writer
  963. Revision 1.64 1999/02/22 02:14:57 peter
  964. * updates for ag386bin
  965. Revision 1.63 1999/02/17 10:16:25 peter
  966. * small fixes for the binary writer
  967. Revision 1.62 1999/01/12 14:21:26 peter
  968. * fixed pushw warning
  969. Revision 1.61 1998/12/29 18:50:04 jonas
  970. * don't write debug info if not (cs_debuginfo in aktmoduleswitches)
  971. Revision 1.60 1998/12/23 22:53:43 peter
  972. * don't count ait_marker for lineinfo
  973. Revision 1.58 1998/12/11 00:02:38 peter
  974. + globtype,tokens,version unit splitted from globals
  975. Revision 1.57 1998/12/01 23:36:32 pierre
  976. * zero padded alignment was buggy
  977. Revision 1.56 1998/12/01 11:19:37 peter
  978. * fixed range problem with in [tasmop]
  979. Revision 1.55 1998/11/30 09:42:53 pierre
  980. * some range check bugs fixed (still not working !)
  981. + added DLL writing support for win32 (also accepts variables)
  982. + TempAnsi for code that could be used for Temporary ansi strings
  983. handling
  984. Revision 1.54 1998/11/17 10:04:13 pierre
  985. * zero indexed file not searched
  986. Revision 1.53 1998/11/17 00:26:08 peter
  987. * fixed for $H+
  988. Revision 1.52 1998/11/12 11:19:32 pierre
  989. * fix for first line of function break
  990. Revision 1.51 1998/11/09 09:21:18 pierre
  991. * fix for stabs line infos
  992. Revision 1.50 1998/11/06 09:49:25 pierre
  993. * n_line stuff cleaned
  994. Revision 1.49 1998/10/26 23:07:02 peter
  995. * fixpath fix
  996. Revision 1.48 1998/10/15 15:08:39 pierre
  997. * removed lots of unnecessary inputfile system.open calls
  998. (made a big speed decrease on go32v2 !)
  999. Revision 1.47 1998/10/13 14:01:05 peter
  1000. * fixed -al
  1001. Revision 1.46 1998/10/13 13:10:07 peter
  1002. * new style for m68k/i386 infos and enums
  1003. Revision 1.45 1998/10/12 12:20:39 pierre
  1004. + added tai_const_symbol_offset
  1005. for r : pointer = @var.field;
  1006. * better message for different arg names on implementation
  1007. of function
  1008. Revision 1.44 1998/10/06 17:16:32 pierre
  1009. * some memory leaks fixed (thanks to Peter for heaptrc !)
  1010. Revision 1.43 1998/10/01 20:19:12 jonas
  1011. + ait_marker support
  1012. Revision 1.42 1998/09/28 16:57:08 pierre
  1013. * changed all length(p^.value_str^) into str_length(p)
  1014. to get it work with and without ansistrings
  1015. * changed sourcefiles field of tmodule to a pointer
  1016. Revision 1.41 1998/09/20 17:11:19 jonas
  1017. * released REGALLOC
  1018. Revision 1.40 1998/09/16 17:58:34 jonas
  1019. * fixed -dRegAlloc and -dDRegalloc problems
  1020. Revision 1.39 1998/09/11 11:30:41 pierre
  1021. -al -g option bug corrected
  1022. Revision 1.38.2.1 1998/09/11 10:49:09 pierre
  1023. * bug with -g -al option removed
  1024. Revision 1.38 1998/09/07 22:23:35 peter
  1025. * fixed for no gdb compiler
  1026. Revision 1.37 1998/09/07 18:33:34 peter
  1027. + smartlinking for win95 imports
  1028. Revision 1.36 1998/09/04 17:34:19 pierre
  1029. * bug with datalabel corrected
  1030. + assembler errors better commented
  1031. * one nested record crash removed
  1032. Revision 1.35 1998/09/03 17:08:38 pierre
  1033. * better lines for stabs
  1034. (no scroll back to if before else part
  1035. no return to case line at jump outside case)
  1036. + source lines also if not in order
  1037. Revision 1.34 1998/09/03 11:22:41 peter
  1038. + support for cs_asm_source
  1039. Revision 1.33 1998/08/26 10:06:33 peter
  1040. * reduce amount of asmfiles generated
  1041. * no stabs are written in writefilelineinfo when debuginfo is off
  1042. Revision 1.32 1998/08/20 09:26:35 pierre
  1043. + funcret setting in underproc testing
  1044. compile with _dTEST_FUNCRET
  1045. Revision 1.31 1998/08/11 14:01:16 peter
  1046. * @object type also for extended and comp
  1047. Revision 1.30 1998/08/10 23:56:02 peter
  1048. * fixed extended writing
  1049. Revision 1.29 1998/08/10 14:49:35 peter
  1050. + localswitches, moduleswitches, globalswitches splitting
  1051. Revision 1.27 1998/08/08 12:30:07 florian
  1052. * extended writing improved
  1053. Revision 1.26 1998/08/08 10:19:16 florian
  1054. * small fixes to write the extended type correct
  1055. Revision 1.28 1998/08/10 10:01:33 peter
  1056. * Fixed with GDB undefined
  1057. Revision 1.25 1998/08/06 16:53:25 pierre
  1058. * debugging info corrected
  1059. Revision 1.24 1998/07/14 14:46:37 peter
  1060. * released NEWINPUT
  1061. Revision 1.23 1998/07/07 11:19:51 peter
  1062. + NEWINPUT for a better inputfile and scanner object
  1063. Revision 1.22 1998/06/08 22:59:42 peter
  1064. * smartlinking works for win32
  1065. * some defines to exclude some compiler parts
  1066. Revision 1.21 1998/06/05 17:46:01 peter
  1067. * tp doesn't like comp() typecast
  1068. Revision 1.20 1998/06/04 23:51:27 peter
  1069. * m68k compiles
  1070. + .def file creation moved to gendef.pas so it could also be used
  1071. for win32
  1072. Revision 1.19 1998/05/31 14:13:29 peter
  1073. * fixed call bugs with assembler readers
  1074. + OPR_SYMBOL to hold a symbol in the asm parser
  1075. * fixed staticsymtable vars which were acessed through %ebp instead of
  1076. name
  1077. Revision 1.18 1998/05/28 17:24:25 peter
  1078. - $R- for tp to solve range errors with in[]
  1079. Revision 1.17 1998/05/25 17:11:34 pierre
  1080. * firstpasscount bug fixed
  1081. now all is already set correctly the first time
  1082. under EXTDEBUG try -gp to skip all other firstpasses
  1083. it works !!
  1084. * small bug fixes
  1085. - for smallsets with -dTESTSMALLSET
  1086. - some warnings removed (by correcting code !)
  1087. Revision 1.16 1998/05/23 01:20:54 peter
  1088. + aktasmmode, aktoptprocessor, aktoutputformat
  1089. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1090. + $LIBNAME to set the library name where the unit will be put in
  1091. * splitted cgi386 a bit (codeseg to large for bp7)
  1092. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1093. Revision 1.15 1998/05/11 13:07:53 peter
  1094. + $ifdef NEWPPU for the new ppuformat
  1095. + $define GDB not longer required
  1096. * removed all warnings and stripped some log comments
  1097. * no findfirst/findnext anymore to remove smartlink *.o files
  1098. Revision 1.14 1998/05/06 18:36:53 peter
  1099. * tai_section extended with code,data,bss sections and enumerated type
  1100. * ident 'compiled by FPC' moved to pmodules
  1101. * small fix for smartlink
  1102. Revision 1.13 1998/05/06 08:38:32 pierre
  1103. * better position info with UseTokenInfo
  1104. UseTokenInfo greatly simplified
  1105. + added check for changed tree after first time firstpass
  1106. (if we could remove all the cases were it happen
  1107. we could skip all firstpass if firstpasscount > 1)
  1108. Only with ExtDebug
  1109. Revision 1.12 1998/05/04 17:54:24 peter
  1110. + smartlinking works (only case jumptable left todo)
  1111. * redesign of systems.pas to support assemblers and linkers
  1112. + Unitname is now also in the PPU-file, increased version to 14
  1113. Revision 1.11 1998/05/01 07:43:52 florian
  1114. + basics for rtti implemented
  1115. + switch $m (generate rtti for published sections)
  1116. Revision 1.10 1998/04/30 15:59:39 pierre
  1117. * GDB works again better :
  1118. correct type info in one pass
  1119. + UseTokenInfo for better source position
  1120. * fixed one remaining bug in scanner for line counts
  1121. * several little fixes
  1122. Revision 1.9 1998/04/29 10:33:41 pierre
  1123. + added some code for ansistring (not complete nor working yet)
  1124. * corrected operator overloading
  1125. * corrected nasm output
  1126. + started inline procedures
  1127. + added starstarn : use ** for exponentiation (^ gave problems)
  1128. + started UseTokenInfo cond to get accurate positions
  1129. Revision 1.8 1998/04/28 08:23:58 pierre
  1130. * bug in stabn generation fixed
  1131. Revision 1.7 1998/04/27 23:10:27 peter
  1132. + new scanner
  1133. * $makelib -> if smartlink
  1134. * small filename fixes pmodule.setfilename
  1135. * moved import from files.pas -> import.pas
  1136. Revision 1.6 1998/04/21 11:30:13 peter
  1137. * fixed $ifdef regalloc
  1138. Revision 1.5 1998/04/16 16:53:24 jonas
  1139. * changed $ifdef regalloc to $ifdef dregalloc (= debugging info)
  1140. Revision 1.4 1998/04/09 15:46:38 florian
  1141. + register allocation tracing stuff added
  1142. Revision 1.3 1998/04/08 16:58:00 pierre
  1143. * several bugfixes
  1144. ADD ADC and AND are also sign extended
  1145. nasm output OK (program still crashes at end
  1146. and creates wrong assembler files !!)
  1147. procsym types sym in tdef removed !!
  1148. }