ag386att.pas 40 KB

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