ag68kgas.pas 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  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. infile : pextfile;
  44. includecount,lastline : longint;
  45. function double2str(d : double) : string;
  46. var
  47. hs : string;
  48. p : byte;
  49. begin
  50. str(d,hs);
  51. { replace space with + }
  52. if hs[1]=' ' then
  53. hs[1]:='+';
  54. double2str:='0d'+hs
  55. end;
  56. function comp2str(d : bestreal) : string;
  57. type
  58. pdouble = ^double;
  59. var
  60. c : comp;
  61. dd : pdouble;
  62. begin
  63. c:=d;
  64. {$ifndef TP}
  65. {$warning The following warning can be ignored}
  66. {$endif TP}
  67. dd:=pdouble(@c); { this makes a bitwise copy of c into a double }
  68. comp2str:=double2str(dd^);
  69. end;
  70. function getreferencestring(const ref : treference) : string;
  71. var
  72. s : string;
  73. begin
  74. s:='';
  75. if ref.isintvalue then
  76. s:='#'+tostr(ref.offset)
  77. else
  78. with ref do
  79. begin
  80. if assigned(symbol) then
  81. s:=s+symbol^;
  82. if offset<0 then s:=s+tostr(offset)
  83. else if (offset>0) then
  84. begin
  85. if (symbol=nil) then s:=tostr(offset)
  86. else s:=s+'+'+tostr(offset);
  87. end;
  88. if (index<>R_NO) and (base=R_NO) and (direction=dir_none) then
  89. begin
  90. if (scalefactor = 1) or (scalefactor = 0) then
  91. s:=s+'(,'+gas_reg2str[index]+'.l)'
  92. else
  93. s:=s+'(,'+gas_reg2str[index]+'.l*'+tostr(scalefactor)+')'
  94. end
  95. else if (index=R_NO) and (base<>R_NO) and (direction=dir_inc) then
  96. begin
  97. if (scalefactor = 1) or (scalefactor = 0) then
  98. s:=s+'('+gas_reg2str[base]+')+'
  99. else
  100. InternalError(10002);
  101. end
  102. else if (index=R_NO) and (base<>R_NO) and (direction=dir_dec) then
  103. begin
  104. if (scalefactor = 1) or (scalefactor = 0) then
  105. s:=s+'-('+gas_reg2str[base]+')'
  106. else
  107. InternalError(10003);
  108. end
  109. else if (index=R_NO) and (base<>R_NO) and (direction=dir_none) then
  110. begin
  111. s:=s+'('+gas_reg2str[base]+')'
  112. end
  113. else if (index<>R_NO) and (base<>R_NO) and (direction=dir_none) then
  114. begin
  115. if (scalefactor = 1) or (scalefactor = 0) then
  116. s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index]+'.l)'
  117. else
  118. s:=s+'('+gas_reg2str[base]+','+gas_reg2str[index]+'.l*'+tostr(scalefactor)+')';
  119. end;
  120. end; { end with }
  121. getreferencestring:=s;
  122. end;
  123. function getopstr(t : byte;o : pointer) : string;
  124. var
  125. hs : string;
  126. i: tregister;
  127. begin
  128. case t of
  129. top_reg : getopstr:=gas_reg2str[tregister(o)];
  130. top_ref : getopstr:=getreferencestring(preference(o)^);
  131. top_reglist: begin
  132. hs:='';
  133. for i:=R_NO to R_FPSR do
  134. begin
  135. if i in tregisterlist(o^) then
  136. hs:=hs+gas_reg2str[i]+'/';
  137. end;
  138. delete(hs,length(hs),1);
  139. getopstr := hs;
  140. end;
  141. top_const : getopstr:='#'+tostr(longint(o));
  142. top_symbol :
  143. { compare with i386, where a symbol is considered }
  144. { a constant. }
  145. begin
  146. hs[0]:=chr(strlen(pchar(pcsymbol(o)^.symbol)));
  147. move(pchar(pcsymbol(o)^.symbol)^,hs[1],byte(hs[0]));
  148. { inc(byte(hs[0]));}
  149. if pcsymbol(o)^.offset>0 then
  150. hs:=hs+'+'+tostr(pcsymbol(o)^.offset)
  151. else if pcsymbol(o)^.offset<0 then
  152. hs:=hs+tostr(pcsymbol(o)^.offset);
  153. getopstr:=hs;
  154. end;
  155. else internalerror(10001);
  156. end;
  157. end;
  158. function getopstr_jmp(t : byte;o : pointer) : string;
  159. var
  160. hs : string;
  161. begin
  162. case t of
  163. top_reg : getopstr_jmp:=gas_reg2str[tregister(o)];
  164. top_ref : getopstr_jmp:=getreferencestring(preference(o)^);
  165. top_const : getopstr_jmp:=tostr(longint(o));
  166. top_symbol : begin
  167. hs[0]:=chr(strlen(pchar(pcsymbol(o)^.symbol)));
  168. move(pchar(pcsymbol(o)^.symbol)^,hs[1],byte(hs[0]));
  169. if pcsymbol(o)^.offset>0 then
  170. hs:=hs+'+'+tostr(pcsymbol(o)^.offset)
  171. else if pcsymbol(o)^.offset<0 then
  172. hs:=hs+tostr(pcsymbol(o)^.offset);
  173. getopstr_jmp:=hs;
  174. end;
  175. else internalerror(10001);
  176. end;
  177. end;
  178. {****************************************************************************
  179. T68kGASASMOUTPUT
  180. ****************************************************************************}
  181. var
  182. { different types of source lines }
  183. n_line : byte;
  184. const
  185. ait_const2str:array[ait_const_32bit..ait_const_8bit] of string[8]=
  186. (#9'.long'#9,'',#9'.short'#9,#9'.byte'#9);
  187. procedure tm68kgasasmlist.WriteTree(p:paasmoutput);
  188. var
  189. hp : pai;
  190. ch : char;
  191. consttyp : tait;
  192. s : string;
  193. pos,l,i : longint;
  194. found : boolean;
  195. {$ifdef GDB}
  196. funcname : pchar;
  197. linecount : longint;
  198. {$endif GDB}
  199. begin
  200. {$ifdef GDB}
  201. funcname:=nil;
  202. linecount:=1;
  203. {$endif GDB}
  204. hp:=pai(p^.first);
  205. while assigned(hp) do
  206. begin
  207. { write debugger informations }
  208. {$ifdef GDB}
  209. if cs_debuginfo in aktswitches then
  210. begin
  211. if not (hp^.typ in [ait_external,ait_stabn,ait_stabs,ait_stab_function_name]) then
  212. begin
  213. if assigned(hp^.infile) and (pextfile(hp^.infile)<>infile) then
  214. begin
  215. infile:=hp^.infile;
  216. inc(includecount);
  217. if (hp^.infile^.path^<>'') then
  218. begin
  219. AsmWriteLn(#9'.stabs "'+FixPath(hp^.infile^.path^)+'",'+tostr(n_includefile)+
  220. ',0,0,Ltext'+ToStr(IncludeCount));
  221. end;
  222. AsmWriteLn(#9'.stabs "'+FixFileName(hp^.infile^.name^+hp^.infile^.ext^)+'",'+tostr(n_includefile)+
  223. ',0,0,Ltext'+ToStr(IncludeCount));
  224. AsmWriteLn('Ltext'+ToStr(IncludeCount)+':');
  225. end;
  226. { file name must be there before line number ! }
  227. if (hp^.line<>lastline) and (hp^.line<>0) then
  228. begin
  229. if (n_line = n_textline) and assigned(funcname) and
  230. (target_info.use_function_relative_addresses) then
  231. begin
  232. AsmWriteLn(target_info.labelprefix+'l'+tostr(linecount)+':');
  233. AsmWriteLn(#9'.stabn '+tostr(n_line)+',0,'+tostr(hp^.line)+','+
  234. target_info.labelprefix+'l'+tostr(linecount)+' - '+StrPas(FuncName));
  235. inc(linecount);
  236. end
  237. else
  238. AsmWriteLn(#9'.stabd'#9+tostr(n_line)+',0,'+tostr(hp^.line));
  239. lastline:=hp^.line;
  240. end;
  241. end;
  242. end;
  243. {$endif GDB}
  244. case hp^.typ of
  245. ait_comment :
  246. Begin
  247. AsmWrite(As_comment);
  248. AsmWritePChar(pai_asm_comment(hp)^.str);
  249. AsmLn;
  250. End;
  251. ait_external : ; { external is ignored }
  252. ait_align : AsmWriteLn(#9'.align '+tostr(pai_align(hp)^.aligntype));
  253. ait_datablock : begin
  254. { ------------------------------------------------------- }
  255. { ----------- ALIGNMENT FOR ANY NON-BYTE VALUE ---------- }
  256. { ------------- REQUIREMENT FOR 680x0 ------------------- }
  257. { ------------------------------------------------------- }
  258. if pai_datablock(hp)^.size <> 1 then
  259. begin
  260. if not(cs_littlesize in aktswitches) then
  261. AsmWriteLn(#9#9'.align 4')
  262. else
  263. AsmWriteLn(#9#9'.align 2');
  264. end;
  265. if pai_datablock(hp)^.is_global then
  266. AsmWrite(#9'.comm'#9)
  267. else
  268. AsmWrite(#9'.lcomm'#9);
  269. AsmWriteLn(StrPas(pai_datablock(hp)^.name)+','+tostr(pai_datablock(hp)^.size));
  270. end;
  271. ait_const_32bit, { alignment is required for 16/32 bit data! }
  272. ait_const_16bit: begin
  273. if not(cs_littlesize in aktswitches) then
  274. AsmWriteLn(#9#9'.align 4')
  275. else
  276. AsmWriteLn(#9#9'.align 2');
  277. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  278. consttyp:=hp^.typ;
  279. l:=0;
  280. repeat
  281. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  282. if found then
  283. begin
  284. hp:=Pai(hp^.next);
  285. s:=','+tostr(pai_const(hp)^.value);
  286. AsmWrite(s);
  287. inc(l,length(s));
  288. end;
  289. until (not found) or (l>line_length);
  290. AsmLn;
  291. end;
  292. ait_const_8bit : begin
  293. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  294. consttyp:=hp^.typ;
  295. l:=0;
  296. repeat
  297. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  298. if found then
  299. begin
  300. hp:=Pai(hp^.next);
  301. s:=','+tostr(pai_const(hp)^.value);
  302. AsmWrite(s);
  303. inc(l,length(s));
  304. end;
  305. until (not found) or (l>line_length);
  306. AsmLn;
  307. end;
  308. ait_const_symbol : Begin
  309. if not(cs_littlesize in aktswitches) then
  310. AsmWriteLn(#9#9'.align 4')
  311. else
  312. AsmWriteLn(#9#9'.align 2');
  313. AsmWriteLn(#9'.long'#9+StrPas(pchar(pai_const(hp)^.value)));
  314. end;
  315. ait_real_64bit : Begin
  316. if not(cs_littlesize in aktswitches) then
  317. AsmWriteLn(#9#9'.align 4')
  318. else
  319. AsmWriteLn(#9#9'.align 2');
  320. AsmWriteLn(#9'.double'#9+double2str(pai_double(hp)^.value));
  321. end;
  322. ait_real_32bit : Begin
  323. if not(cs_littlesize in aktswitches) then
  324. AsmWriteLn(#9#9'.align 4')
  325. else
  326. AsmWriteLn(#9#9'.align 2');
  327. AsmWriteLn(#9'.single'#9+double2str(pai_single(hp)^.value));
  328. end;
  329. ait_real_extended : Begin
  330. if not(cs_littlesize in aktswitches) then
  331. AsmWriteLn(#9#9'.align 4')
  332. else
  333. AsmWriteLn(#9#9'.align 2');
  334. AsmWriteLn(#9'.extend'#9+double2str(pai_extended(hp)^.value));
  335. { comp type is difficult to write so use double }
  336. end;
  337. ait_comp : Begin
  338. if not(cs_littlesize in aktswitches) then
  339. AsmWriteLn(#9#9'.align 4')
  340. else
  341. AsmWriteLn(#9#9'.align 2');
  342. AsmWriteLn(#9'.double'#9+comp2str(pai_extended(hp)^.value));
  343. end;
  344. ait_direct : begin
  345. AsmWritePChar(pai_direct(hp)^.str);
  346. AsmLn;
  347. {$IfDef GDB}
  348. if strpos(pai_direct(hp)^.str,'.data')<>nil then
  349. n_line:=n_dataline
  350. else if strpos(pai_direct(hp)^.str,'.text')<>nil then
  351. n_line:=n_textline
  352. else if strpos(pai_direct(hp)^.str,'.bss')<>nil then
  353. n_line:=n_bssline;
  354. {$endif GDB}
  355. end;
  356. ait_string : begin
  357. pos:=0;
  358. for i:=1 to pai_string(hp)^.len do
  359. begin
  360. if pos=0 then
  361. begin
  362. AsmWrite(#9'.ascii'#9'"');
  363. pos:=20;
  364. end;
  365. ch:=pai_string(hp)^.str[i-1];
  366. case ch of
  367. #0, {This can't be done by range, because a bug in FPC}
  368. #1..#31,
  369. #128..#255 : s:='\'+tostr(ord(ch) shr 6)+tostr((ord(ch) and 63) shr 3)+tostr(ord(ch) and 7);
  370. '"' : s:='\"';
  371. '\' : s:='\\';
  372. else
  373. s:=ch;
  374. end;
  375. AsmWrite(s);
  376. inc(pos,length(s));
  377. if (pos>line_length) or (i=pai_string(hp)^.len) then
  378. begin
  379. AsmWriteLn('"');
  380. pos:=0;
  381. end;
  382. end;
  383. end;
  384. ait_label : begin
  385. if (pai_label(hp)^.l^.is_used) then
  386. AsmWriteLn(lab2str(pai_label(hp)^.l)+':');
  387. end;
  388. ait_labeled_instruction : begin
  389. { labeled operand }
  390. if pai_labeled(hp)^._op1 = R_NO then
  391. AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+lab2str(pai_labeled(hp)^.lab))
  392. else
  393. { labeled operand with register }
  394. AsmWriteLn(#9+mot_op2str[pai_labeled(hp)^._operator]+#9+
  395. reg2str(pai_labeled(hp)^._op1)+','+lab2str(pai_labeled(hp)^.lab))
  396. end;
  397. ait_symbol : begin
  398. { ------------------------------------------------------- }
  399. { ----------- ALIGNMENT FOR ANY NON-BYTE VALUE ---------- }
  400. { ------------- REQUIREMENT FOR 680x0 ------------------- }
  401. { ------------------------------------------------------- }
  402. if assigned(hp^.next) and (pai(hp^.next)^.typ in
  403. [ait_const_32bit,ait_const_16bit,ait_const_symbol,
  404. ait_real_64bit,ait_real_32bit,ait_string]) then
  405. begin
  406. if not(cs_littlesize in aktswitches) then
  407. AsmWriteLn(#9#9'.align 4')
  408. else
  409. AsmWriteLn(#9#9'.align 2');
  410. end;
  411. if pai_symbol(hp)^.is_global then
  412. AsmWriteLn('.globl '+StrPas(pai_symbol(hp)^.name));
  413. AsmWriteLn(StrPas(pai_symbol(hp)^.name)+':');
  414. end;
  415. ait_instruction : begin
  416. { old versions of GAS don't like PEA.L and LEA.L }
  417. if (pai68k(hp)^._operator <> A_LEA) and (pai68k(hp)^._operator<> A_PEA) then
  418. s:=#9+mot_op2str[pai68k(hp)^._operator]+gas_opsize2str[pai68k(hp)^.size]
  419. else
  420. s:=#9+mot_op2str[pai68k(hp)^._operator];
  421. if pai68k(hp)^.op1t<>top_none then
  422. begin
  423. { call and jmp need an extra handling }
  424. { this code is only callded if jmp isn't a labeled instruction }
  425. if pai68k(hp)^._operator in [A_JSR,A_JMP] then
  426. s:=s+#9+getopstr_jmp(pai68k(hp)^.op1t,pai68k(hp)^.op1)
  427. else
  428. if pai68k(hp)^.op1t = top_reglist then
  429. s:=s+#9+getopstr(pai68k(hp)^.op1t,@(pai68k(hp)^.reglist))
  430. else
  431. s:=s+#9+getopstr(pai68k(hp)^.op1t,pai68k(hp)^.op1);
  432. if pai68k(hp)^.op2t<>top_none then
  433. begin
  434. if pai68k(hp)^.op2t = top_reglist then
  435. s:=s+','+getopstr(pai68k(hp)^.op2t,@pai68k(hp)^.reglist)
  436. else
  437. s:=s+','+getopstr(pai68k(hp)^.op2t,pai68k(hp)^.op2);
  438. { three operands }
  439. if pai68k(hp)^.op3t<>top_none then
  440. begin
  441. if (pai68k(hp)^._operator = A_DIVSL) or
  442. (pai68k(hp)^._operator = A_DIVUL) or
  443. (pai68k(hp)^._operator = A_MULU) or
  444. (pai68k(hp)^._operator = A_MULS) or
  445. (pai68k(hp)^._operator = A_DIVS) or
  446. (pai68k(hp)^._operator = A_DIVU) then
  447. s:=s+':'+getopstr(pai68k(hp)^.op3t,pai68k(hp)^.op3)
  448. else
  449. s:=s+','+getopstr(pai68k(hp)^.op3t,pai68k(hp)^.op3);
  450. end;
  451. end;
  452. end;
  453. AsmWriteLn(s);
  454. end;
  455. {$ifdef GDB}
  456. ait_stabs : begin
  457. AsmWrite(#9'.stabs ');
  458. AsmWritePChar(pai_stabs(hp)^.str);
  459. AsmLn;
  460. end;
  461. ait_stabn : begin
  462. AsmWrite(#9'.stabn ');
  463. AsmWritePChar(pai_stabn(hp)^.str);
  464. AsmLn;
  465. end;
  466. ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
  467. {$endif GDB}
  468. else
  469. internalerror(10000);
  470. end;
  471. hp:=pai(hp^.next);
  472. end;
  473. end;
  474. procedure tm68kgasasmlist.WriteAsmList;
  475. {$ifdef GDB}
  476. var
  477. p,n,e : string;
  478. {$endif}
  479. begin
  480. {$ifdef EXTDEBUG}
  481. if assigned(current_module^.mainsource) then
  482. comment(v_info,'Start writing gas-styled assembler output for '+current_module^.mainsource^);
  483. {$endif}
  484. infile:=nil;
  485. includecount:=0;
  486. {$ifdef GDB}
  487. if assigned(current_module^.mainsource) then
  488. fsplit(current_module^.mainsource^,p,n,e)
  489. else
  490. begin
  491. p:=inputdir;
  492. n:=inputfile;
  493. e:=inputextension;
  494. end;
  495. { to get symify to work }
  496. AsmWriteLn(#9'.file "'+FixFileName(n+e)+'"');
  497. { stabs }
  498. n_line:=n_bssline;
  499. if (cs_debuginfo in aktswitches) then
  500. begin
  501. if (p<>'') then
  502. AsmWriteLn(#9'.stabs "'+FixPath(p)+'",'+tostr(n_sourcefile)+',0,0,Ltext0');
  503. AsmWriteLn(#9'.stabs "'+FixFileName(n+e)+'",'+tostr(n_sourcefile)+',0,0,Ltext0');
  504. AsmWriteLn('Ltext0:');
  505. end;
  506. infile:=current_module^.sourcefiles.files;
  507. {$endif GDB}
  508. { main source file is last in list }
  509. while assigned(infile^._next) do
  510. infile:=infile^._next;
  511. lastline:=0;
  512. { there should be nothing but externals so we don't need to process
  513. WriteTree(externals); }
  514. WriteTree(debuglist);
  515. { code segment }
  516. AsmWriteln('.text');
  517. {$ifdef GDB}
  518. n_line:=n_textline;
  519. {$endif GDB}
  520. WriteTree(codesegment);
  521. AsmWriteLn('.data');
  522. {$ifdef EXTDEBUG}
  523. AsmWriteLn(#9'.ascii'#9'"compiled by FPC '+version_string+'\0"');
  524. AsmWriteLn(#9'.ascii'#9'"target: '+target_info.target_name+'\0"');
  525. {$endif EXTDEBUG}
  526. {$ifdef GDB}
  527. n_line:=n_dataline;
  528. {$endif GDB}
  529. DataSegment^.insert(new(pai_align,init(4)));
  530. WriteTree(datasegment);
  531. WriteTree(consts);
  532. { makes problems with old GNU ASes
  533. AsmWriteLn('.bss');
  534. bssSegment^.insert(new(pai_align,init(4))); }
  535. {$ifdef GDB}
  536. n_line:=n_bssline;
  537. {$endif GDB}
  538. WriteTree(bsssegment);
  539. AsmLn;
  540. {$ifdef EXTDEBUG}
  541. if assigned(current_module^.mainsource) then
  542. comment(v_info,'Done writing gas-styled assembler output for '+current_module^.mainsource^);
  543. {$endif EXTDEBUG}
  544. end;
  545. end.
  546. {
  547. $Log$
  548. Revision 1.3 1998-05-23 01:20:56 peter
  549. + aktasmmode, aktoptprocessor, aktoutputformat
  550. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  551. + $LIBNAME to set the library name where the unit will be put in
  552. * splitted cgi386 a bit (codeseg to large for bp7)
  553. * nasm, tasm works again. nasm moved to ag386nsm.pas
  554. Revision 1.2 1998/04/29 10:33:41 pierre
  555. + added some code for ansistring (not complete nor working yet)
  556. * corrected operator overloading
  557. * corrected nasm output
  558. + started inline procedures
  559. + added starstarn : use ** for exponentiation (^ gave problems)
  560. + started UseTokenInfo cond to get accurate positions
  561. Revision 1.1.1.1 1998/03/25 11:18:16 root
  562. * Restored version
  563. Revision 1.3 1998/03/22 12:45:37 florian
  564. * changes of Carl-Eric to m68k target commit:
  565. - wrong nodes because of the new string cg in intel, I had to create
  566. this under m68k also ... had to work it out to fix potential alignment
  567. problems --> this removes the crash of the m68k compiler.
  568. - added absolute addressing in m68k assembler (required for Amiga startup)
  569. - fixed alignment problems (because of byte return values, alignment
  570. would not be always valid) -- is this ok if i change the offset if odd in
  571. setfirsttemp ?? -- it seems ok...
  572. Revision 1.2 1998/03/10 04:22:08 carl
  573. - removed in as it can cause range check errors under BP
  574. Revision 1.1 1998/03/10 01:26:10 peter
  575. + new uniform names
  576. Revision 1.18 1998/03/09 12:58:10 peter
  577. * FWait warning is only showed for Go32V2 and $E+
  578. * opcode tables moved to i386.pas/m68k.pas to reduce circular uses (and
  579. for m68k the same tables are removed)
  580. + $E for i386
  581. Revision 1.17 1998/03/06 00:52:18 peter
  582. * replaced all old messages from errore.msg, only ExtDebug and some
  583. Comment() calls are left
  584. * fixed options.pas
  585. Revision 1.16 1998/03/02 01:48:33 peter
  586. * renamed target_DOS to target_GO32V1
  587. + new verbose system, merged old errors and verbose units into one new
  588. verbose.pas, so errors.pas is obsolete
  589. Revision 1.15 1998/02/23 03:00:00 carl
  590. * bugfix when compiling with extdebug defined
  591. Revision 1.14 1998/02/22 23:03:18 peter
  592. * renamed msource->mainsource and name->unitname
  593. * optimized filename handling, filename is not seperate anymore with
  594. path+name+ext, this saves stackspace and a lot of fsplit()'s
  595. * recompiling of some units in libraries fixed
  596. * shared libraries are working again
  597. + $LINKLIB <lib> to support automatic linking to libraries
  598. + libraries are saved/read from the ppufile, also allows more libraries
  599. per ppufile
  600. Revision 1.13 1998/02/21 20:20:52 carl
  601. * make it work under older versions of GAS
  602. Revision 1.10 1998/02/15 21:16:19 peter
  603. * all assembler outputs supported by assemblerobject
  604. * cleanup with assembleroutputs, better .ascii generation
  605. * help_constructor/destructor are now added to the externals
  606. - generation of asmresponse is not outputformat depended
  607. Revision 1.9 1998/02/13 10:34:59 daniel
  608. * Made Motorola version compilable.
  609. * Fixed optimizer
  610. Revision 1.8 1998/02/12 11:50:04 daniel
  611. Yes! Finally! After three retries, my patch!
  612. Changes:
  613. Complete rewrite of psub.pas.
  614. Added support for DLL's.
  615. Compiler requires less memory.
  616. Platform units for each platform.
  617. Revision 1.7 1998/01/09 19:20:49 carl
  618. + added support for mul/div 68020 syntax
  619. * bugfix of getreferencestring
  620. Revision 1.4 1997/12/09 13:37:50 carl
  621. + ait_align added
  622. * now all non byte values are aligned correctly
  623. Revision 1.3 1997/12/05 14:40:49 carl
  624. * bugfix of scaling, was incorrect under gas.
  625. Revision 1.2 1997/12/04 15:30:14 carl
  626. * forgot to change name of unit! ugh...
  627. Revision 1.1 1997/12/03 14:04:19 carl
  628. + renamed from gasasm6.pas to ag68kgas.pas
  629. Revision 1.3 1997/12/01 17:42:51 pierre
  630. + added some more functionnality to the assembler parser
  631. Revision 1.2 1997/11/28 18:14:32 pierre
  632. working version with several bug fixes
  633. Revision 1.1.1.1 1997/11/27 08:32:56 michael
  634. FPC Compiler CVS start
  635. Pre-CVS log:
  636. CEC Carl-Eric Codere
  637. FK Florian Klaempfl
  638. PM Pierre Muller
  639. + feature added
  640. - removed
  641. * bug fixed or changed
  642. History:
  643. 30th september 1996:
  644. + unit started (FK)
  645. 15th october 1996:
  646. + ti386attasmoutput class started (FK)
  647. 28th november 1996:
  648. ! debugging for simple programs (FK)
  649. 26th february 1997:
  650. + op2str array completed with work of Daniel Manitone (FK)
  651. 25th september 1997:
  652. * compiled by comment ifdef'ed (FK)
  653. 4th october 1997:
  654. + converted to motorola 68000 (same sytnax as gas) (CEC)
  655. 9th october 1997:
  656. * fixed constant bug. (CEC)
  657. + converted from %reg to reg (untested) (CEC)
  658. (according to gas docs, they are accepted).
  659. 28th october 1997:
  660. * bugfix on increment/decrement mode (was never checked). (CEC)
  661. 2nd november 1997:
  662. + added all opcodes , and they are now in correct order of
  663. processor types. (CEC).
  664. }