ag386nsm.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804
  1. {
  2. $Id$
  3. Copyright (c) 1996,97 by Florian Klaempfl
  4. This unit implements an asmoutput class for the Nasm assembler with
  5. Intel syntax for the i386+
  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. }
  19. {$ifdef TP}
  20. {$N+,E+}
  21. {$endif}
  22. unit ag386nsm;
  23. interface
  24. uses aasm,assemble;
  25. type
  26. pi386nasmasmlist=^ti386nasmasmlist;
  27. ti386nasmasmlist = object(tasmlist)
  28. procedure WriteTree(p:paasmoutput);virtual;
  29. procedure WriteAsmList;virtual;
  30. procedure WriteExternals;
  31. end;
  32. implementation
  33. uses
  34. strings,
  35. globtype,globals,systems,cobjects,
  36. files,verbose,cpubase,cpuasm
  37. {$ifdef GDB}
  38. ,gdb
  39. {$endif GDB}
  40. ;
  41. const
  42. line_length = 70;
  43. {$ifdef EXTTYPE}
  44. extstr : array[EXT_NEAR..EXT_ABS] of String[8] =
  45. ('NEAR','FAR','PROC','BYTE','WORD','DWORD',
  46. 'CODEPTR','DATAPTR','FWORD','PWORD','QWORD','TBYTE','ABS');
  47. {$endif}
  48. function single2str(d : single) : string;
  49. var
  50. hs : string;
  51. p : byte;
  52. begin
  53. str(d,hs);
  54. { nasm expects a lowercase e }
  55. p:=pos('E',hs);
  56. if p>0 then
  57. hs[p]:='e';
  58. p:=pos('+',hs);
  59. if p>0 then
  60. delete(hs,p,1);
  61. single2str:=lower(hs);
  62. end;
  63. function double2str(d : double) : string;
  64. var
  65. hs : string;
  66. p : byte;
  67. begin
  68. str(d,hs);
  69. { nasm expects a lowercase e }
  70. p:=pos('E',hs);
  71. if p>0 then
  72. hs[p]:='e';
  73. p:=pos('+',hs);
  74. if p>0 then
  75. delete(hs,p,1);
  76. double2str:=lower(hs);
  77. end;
  78. function extended2str(e : extended) : string;
  79. var
  80. hs : string;
  81. p : byte;
  82. begin
  83. str(e,hs);
  84. { nasm expects a lowercase e }
  85. p:=pos('E',hs);
  86. if p>0 then
  87. hs[p]:='e';
  88. p:=pos('+',hs);
  89. if p>0 then
  90. delete(hs,p,1);
  91. extended2str:=lower(hs);
  92. end;
  93. function comp2str(d : bestreal) : string;
  94. type
  95. pdouble = ^double;
  96. var
  97. c : comp;
  98. dd : pdouble;
  99. begin
  100. {$ifdef FPC}
  101. c:=comp(d);
  102. {$else}
  103. c:=d;
  104. {$endif}
  105. dd:=pdouble(@c); { this makes a bitwise copy of c into a double }
  106. comp2str:=double2str(dd^);
  107. end;
  108. function getreferencestring(const ref : treference) : string;
  109. var
  110. s : string;
  111. first : boolean;
  112. begin
  113. if ref.is_immediate then
  114. begin
  115. getreferencestring:=tostr(ref.offset);
  116. exit;
  117. end
  118. else
  119. with ref do
  120. begin
  121. first:=true;
  122. if ref.segment<>R_NO then
  123. s:='['+int_reg2str[segment]+':'
  124. else
  125. s:='[';
  126. if assigned(symbol) then
  127. begin
  128. s:=s+symbol^.name;
  129. first:=false;
  130. end;
  131. if (base<>R_NO) then
  132. begin
  133. if not(first) then
  134. s:=s+'+'
  135. else
  136. first:=false;
  137. s:=s+int_reg2str[base];
  138. end;
  139. if (index<>R_NO) then
  140. begin
  141. if not(first) then
  142. s:=s+'+'
  143. else
  144. first:=false;
  145. s:=s+int_reg2str[index];
  146. if scalefactor<>0 then
  147. s:=s+'*'+tostr(scalefactor);
  148. end;
  149. if offset<0 then
  150. s:=s+tostr(offset)
  151. else if (offset>0) then
  152. s:=s+'+'+tostr(offset);
  153. s:=s+']';
  154. end;
  155. getreferencestring:=s;
  156. end;
  157. function sizestr(s:topsize;dest:boolean):string;
  158. begin
  159. case s of
  160. S_B : sizestr:='byte ';
  161. S_W : sizestr:='word ';
  162. S_L : sizestr:='dword ';
  163. S_IS : sizestr:='word ';
  164. S_IL : sizestr:='dword ';
  165. S_IQ : sizestr:='qword ';
  166. S_FS : sizestr:='dword ';
  167. S_FL : sizestr:='qword ';
  168. S_FX : sizestr:='tword ';
  169. S_BW : if dest then
  170. sizestr:='word '
  171. else
  172. sizestr:='byte ';
  173. S_BL : if dest then
  174. sizestr:='dword '
  175. else
  176. sizestr:='byte ';
  177. S_WL : if dest then
  178. sizestr:='dword '
  179. else
  180. sizestr:='word ';
  181. end;
  182. end;
  183. function getopstr(const o:toper;s : topsize; opcode: tasmop;ops:longint;dest : boolean) : string;
  184. var
  185. hs : string;
  186. begin
  187. case o.typ of
  188. top_reg :
  189. getopstr:=int_nasmreg2str[o.reg];
  190. top_const :
  191. begin
  192. if (ops=1) and (opcode<>A_RET) then
  193. getopstr:=sizestr(s,dest)+tostr(o.val)
  194. else
  195. getopstr:=tostr(o.val);
  196. end;
  197. top_symbol :
  198. begin
  199. if assigned(o.sym) then
  200. hs:='dword '+o.sym^.name
  201. else
  202. hs:='dword ';
  203. if o.symofs>0 then
  204. hs:=hs+'+'+tostr(o.symofs)
  205. else
  206. if o.symofs<0 then
  207. hs:=hs+tostr(o.symofs)
  208. else
  209. if not(assigned(o.sym)) then
  210. hs:=hs+'0';
  211. getopstr:=hs;
  212. end;
  213. top_ref :
  214. begin
  215. hs:=getreferencestring(o.ref^);
  216. if not ((opcode = A_LEA) or (opcode = A_LGS) or
  217. (opcode = A_LSS) or (opcode = A_LFS) or
  218. (opcode = A_LES) or (opcode = A_LDS) or
  219. (opcode = A_SHR) or (opcode = A_SHL) or
  220. (opcode = A_SAR) or (opcode = A_SAL) or
  221. (opcode = A_OUT) or (opcode = A_IN)) then
  222. begin
  223. hs:=sizestr(s,dest)+hs;
  224. end;
  225. getopstr:=hs;
  226. end;
  227. else
  228. internalerror(10001);
  229. end;
  230. end;
  231. function getopstr_jmp(const o:toper) : string;
  232. var
  233. hs : string;
  234. begin
  235. case o.typ of
  236. top_reg :
  237. getopstr_jmp:=int_nasmreg2str[o.reg];
  238. top_ref :
  239. getopstr_jmp:=getreferencestring(o.ref^);
  240. top_const :
  241. getopstr_jmp:=tostr(o.val);
  242. top_symbol :
  243. begin
  244. hs:=o.sym^.name;
  245. if o.symofs>0 then
  246. hs:=hs+'+'+tostr(o.symofs)
  247. else
  248. if o.symofs<0 then
  249. hs:=hs+tostr(o.symofs);
  250. getopstr_jmp:=hs;
  251. end;
  252. else
  253. internalerror(10001);
  254. end;
  255. end;
  256. {****************************************************************************
  257. Ti386nasmasmlist
  258. ****************************************************************************}
  259. var
  260. LastSec : tsection;
  261. const
  262. ait_const2str:array[ait_const_32bit..ait_const_8bit] of string[8]=
  263. (#9'DD'#9,#9'DW'#9,#9'DB'#9);
  264. Function PadTabs(const p:string;addch:char):string;
  265. var
  266. s : string;
  267. i : longint;
  268. begin
  269. i:=length(p);
  270. if addch<>#0 then
  271. begin
  272. inc(i);
  273. s:=p+addch;
  274. end
  275. else
  276. s:=p;
  277. if i<8 then
  278. PadTabs:=s+#9#9
  279. else
  280. PadTabs:=s+#9;
  281. end;
  282. procedure ti386nasmasmlist.WriteTree(p:paasmoutput);
  283. type
  284. twowords=record
  285. word1,word2:word;
  286. end;
  287. var
  288. s,
  289. prefix,
  290. suffix : string;
  291. hp : pai;
  292. counter,
  293. lines,
  294. i,j,l : longint;
  295. consttyp : tait;
  296. found,
  297. quoted : boolean;
  298. sep : char;
  299. begin
  300. if not assigned(p) then
  301. exit;
  302. hp:=pai(p^.first);
  303. while assigned(hp) do
  304. begin
  305. case hp^.typ of
  306. ait_comment : Begin
  307. AsmWrite(target_asm.comment);
  308. AsmWritePChar(pai_asm_comment(hp)^.str);
  309. AsmLn;
  310. End;
  311. ait_regalloc,
  312. ait_tempalloc : ;
  313. ait_section : begin
  314. if pai_section(hp)^.sec<>sec_none then
  315. begin
  316. AsmLn;
  317. AsmWriteLn('SECTION '+target_asm.secnames[pai_section(hp)^.sec]);
  318. end;
  319. LastSec:=pai_section(hp)^.sec;
  320. end;
  321. ait_align : AsmWriteLn(#9'ALIGN '+tostr(pai_align(hp)^.aligntype));
  322. ait_datablock : begin
  323. if pai_datablock(hp)^.is_global then
  324. AsmWriteLn(#9'GLOBAL '+pai_datablock(hp)^.sym^.name);
  325. AsmWriteLn(PadTabs(pai_datablock(hp)^.sym^.name,':')+'RESB'#9+tostr(pai_datablock(hp)^.size));
  326. end;
  327. ait_const_32bit,
  328. ait_const_8bit,
  329. ait_const_16bit : begin
  330. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  331. consttyp:=hp^.typ;
  332. l:=0;
  333. repeat
  334. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  335. if found then
  336. begin
  337. hp:=Pai(hp^.next);
  338. s:=','+tostr(pai_const(hp)^.value);
  339. AsmWrite(s);
  340. inc(l,length(s));
  341. end;
  342. until (not found) or (l>line_length);
  343. AsmLn;
  344. end;
  345. ait_const_symbol : begin
  346. AsmWriteLn(#9#9'DD'#9+pai_const_symbol(hp)^.sym^.name);
  347. if pai_const_symbol(hp)^.offset>0 then
  348. AsmWrite('+'+tostr(pai_const_symbol(hp)^.offset))
  349. else if pai_const_symbol(hp)^.offset<0 then
  350. AsmWrite(tostr(pai_const_symbol(hp)^.offset));
  351. AsmLn;
  352. end;
  353. ait_const_rva : begin
  354. AsmWriteLn(#9#9'RVA'#9+pai_const_symbol(hp)^.sym^.name);
  355. end;
  356. ait_real_32bit : AsmWriteLn(#9#9'DD'#9+single2str(pai_real_32bit(hp)^.value));
  357. ait_real_64bit : AsmWriteLn(#9#9'DQ'#9+double2str(pai_real_64bit(hp)^.value));
  358. ait_real_80bit : AsmWriteLn(#9#9'DT'#9+extended2str(pai_real_80bit(hp)^.value));
  359. ait_comp_64bit : AsmWriteLn(#9#9'DQ'#9+comp2str(pai_real_80bit(hp)^.value));
  360. ait_string : begin
  361. counter := 0;
  362. lines := pai_string(hp)^.len div line_length;
  363. { separate lines in different parts }
  364. if pai_string(hp)^.len > 0 then
  365. Begin
  366. for j := 0 to lines-1 do
  367. begin
  368. AsmWrite(#9#9'DB'#9);
  369. quoted:=false;
  370. for i:=counter to counter+line_length do
  371. begin
  372. { it is an ascii character. }
  373. if (ord(pai_string(hp)^.str[i])>31) and
  374. (ord(pai_string(hp)^.str[i])<128) and
  375. (pai_string(hp)^.str[i]<>'"') then
  376. begin
  377. if not(quoted) then
  378. begin
  379. if i>counter then
  380. AsmWrite(',');
  381. AsmWrite('"');
  382. end;
  383. AsmWrite(pai_string(hp)^.str[i]);
  384. quoted:=true;
  385. end { if > 31 and < 128 and ord('"') }
  386. else
  387. begin
  388. if quoted then
  389. AsmWrite('"');
  390. if i>counter then
  391. AsmWrite(',');
  392. quoted:=false;
  393. AsmWrite(tostr(ord(pai_string(hp)^.str[i])));
  394. end;
  395. end; { end for i:=0 to... }
  396. if quoted then AsmWrite('"');
  397. AsmWrite(target_os.newline);
  398. counter := counter+line_length;
  399. end; { end for j:=0 ... }
  400. { do last line of lines }
  401. AsmWrite(#9#9'DB'#9);
  402. quoted:=false;
  403. for i:=counter to pai_string(hp)^.len-1 do
  404. begin
  405. { it is an ascii character. }
  406. if (ord(pai_string(hp)^.str[i])>31) and
  407. (ord(pai_string(hp)^.str[i])<128) and
  408. (pai_string(hp)^.str[i]<>'"') then
  409. begin
  410. if not(quoted) then
  411. begin
  412. if i>counter then
  413. AsmWrite(',');
  414. AsmWrite('"');
  415. end;
  416. AsmWrite(pai_string(hp)^.str[i]);
  417. quoted:=true;
  418. end { if > 31 and < 128 and " }
  419. else
  420. begin
  421. if quoted then
  422. AsmWrite('"');
  423. if i>counter then
  424. AsmWrite(',');
  425. quoted:=false;
  426. AsmWrite(tostr(ord(pai_string(hp)^.str[i])));
  427. end;
  428. end; { end for i:=0 to... }
  429. if quoted then
  430. AsmWrite('"');
  431. end;
  432. AsmLn;
  433. end;
  434. ait_label : begin
  435. if pai_label(hp)^.l^.is_used then
  436. AsmWriteLn(pai_label(hp)^.l^.name+':');
  437. end;
  438. ait_direct : begin
  439. AsmWritePChar(pai_direct(hp)^.str);
  440. AsmLn;
  441. end;
  442. ait_symbol : begin
  443. if pai_symbol(hp)^.is_global then
  444. AsmWriteLn(#9'GLOBAL '+pai_symbol(hp)^.sym^.name);
  445. AsmWrite(pai_symbol(hp)^.sym^.name);
  446. if assigned(hp^.next) and not(pai(hp^.next)^.typ in
  447. [ait_const_32bit,ait_const_16bit,ait_const_8bit,
  448. ait_const_symbol,ait_const_rva,
  449. ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_string]) then
  450. AsmWriteLn(':')
  451. end;
  452. ait_instruction : begin
  453. { We need intel order, no At&t }
  454. paicpu(hp)^.SwapOperands;
  455. { Reset }
  456. suffix:='';
  457. prefix:='';
  458. s:='';
  459. if paicpu(hp)^.ops<>0 then
  460. begin
  461. if is_calljmp(paicpu(hp)^.opcode) then
  462. s:=#9+getopstr_jmp(paicpu(hp)^.oper[0])
  463. else
  464. begin
  465. for i:=0to paicpu(hp)^.ops-1 do
  466. begin
  467. if i=0 then
  468. sep:=#9
  469. else
  470. sep:=',';
  471. s:=s+sep+getopstr(paicpu(hp)^.oper[i],paicpu(hp)^.opsize,paicpu(hp)^.opcode,
  472. paicpu(hp)^.ops,(i=2));
  473. end;
  474. end;
  475. end;
  476. if paicpu(hp)^.opcode=A_FWAIT then
  477. AsmWriteln(#9#9'DB'#9'09bh')
  478. else
  479. AsmWriteLn(#9#9+prefix+int_op2str[paicpu(hp)^.opcode]+
  480. cond2str[paicpu(hp)^.condition]+suffix+s);
  481. end;
  482. {$ifdef GDB}
  483. ait_stabn,
  484. ait_stabs,
  485. ait_force_line,
  486. ait_stab_function_name : ;
  487. {$endif GDB}
  488. ait_cut : begin
  489. { only reset buffer if nothing has changed }
  490. if AsmSize=AsmStartSize then
  491. AsmClear
  492. else
  493. begin
  494. AsmClose;
  495. DoAssemble;
  496. if pai_cut(hp)^.EndName then
  497. IsEndFile:=true;
  498. AsmCreate;
  499. end;
  500. { avoid empty files }
  501. while assigned(hp^.next) and (pai(hp^.next)^.typ in [ait_cut,ait_section,ait_comment]) do
  502. begin
  503. if pai(hp^.next)^.typ=ait_section then
  504. lastsec:=pai_section(hp^.next)^.sec;
  505. hp:=pai(hp^.next);
  506. end;
  507. if lastsec<>sec_none then
  508. AsmWriteLn('SECTION '+target_asm.secnames[lastsec]);
  509. AsmStartSize:=AsmSize;
  510. end;
  511. ait_marker : ;
  512. else
  513. internalerror(10000);
  514. end;
  515. hp:=pai(hp^.next);
  516. end;
  517. end;
  518. var
  519. currentasmlist : PAsmList;
  520. procedure writeexternal(p:pnamedindexobject);{$ifndef FPC}far;{$endif}
  521. begin
  522. if pasmsymbol(p)^.typ=AS_EXTERNAL then
  523. currentasmlist^.AsmWriteln('EXTERN'#9+p^.name);
  524. end;
  525. procedure ti386nasmasmlist.WriteExternals;
  526. begin
  527. currentasmlist:=@self;
  528. {$ifdef Delphi}
  529. AsmSymbolList^.foreach(@writeexternal);
  530. {$else}
  531. AsmSymbolList^.foreach({$ifndef TP}@{$endif}writeexternal);
  532. {$endif Delphi}
  533. end;
  534. procedure ti386nasmasmlist.WriteAsmList;
  535. begin
  536. {$ifdef EXTDEBUG}
  537. if assigned(current_module^.mainsource) then
  538. comment(v_info,'Start writing nasm-styled assembler output for '+current_module^.mainsource^);
  539. {$endif}
  540. LastSec:=sec_none;
  541. AsmWriteLn('BITS 32');
  542. AsmLn;
  543. countlabelref:=false;
  544. WriteExternals;
  545. { Nasm doesn't support stabs
  546. WriteTree(debuglist);}
  547. WriteTree(codesegment);
  548. WriteTree(datasegment);
  549. WriteTree(consts);
  550. WriteTree(rttilist);
  551. WriteTree(resourcestringlist);
  552. WriteTree(bsssegment);
  553. countlabelref:=true;
  554. AsmLn;
  555. {$ifdef EXTDEBUG}
  556. if assigned(current_module^.mainsource) then
  557. comment(v_info,'Done writing nasm-styled assembler output for '+current_module^.mainsource^);
  558. {$endif EXTDEBUG}
  559. end;
  560. end.
  561. {
  562. $Log$
  563. Revision 1.50 1999-09-02 18:47:43 daniel
  564. * Could not compile with TP, some arrays moved to heap
  565. * NOAG386BIN default for TP
  566. * AG386* files were not compatible with TP, fixed.
  567. Revision 1.49 1999/08/25 11:59:38 jonas
  568. * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
  569. Revision 1.48 1999/08/04 00:22:37 florian
  570. * renamed i386asm and i386base to cpuasm and cpubase
  571. Revision 1.47 1999/08/01 18:28:10 florian
  572. * modifications for the new code generator
  573. Revision 1.46 1999/07/22 09:37:33 florian
  574. + resourcestring implemented
  575. + start of longstring support
  576. Revision 1.45 1999/07/18 14:47:20 florian
  577. * bug 487 fixed, (inc(<property>) isn't allowed)
  578. * more fixes to compile with Delphi
  579. Revision 1.44 1999/07/18 10:19:41 florian
  580. * made it compilable with Dlephi 4 again
  581. + fixed problem with large stack allocations on win32
  582. Revision 1.43 1999/06/02 22:44:02 pierre
  583. * previous wrong log corrected
  584. Revision 1.42 1999/06/02 22:25:27 pierre
  585. * changed $ifdef FPC @ into $ifndef TP
  586. Revision 1.41 1999/06/01 14:45:44 peter
  587. * @procvar is now always needed for FPC
  588. Revision 1.40 1999/05/27 19:44:02 peter
  589. * removed oldasm
  590. * plabel -> pasmlabel
  591. * -a switches to source writing automaticly
  592. * assembler readers OOPed
  593. * asmsymbol automaticly external
  594. * jumptables and other label fixes for asm readers
  595. Revision 1.39 1999/05/23 18:41:57 florian
  596. * better error recovering in typed constants
  597. * some problems with arrays of const fixed, some problems
  598. due my previous
  599. - the location type of array constructor is now LOC_MEM
  600. - the pushing of high fixed
  601. - parameter copying fixed
  602. - zero temp. allocation removed
  603. * small problem in the assembler writers fixed:
  604. ref to nil wasn't written correctly
  605. Revision 1.38 1999/05/21 13:54:43 peter
  606. * NEWLAB for label as symbol
  607. Revision 1.37 1999/05/12 00:19:39 peter
  608. * removed R_DEFAULT_SEG
  609. * uniform float names
  610. Revision 1.36 1999/05/11 16:28:16 peter
  611. * long lines fixed
  612. Revision 1.35 1999/05/10 15:18:16 peter
  613. * fixed condition writing
  614. Revision 1.34 1999/05/08 19:52:34 peter
  615. + MessagePos() which is enhanced Message() function but also gets the
  616. position info
  617. * Removed comp warnings
  618. Revision 1.33 1999/05/07 00:08:48 pierre
  619. * AG386BIN cond -> OLDASM, only cosmetic
  620. Revision 1.32 1999/05/06 09:05:11 peter
  621. * generic write_float and str_float
  622. * fixed constant float conversions
  623. Revision 1.31 1999/05/04 21:44:32 florian
  624. * changes to compile it with Delphi 4.0
  625. Revision 1.30 1999/05/02 22:41:50 peter
  626. * moved section names to systems
  627. * fixed nasm,intel writer
  628. Revision 1.29 1999/05/01 13:23:59 peter
  629. * merged nasm compiler
  630. * old asm moved to oldasm/
  631. Revision 1.28 1999/04/17 22:17:06 pierre
  632. * ifdef USE_OP3 released (changed into ifndef NO_OP3)
  633. * SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
  634. Revision 1.27 1999/04/16 11:49:40 peter
  635. + tempalloc
  636. + -at to show temp alloc info in .s file
  637. Revision 1.26 1999/04/16 10:00:56 pierre
  638. + ifdef USE_OP3 code :
  639. added all missing op_... constructors for taicpu needed
  640. for SHRD,SHLD and IMUL code in assembler readers
  641. (check in tests/tbs0123.pp)
  642. Revision 1.25 1999/03/29 16:05:44 peter
  643. * optimizer working for ag386bin
  644. Revision 1.24 1999/03/10 13:25:44 pierre
  645. section order changed to get closer output from coff writer
  646. Revision 1.23 1999/03/04 13:55:39 pierre
  647. * some m68k fixes (still not compilable !)
  648. * new(tobj) does not give warning if tobj has no VMT !
  649. Revision 1.22 1999/03/02 02:56:11 peter
  650. + stabs support for binary writers
  651. * more fixes and missing updates from the previous commit :(
  652. Revision 1.21 1999/03/01 15:46:17 peter
  653. * ag386bin finally make cycles correct
  654. * prefixes are now also normal opcodes
  655. Revision 1.20 1999/02/26 00:48:14 peter
  656. * assembler writers fixed for ag386bin
  657. Revision 1.19 1999/02/25 21:02:19 peter
  658. * ag386bin updates
  659. + coff writer
  660. Revision 1.18 1999/02/22 02:15:00 peter
  661. * updates for ag386bin
  662. Revision 1.17 1998/12/20 16:21:23 peter
  663. * smartlinking doesn't crash anymore
  664. Revision 1.16 1998/12/16 00:27:18 peter
  665. * removed some obsolete version checks
  666. Revision 1.15 1998/12/01 11:19:39 peter
  667. * fixed range problem with in [tasmop]
  668. Revision 1.14 1998/11/30 09:42:56 pierre
  669. * some range check bugs fixed (still not working !)
  670. + added DLL writing support for win32 (also accepts variables)
  671. + TempAnsi for code that could be used for Temporary ansi strings
  672. handling
  673. Revision 1.13 1998/11/17 00:26:10 peter
  674. * fixed for $H+
  675. Revision 1.12 1998/11/12 11:19:34 pierre
  676. * fix for first line of function break
  677. Revision 1.11 1998/10/12 12:20:42 pierre
  678. + added tai_const_symbol_offset
  679. for r : pointer = @var.field;
  680. * better message for different arg names on implementation
  681. of function
  682. Revision 1.10 1998/10/06 17:16:34 pierre
  683. * some memory leaks fixed (thanks to Peter for heaptrc !)
  684. Revision 1.9 1998/10/01 20:19:07 jonas
  685. + ait_marker support
  686. Revision 1.8 1998/09/20 17:11:22 jonas
  687. * released REGALLOC
  688. Revision 1.7 1998/08/11 14:01:43 peter
  689. * fixed fwait bug using direct opcode
  690. Revision 1.6 1998/08/10 15:49:39 peter
  691. * small fixes for 0.99.5
  692. Revision 1.5 1998/08/08 10:19:18 florian
  693. * small fixes to write the extended type correct
  694. Revision 1.4 1998/06/05 17:46:03 peter
  695. * tp doesn't like comp() typecast
  696. Revision 1.3 1998/05/28 17:24:27 peter
  697. - $R- for tp to solve range errors with in[]
  698. Revision 1.2 1998/05/25 17:11:37 pierre
  699. * firstpasscount bug fixed
  700. now all is already set correctly the first time
  701. under EXTDEBUG try -gp to skip all other firstpasses
  702. it works !!
  703. * small bug fixes
  704. - for smallsets with -dTESTSMALLSET
  705. - some warnings removed (by correcting code !)
  706. Revision 1.1 1998/05/23 01:20:56 peter
  707. + aktasmmode, aktoptprocessor, aktoutputformat
  708. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  709. + $LIBNAME to set the library name where the unit will be put in
  710. * splitted cgi386 a bit (codeseg to large for bp7)
  711. * nasm, tasm works again. nasm moved to ag386nsm.pas
  712. }