ag68kgas.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. {
  2. $Id$
  3. Copyright (c) 1998 by the FPC development team
  4. This unit implements an asmoutput class for MOTOROLA syntax with
  5. Motorola 68000 (for GAS v2.52 AND HIGER)
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. What's to do:
  19. o Verify if this actually work as indirect mode with name of variables
  20. o write lines numbers and file names to output file
  21. o generate debugging informations
  22. }
  23. unit ag68kgas;
  24. interface
  25. uses aasm,assemble;
  26. type
  27. pm68kgasasmlist=^tm68kgasasmlist;
  28. tm68kgasasmlist = object(tasmlist)
  29. procedure WriteTree(p:paasmoutput);virtual;
  30. procedure WriteAsmList;virtual;
  31. end;
  32. implementation
  33. uses
  34. dos,globals,systems,cobjects,m68k,
  35. strings,files,verbose
  36. {$ifdef GDB}
  37. ,gdb
  38. {$endif GDB}
  39. ;
  40. const
  41. line_length = 70;
  42. var
  43. {$ifdef GDB}
  44. n_line : byte; { different types of source lines }
  45. includecount : longint;
  46. {$endif}
  47. lastsec : tsection; { last section type written }
  48. lastsecidx,
  49. lastfileindex,
  50. lastline : longint;
  51. function double2str(d : double) : string;
  52. var
  53. hs : string;
  54. begin
  55. str(d,hs);
  56. { replace space with + }
  57. if hs[1]=' ' then
  58. hs[1]:='+';
  59. double2str:='0d'+hs
  60. end;
  61. function comp2str(d : bestreal) : string;
  62. type
  63. pdouble = ^double;
  64. var
  65. c : comp;
  66. dd : pdouble;
  67. begin
  68. {$ifdef TP}
  69. c:=d;
  70. {$else}
  71. c:=comp(d);
  72. {$endif}
  73. dd:=pdouble(@c); { this makes a bitwise copy of c into a double }
  74. comp2str:=double2str(dd^);
  75. end;
  76. function getreferencestring(const ref : treference) : string;
  77. var
  78. s : string;
  79. begin
  80. s:='';
  81. if ref.isintvalue then
  82. s:='#'+tostr(ref.offset)
  83. else
  84. with ref do
  85. begin
  86. if assigned(symbol) then
  87. s:=s+symbol^;
  88. if offset<0 then s:=s+tostr(offset)
  89. else if (offset>0) then
  90. begin
  91. if (symbol=nil) then s:=tostr(offset)
  92. else s:=s+'+'+tostr(offset);
  93. end;
  94. if (index<>R_NO) and (base=R_NO) and (direction=dir_none) then
  95. begin
  96. if (scalefactor = 1) or (scalefactor = 0) then
  97. s:=s+'(,'+gas_reg2str[index]+'.l)'
  98. else
  99. s:=s+'(,'+gas_reg2str[index]+'.l*'+tostr(scalefactor)+')'
  100. end
  101. else if (index=R_NO) and (base<>R_NO) and (direction=dir_inc) then
  102. begin
  103. if (scalefactor = 1) or (scalefactor = 0) then
  104. s:=s+'('+gas_reg2str[base]+')+'
  105. else
  106. InternalError(10002);
  107. end
  108. else if (index=R_NO) and (base<>R_NO) and (direction=dir_dec) then
  109. begin
  110. if (scalefactor = 1) or (scalefactor = 0) then
  111. s:=s+'-('+gas_reg2str[base]+')'
  112. else
  113. InternalError(10003);
  114. end
  115. else if (index=R_NO) and (base<>R_NO) and (direction=dir_none) then
  116. begin
  117. s:=s+'('+gas_reg2str[base]+')'
  118. end
  119. else if (index<>R_NO) and (base<>R_NO) and (direction=dir_none) then
  120. begin
  121. if (scalefactor = 1) or (scalefactor = 0) then
  122. s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index]+'.l)'
  123. else
  124. s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index]+'.l*'+tostr(scalefactor)+')';
  125. end;
  126. end; { end with }
  127. getreferencestring:=s;
  128. end;
  129. function getopstr(t : byte;o : pointer) : string;
  130. var
  131. hs : string;
  132. i: tregister;
  133. begin
  134. case t of
  135. top_reg : getopstr:=gas_reg2str[tregister(o)];
  136. top_ref : getopstr:=getreferencestring(preference(o)^);
  137. top_reglist: begin
  138. hs:='';
  139. for i:=R_NO to R_FPSR do
  140. begin
  141. if i in tregisterlist(o^) then
  142. hs:=hs+gas_reg2str[i]+'/';
  143. end;
  144. delete(hs,length(hs),1);
  145. getopstr := hs;
  146. end;
  147. top_const : getopstr:='#'+tostr(longint(o));
  148. top_symbol :
  149. { compare with i386, where a symbol is considered }
  150. { a constant. }
  151. begin
  152. hs[0]:=chr(strlen(pchar(pcsymbol(o)^.symbol)));
  153. move(pchar(pcsymbol(o)^.symbol)^,hs[1],byte(hs[0]));
  154. { inc(byte(hs[0]));}
  155. if pcsymbol(o)^.offset>0 then
  156. hs:=hs+'+'+tostr(pcsymbol(o)^.offset)
  157. else if pcsymbol(o)^.offset<0 then
  158. hs:=hs+tostr(pcsymbol(o)^.offset);
  159. getopstr:=hs;
  160. end;
  161. else internalerror(10001);
  162. end;
  163. end;
  164. function getopstr_jmp(t : byte;o : pointer) : string;
  165. var
  166. hs : string;
  167. begin
  168. case t of
  169. top_reg : getopstr_jmp:=gas_reg2str[tregister(o)];
  170. top_ref : getopstr_jmp:=getreferencestring(preference(o)^);
  171. top_const : getopstr_jmp:=tostr(longint(o));
  172. top_symbol : begin
  173. hs[0]:=chr(strlen(pchar(pcsymbol(o)^.symbol)));
  174. move(pchar(pcsymbol(o)^.symbol)^,hs[1],byte(hs[0]));
  175. if pcsymbol(o)^.offset>0 then
  176. hs:=hs+'+'+tostr(pcsymbol(o)^.offset)
  177. else if pcsymbol(o)^.offset<0 then
  178. hs:=hs+tostr(pcsymbol(o)^.offset);
  179. getopstr_jmp:=hs;
  180. end;
  181. else internalerror(10001);
  182. end;
  183. end;
  184. {****************************************************************************
  185. T68kGASASMOUTPUT
  186. ****************************************************************************}
  187. const
  188. ait_const2str:array[ait_const_32bit..ait_const_8bit] of string[8]=
  189. (#9'.long'#9,'',#9'.short'#9,#9'.byte'#9);
  190. ait_section2str : array[tsection] of string[6]=
  191. ('','.text','.data','.bss','.idata');
  192. procedure tm68kgasasmlist.WriteTree(p:paasmoutput);
  193. var
  194. hp : pai;
  195. ch : char;
  196. consttyp : tait;
  197. s : string;
  198. pos,l,i : longint;
  199. found : boolean;
  200. {$ifdef GDB}
  201. curr_n : byte;
  202. infile : pinputfile;
  203. funcname : pchar;
  204. linecount : longint;
  205. {$endif GDB}
  206. begin
  207. if not assigned(p) then
  208. exit;
  209. {$ifdef GDB}
  210. funcname:=nil;
  211. linecount:=1;
  212. {$endif GDB}
  213. hp:=pai(p^.first);
  214. while assigned(hp) do
  215. begin
  216. { write debugger informations }
  217. {$ifdef GDB}
  218. if cs_debuginfo in aktswitches then
  219. begin
  220. if not (hp^.typ in [ait_external,ait_stabn,ait_stabs,
  221. ait_label,ait_cut,ait_align,ait_stab_function_name]) then
  222. begin
  223. { file changed ? (must be before line info) }
  224. if lastfileindex<>hp^.fileinfo.fileindex then
  225. begin
  226. infile:=current_module^.sourcefiles.get_file(hp^.fileinfo.fileindex);
  227. if includecount=0 then
  228. curr_n:=n_sourcefile
  229. else
  230. curr_n:=n_includefile;
  231. if (infile^.path^<>'') then
  232. begin
  233. AsmWriteLn(#9'.stabs "'+lower(BsToSlash(FixPath(infile^.path^)))+'",'+
  234. tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
  235. end;
  236. AsmWriteLn(#9'.stabs "'+lower(FixFileName(infile^.name^))+'",'+
  237. tostr(curr_n)+',0,0,'+'Ltext'+ToStr(IncludeCount));
  238. AsmWriteLn('Ltext'+ToStr(IncludeCount)+':');
  239. inc(includecount);
  240. lastfileindex:=hp^.fileinfo.fileindex;
  241. end;
  242. { line changed ? }
  243. if (hp^.fileinfo.line<>lastline) and (hp^.fileinfo.line<>0) then
  244. begin
  245. if (n_line=n_textline) and assigned(funcname) and
  246. (target_os.use_function_relative_addresses) then
  247. begin
  248. AsmWriteLn(target_asm.labelprefix+'l'+tostr(linecount)+':');
  249. AsmWrite(#9'.stabn '+tostr(n_line)+',0,'+tostr(hp^.fileinfo.line)+','+
  250. target_asm.labelprefix+'l'+tostr(linecount)+' - ');
  251. AsmWritePChar(FuncName);
  252. AsmLn;
  253. inc(linecount);
  254. end
  255. else
  256. AsmWriteLn(#9'.stabd'#9+tostr(n_line)+',0,'+tostr(hp^.fileinfo.line));
  257. lastline:=hp^.fileinfo.line;
  258. end;
  259. end;
  260. end;
  261. {$endif GDB}
  262. case hp^.typ of
  263. ait_external : ; { external is ignored }
  264. ait_comment : Begin
  265. AsmWrite(target_asm.comment);
  266. AsmWritePChar(pai_asm_comment(hp)^.str);
  267. AsmLn;
  268. End;
  269. {$ifdef DREGALLOC}
  270. ait_regalloc : AsmWriteLn(target_asm.comment+'Register '+att_reg2str[pairegalloc(hp)^.reg]+' allocated');
  271. ait_regdealloc : AsmWriteLn(target_asm.comment+'Register '+att_reg2str[pairegalloc(hp)^.reg]+' released');
  272. {$endif DREGALLOC}
  273. ait_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
  274. ait_section : begin
  275. if pai_section(hp)^.sec<>sec_none then
  276. begin
  277. AsmLn;
  278. AsmWrite(ait_section2str[pai_section(hp)^.sec]);
  279. if pai_section(hp)^.idataidx>0 then
  280. AsmWrite('$'+tostr(pai_section(hp)^.idataidx));
  281. AsmLn;
  282. {$ifdef GDB}
  283. case pai_section(hp)^.sec of
  284. sec_code : n_line:=n_textline;
  285. sec_data : n_line:=n_dataline;
  286. sec_bss : n_line:=n_bssline;
  287. end;
  288. {$endif GDB}
  289. end;
  290. LastSec:=pai_section(hp)^.sec;
  291. end;
  292. ait_datablock : begin
  293. { ------------------------------------------------------- }
  294. { ----------- ALIGNMENT FOR ANY NON-BYTE VALUE ---------- }
  295. { ------------- REQUIREMENT FOR 680x0 ------------------- }
  296. { ------------------------------------------------------- }
  297. if pai_datablock(hp)^.size <> 1 then
  298. begin
  299. if not(cs_littlesize in aktswitches) then
  300. AsmWriteLn(#9#9'.align 4')
  301. else
  302. AsmWriteLn(#9#9'.align 2');
  303. end;
  304. if pai_datablock(hp)^.is_global then
  305. AsmWrite(#9'.comm'#9)
  306. else
  307. AsmWrite(#9'.lcomm'#9);
  308. AsmWriteLn(StrPas(pai_datablock(hp)^.name)+','+tostr(pai_datablock(hp)^.size));
  309. end;
  310. ait_const_32bit, { alignment is required for 16/32 bit data! }
  311. ait_const_16bit: begin
  312. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  313. consttyp:=hp^.typ;
  314. l:=0;
  315. repeat
  316. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  317. if found then
  318. begin
  319. hp:=Pai(hp^.next);
  320. s:=','+tostr(pai_const(hp)^.value);
  321. AsmWrite(s);
  322. inc(l,length(s));
  323. end;
  324. until (not found) or (l>line_length);
  325. AsmLn;
  326. end;
  327. ait_const_8bit : begin
  328. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  329. consttyp:=hp^.typ;
  330. l:=0;
  331. repeat
  332. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  333. if found then
  334. begin
  335. hp:=Pai(hp^.next);
  336. s:=','+tostr(pai_const(hp)^.value);
  337. AsmWrite(s);
  338. inc(l,length(s));
  339. end;
  340. until (not found) or (l>line_length);
  341. AsmLn;
  342. end;
  343. ait_const_symbol : Begin
  344. AsmWriteLn(#9'.long'#9+StrPas(pchar(pai_const(hp)^.value)));
  345. end;
  346. ait_real_64bit : Begin
  347. AsmWriteLn(#9'.double'#9+double2str(pai_double(hp)^.value));
  348. end;
  349. ait_real_32bit : Begin
  350. AsmWriteLn(#9'.single'#9+double2str(pai_single(hp)^.value));
  351. end;
  352. ait_real_extended : Begin
  353. AsmWriteLn(#9'.extend'#9+double2str(pai_extended(hp)^.value));
  354. { comp type is difficult to write so use double }
  355. end;
  356. ait_comp : Begin
  357. AsmWriteLn(#9'.double'#9+comp2str(pai_extended(hp)^.value));
  358. end;
  359. ait_direct : begin
  360. AsmWritePChar(pai_direct(hp)^.str);
  361. AsmLn;
  362. {$IfDef GDB}
  363. if strpos(pai_direct(hp)^.str,'.data')<>nil then
  364. n_line:=n_dataline
  365. else if strpos(pai_direct(hp)^.str,'.text')<>nil then
  366. n_line:=n_textline
  367. else if strpos(pai_direct(hp)^.str,'.bss')<>nil then
  368. n_line:=n_bssline;
  369. {$endif GDB}
  370. end;
  371. ait_string : begin
  372. pos:=0;
  373. for i:=1 to pai_string(hp)^.len do
  374. begin
  375. if pos=0 then
  376. begin
  377. AsmWrite(#9'.ascii'#9'"');
  378. pos:=20;
  379. end;
  380. ch:=pai_string(hp)^.str[i-1];
  381. case ch of
  382. #0, {This can't be done by range, because a bug in FPC}
  383. #1..#31,
  384. #128..#255 : s:='\'+tostr(ord(ch) shr 6)+tostr((ord(ch) and 63) shr 3)+tostr(ord(ch) and 7);
  385. '"' : s:='\"';
  386. '\' : s:='\\';
  387. else
  388. s:=ch;
  389. end;
  390. AsmWrite(s);
  391. inc(pos,length(s));
  392. if (pos>line_length) or (i=pai_string(hp)^.len) then
  393. begin
  394. AsmWriteLn('"');
  395. pos:=0;
  396. end;
  397. end;
  398. end;
  399. ait_label : begin
  400. if assigned(hp^.next) and (pai(hp^.next)^.typ in
  401. [ait_const_32bit,ait_const_16bit,ait_const_symbol,
  402. ait_real_64bit,ait_real_32bit,ait_string]) then
  403. begin
  404. if not(cs_littlesize in aktswitches) then
  405. AsmWriteLn(#9#9'.align 4')
  406. else
  407. AsmWriteLn(#9#9'.align 2');
  408. end;
  409. if (pai_label(hp)^.l^.is_used) then
  410. AsmWriteLn(lab2str(pai_label(hp)^.l)+':');
  411. end;
  412. ait_labeled_instruction : begin
  413. { labeled operand }
  414. if pai_labeled(hp)^._op1 = R_NO then
  415. AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+lab2str(pai_labeled(hp)^.lab))
  416. else
  417. { labeled operand with register }
  418. AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
  419. reg2str(pai_labeled(hp)^._op1)+','+lab2str(pai_labeled(hp)^.lab))
  420. end;
  421. ait_symbol : begin
  422. { ------------------------------------------------------- }
  423. { ----------- ALIGNMENT FOR ANY NON-BYTE VALUE ---------- }
  424. { ------------- REQUIREMENT FOR 680x0 ------------------- }
  425. { ------------------------------------------------------- }
  426. if assigned(hp^.next) and (pai(hp^.next)^.typ in
  427. [ait_const_32bit,ait_const_16bit,ait_const_symbol,
  428. ait_real_64bit,ait_real_32bit,ait_string]) then
  429. begin
  430. if not(cs_littlesize in aktswitches) then
  431. AsmWriteLn(#9#9'.align 4')
  432. else
  433. AsmWriteLn(#9#9'.align 2');
  434. end;
  435. if pai_symbol(hp)^.is_global then
  436. AsmWriteLn('.globl '+StrPas(pai_symbol(hp)^.name));
  437. AsmWriteLn(StrPas(pai_symbol(hp)^.name)+':');
  438. end;
  439. ait_instruction : begin
  440. { old versions of GAS don't like PEA.L and LEA.L }
  441. if (pai68k(hp)^._operator in [
  442. A_LEA,A_PEA,A_ABCD,A_BCHG,A_BCLR,A_BSET,A_BTST,
  443. A_EXG,A_NBCD,A_SBCD,A_SWAP,A_TAS,A_SCC,A_SCS,
  444. A_SEQ,A_SGE,A_SGT,A_SHI,A_SLE,A_SLS,A_SLT,A_SMI,
  445. A_SNE,A_SPL,A_ST,A_SVC,A_SVS,A_SF]) then
  446. s:=#9+mot_op2str[pai68k(hp)^._operator]
  447. else
  448. s:=#9+mot_op2str[pai68k(hp)^._operator]+mit_opsize2str[pai68k(hp)^.size];
  449. if pai68k(hp)^.op1t<>top_none then
  450. begin
  451. { call and jmp need an extra handling }
  452. { this code is only callded if jmp isn't a labeled instruction }
  453. if pai68k(hp)^._operator in [A_JSR,A_JMP] then
  454. s:=s+#9+getopstr_jmp(pai68k(hp)^.op1t,pai68k(hp)^.op1)
  455. else
  456. if pai68k(hp)^.op1t = top_reglist then
  457. s:=s+#9+getopstr(pai68k(hp)^.op1t,@(pai68k(hp)^.reglist))
  458. else
  459. s:=s+#9+getopstr(pai68k(hp)^.op1t,pai68k(hp)^.op1);
  460. if pai68k(hp)^.op2t<>top_none then
  461. begin
  462. if pai68k(hp)^.op2t = top_reglist then
  463. s:=s+','+getopstr(pai68k(hp)^.op2t,@pai68k(hp)^.reglist)
  464. else
  465. s:=s+','+getopstr(pai68k(hp)^.op2t,pai68k(hp)^.op2);
  466. { three operands }
  467. if pai68k(hp)^.op3t<>top_none then
  468. begin
  469. if (pai68k(hp)^._operator = A_DIVSL) or
  470. (pai68k(hp)^._operator = A_DIVUL) or
  471. (pai68k(hp)^._operator = A_MULU) or
  472. (pai68k(hp)^._operator = A_MULS) or
  473. (pai68k(hp)^._operator = A_DIVS) or
  474. (pai68k(hp)^._operator = A_DIVU) then
  475. s:=s+':'+getopstr(pai68k(hp)^.op3t,pai68k(hp)^.op3)
  476. else
  477. s:=s+','+getopstr(pai68k(hp)^.op3t,pai68k(hp)^.op3);
  478. end;
  479. end;
  480. end;
  481. AsmWriteLn(s);
  482. end;
  483. {$ifdef GDB}
  484. ait_stabs : begin
  485. AsmWrite(#9'.stabs ');
  486. AsmWritePChar(pai_stabs(hp)^.str);
  487. AsmLn;
  488. end;
  489. ait_stabn : begin
  490. AsmWrite(#9'.stabn ');
  491. AsmWritePChar(pai_stabn(hp)^.str);
  492. AsmLn;
  493. end;
  494. ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
  495. {$endif GDB}
  496. ait_cut : begin
  497. { create only a new file when the last is not empty }
  498. if AsmSize>0 then
  499. begin
  500. AsmClose;
  501. DoAssemble;
  502. AsmCreate;
  503. end;
  504. { avoid empty files }
  505. while assigned(hp^.next) and (pai(hp^.next)^.typ in [ait_cut,ait_section,ait_comment]) do
  506. begin
  507. if pai(hp^.next)^.typ=ait_section then
  508. begin
  509. lastsec:=pai_section(hp^.next)^.sec;
  510. lastsecidx:=pai_section(hp^.next)^.idataidx;
  511. end;
  512. hp:=pai(hp^.next);
  513. end;
  514. if lastsec<>sec_none then
  515. AsmWriteLn(ait_section2str[lastsec,lastsecidx]);
  516. end;
  517. else
  518. internalerror(10000);
  519. end;
  520. hp:=pai(hp^.next);
  521. end;
  522. end;
  523. procedure tm68kgasasmlist.WriteAsmList;
  524. var
  525. p:dirstr;
  526. n:namestr;
  527. e:extstr;
  528. begin
  529. {$ifdef EXTDEBUG}
  530. if assigned(current_module^.mainsource) then
  531. comment(v_info,'Start writing gas-styled assembler output for '+current_module^.mainsource^);
  532. {$endif}
  533. lastline:=0;
  534. lastfileindex:=0;
  535. LastSec:=sec_none;
  536. {$ifdef GDB}
  537. includecount:=0;
  538. n_line:=n_bssline;
  539. {$endif GDB}
  540. if assigned(current_module^.mainsource) then
  541. fsplit(current_module^.mainsource^,p,n,e)
  542. else
  543. begin
  544. p:=inputdir;
  545. n:=inputfile;
  546. e:=inputextension;
  547. end;
  548. { to get symify to work }
  549. AsmWriteLn(#9'.file "'+FixFileName(n+e)+'"');
  550. { there should be nothing but externals so we don't need to process
  551. WriteTree(externals); }
  552. WriteTree(debuglist);
  553. WriteTree(codesegment);
  554. WriteTree(datasegment);
  555. WriteTree(consts);
  556. WriteTree(rttilist);
  557. WriteTree(bsssegment);
  558. Writetree(importssection);
  559. Writetree(exportssection);
  560. Writetree(resourcesection);
  561. AsmLn;
  562. {$ifdef EXTDEBUG}
  563. if assigned(current_module^.mainsource) then
  564. comment(v_info,'Done writing gas-styled assembler output for '+current_module^.mainsource^);
  565. {$endif EXTDEBUG}
  566. end;
  567. end.
  568. {
  569. $Log$
  570. Revision 1.7 1998-07-14 14:46:38 peter
  571. * released NEWINPUT
  572. Revision 1.6 1998/07/10 10:50:54 peter
  573. * m68k updates
  574. Revision 1.5 1998/06/05 17:46:04 peter
  575. * tp doesn't like comp() typecast
  576. Revision 1.4 1998/06/04 23:51:28 peter
  577. * m68k compiles
  578. + .def file creation moved to gendef.pas so it could also be used
  579. for win32
  580. }