ag386nsm.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  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. const
  284. allocstr : array[boolean] of string[10]=(' released',' allocated');
  285. var
  286. s,
  287. prefix,
  288. suffix : string;
  289. hp : pai;
  290. counter,
  291. lines,
  292. i,j,l : longint;
  293. consttyp : tait;
  294. found,
  295. quoted : boolean;
  296. sep : char;
  297. begin
  298. if not assigned(p) then
  299. exit;
  300. hp:=pai(p^.first);
  301. while assigned(hp) do
  302. begin
  303. case hp^.typ of
  304. ait_comment :
  305. Begin
  306. AsmWrite(target_asm.comment);
  307. AsmWritePChar(pai_asm_comment(hp)^.str);
  308. AsmLn;
  309. End;
  310. ait_regalloc :
  311. begin
  312. if (cs_asm_regalloc in aktglobalswitches) then
  313. AsmWriteLn(target_asm.comment+'Register '+att_reg2str[pairegalloc(hp)^.reg]+
  314. allocstr[pairegalloc(hp)^.allocation]);
  315. end;
  316. ait_tempalloc :
  317. begin
  318. if (cs_asm_tempalloc in aktglobalswitches) then
  319. AsmWriteLn(target_asm.comment+'Temp '+tostr(paitempalloc(hp)^.temppos)+','+
  320. tostr(paitempalloc(hp)^.tempsize)+allocstr[paitempalloc(hp)^.allocation]);
  321. end;
  322. ait_section : begin
  323. if pai_section(hp)^.sec<>sec_none then
  324. begin
  325. AsmLn;
  326. AsmWriteLn('SECTION '+target_asm.secnames[pai_section(hp)^.sec]);
  327. end;
  328. LastSec:=pai_section(hp)^.sec;
  329. end;
  330. ait_align : AsmWriteLn(#9'ALIGN '+tostr(pai_align(hp)^.aligntype));
  331. ait_datablock : begin
  332. if pai_datablock(hp)^.is_global then
  333. AsmWriteLn(#9'GLOBAL '+pai_datablock(hp)^.sym^.name);
  334. AsmWriteLn(PadTabs(pai_datablock(hp)^.sym^.name,':')+'RESB'#9+tostr(pai_datablock(hp)^.size));
  335. end;
  336. ait_const_32bit,
  337. ait_const_8bit,
  338. ait_const_16bit : begin
  339. AsmWrite(ait_const2str[hp^.typ]+tostr(pai_const(hp)^.value));
  340. consttyp:=hp^.typ;
  341. l:=0;
  342. repeat
  343. found:=(not (Pai(hp^.next)=nil)) and (Pai(hp^.next)^.typ=consttyp);
  344. if found then
  345. begin
  346. hp:=Pai(hp^.next);
  347. s:=','+tostr(pai_const(hp)^.value);
  348. AsmWrite(s);
  349. inc(l,length(s));
  350. end;
  351. until (not found) or (l>line_length);
  352. AsmLn;
  353. end;
  354. ait_const_symbol : begin
  355. AsmWriteLn(#9#9'DD'#9+pai_const_symbol(hp)^.sym^.name);
  356. if pai_const_symbol(hp)^.offset>0 then
  357. AsmWrite('+'+tostr(pai_const_symbol(hp)^.offset))
  358. else if pai_const_symbol(hp)^.offset<0 then
  359. AsmWrite(tostr(pai_const_symbol(hp)^.offset));
  360. AsmLn;
  361. end;
  362. ait_const_rva : begin
  363. AsmWriteLn(#9#9'RVA'#9+pai_const_symbol(hp)^.sym^.name);
  364. end;
  365. ait_real_32bit : AsmWriteLn(#9#9'DD'#9+single2str(pai_real_32bit(hp)^.value));
  366. ait_real_64bit : AsmWriteLn(#9#9'DQ'#9+double2str(pai_real_64bit(hp)^.value));
  367. ait_real_80bit : AsmWriteLn(#9#9'DT'#9+extended2str(pai_real_80bit(hp)^.value));
  368. ait_comp_64bit : AsmWriteLn(#9#9'DQ'#9+comp2str(pai_real_80bit(hp)^.value));
  369. ait_string : begin
  370. counter := 0;
  371. lines := pai_string(hp)^.len div line_length;
  372. { separate lines in different parts }
  373. if pai_string(hp)^.len > 0 then
  374. Begin
  375. for j := 0 to lines-1 do
  376. begin
  377. AsmWrite(#9#9'DB'#9);
  378. quoted:=false;
  379. for i:=counter to counter+line_length do
  380. begin
  381. { it is an ascii character. }
  382. if (ord(pai_string(hp)^.str[i])>31) and
  383. (ord(pai_string(hp)^.str[i])<128) and
  384. (pai_string(hp)^.str[i]<>'"') then
  385. begin
  386. if not(quoted) then
  387. begin
  388. if i>counter then
  389. AsmWrite(',');
  390. AsmWrite('"');
  391. end;
  392. AsmWrite(pai_string(hp)^.str[i]);
  393. quoted:=true;
  394. end { if > 31 and < 128 and ord('"') }
  395. else
  396. begin
  397. if quoted then
  398. AsmWrite('"');
  399. if i>counter then
  400. AsmWrite(',');
  401. quoted:=false;
  402. AsmWrite(tostr(ord(pai_string(hp)^.str[i])));
  403. end;
  404. end; { end for i:=0 to... }
  405. if quoted then AsmWrite('"');
  406. AsmWrite(target_os.newline);
  407. counter := counter+line_length;
  408. end; { end for j:=0 ... }
  409. { do last line of lines }
  410. AsmWrite(#9#9'DB'#9);
  411. quoted:=false;
  412. for i:=counter to pai_string(hp)^.len-1 do
  413. begin
  414. { it is an ascii character. }
  415. if (ord(pai_string(hp)^.str[i])>31) and
  416. (ord(pai_string(hp)^.str[i])<128) and
  417. (pai_string(hp)^.str[i]<>'"') then
  418. begin
  419. if not(quoted) then
  420. begin
  421. if i>counter then
  422. AsmWrite(',');
  423. AsmWrite('"');
  424. end;
  425. AsmWrite(pai_string(hp)^.str[i]);
  426. quoted:=true;
  427. end { if > 31 and < 128 and " }
  428. else
  429. begin
  430. if quoted then
  431. AsmWrite('"');
  432. if i>counter then
  433. AsmWrite(',');
  434. quoted:=false;
  435. AsmWrite(tostr(ord(pai_string(hp)^.str[i])));
  436. end;
  437. end; { end for i:=0 to... }
  438. if quoted then
  439. AsmWrite('"');
  440. end;
  441. AsmLn;
  442. end;
  443. ait_label : begin
  444. if pai_label(hp)^.l^.is_used then
  445. AsmWriteLn(pai_label(hp)^.l^.name+':');
  446. end;
  447. ait_direct : begin
  448. AsmWritePChar(pai_direct(hp)^.str);
  449. AsmLn;
  450. end;
  451. ait_symbol : begin
  452. if pai_symbol(hp)^.is_global then
  453. AsmWriteLn(#9'GLOBAL '+pai_symbol(hp)^.sym^.name);
  454. AsmWrite(pai_symbol(hp)^.sym^.name);
  455. if assigned(hp^.next) and not(pai(hp^.next)^.typ in
  456. [ait_const_32bit,ait_const_16bit,ait_const_8bit,
  457. ait_const_symbol,ait_const_rva,
  458. ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_string]) then
  459. AsmWriteLn(':')
  460. end;
  461. ait_symbol_end :
  462. begin
  463. end;
  464. ait_instruction : begin
  465. { We need intel order, no At&t }
  466. paicpu(hp)^.SwapOperands;
  467. { Reset }
  468. suffix:='';
  469. prefix:='';
  470. s:='';
  471. if paicpu(hp)^.ops<>0 then
  472. begin
  473. if is_calljmp(paicpu(hp)^.opcode) then
  474. s:=#9+getopstr_jmp(paicpu(hp)^.oper[0])
  475. else
  476. begin
  477. for i:=0to paicpu(hp)^.ops-1 do
  478. begin
  479. if i=0 then
  480. sep:=#9
  481. else
  482. sep:=',';
  483. s:=s+sep+getopstr(paicpu(hp)^.oper[i],paicpu(hp)^.opsize,paicpu(hp)^.opcode,
  484. paicpu(hp)^.ops,(i=2));
  485. end;
  486. end;
  487. end;
  488. if paicpu(hp)^.opcode=A_FWAIT then
  489. AsmWriteln(#9#9'DB'#9'09bh')
  490. else
  491. AsmWriteLn(#9#9+prefix+int_op2str[paicpu(hp)^.opcode]+
  492. cond2str[paicpu(hp)^.condition]+suffix+s);
  493. end;
  494. {$ifdef GDB}
  495. ait_stabn,
  496. ait_stabs,
  497. ait_force_line,
  498. ait_stab_function_name : ;
  499. {$endif GDB}
  500. ait_cut : begin
  501. { only reset buffer if nothing has changed }
  502. if AsmSize=AsmStartSize then
  503. AsmClear
  504. else
  505. begin
  506. AsmClose;
  507. DoAssemble;
  508. if pai_cut(hp)^.EndName then
  509. IsEndFile:=true;
  510. AsmCreate;
  511. end;
  512. { avoid empty files }
  513. while assigned(hp^.next) and (pai(hp^.next)^.typ in [ait_cut,ait_section,ait_comment]) do
  514. begin
  515. if pai(hp^.next)^.typ=ait_section then
  516. lastsec:=pai_section(hp^.next)^.sec;
  517. hp:=pai(hp^.next);
  518. end;
  519. if lastsec<>sec_none then
  520. AsmWriteLn('SECTION '+target_asm.secnames[lastsec]);
  521. AsmStartSize:=AsmSize;
  522. end;
  523. ait_marker : ;
  524. else
  525. internalerror(10000);
  526. end;
  527. hp:=pai(hp^.next);
  528. end;
  529. end;
  530. var
  531. currentasmlist : PAsmList;
  532. procedure writeexternal(p:pnamedindexobject);{$ifndef FPC}far;{$endif}
  533. begin
  534. if pasmsymbol(p)^.typ=AS_EXTERNAL then
  535. currentasmlist^.AsmWriteln('EXTERN'#9+p^.name);
  536. end;
  537. procedure ti386nasmasmlist.WriteExternals;
  538. begin
  539. currentasmlist:=@self;
  540. {$ifdef Delphi}
  541. AsmSymbolList^.foreach(@writeexternal);
  542. {$else}
  543. AsmSymbolList^.foreach({$ifndef TP}@{$endif}writeexternal);
  544. {$endif Delphi}
  545. end;
  546. procedure ti386nasmasmlist.WriteAsmList;
  547. begin
  548. {$ifdef EXTDEBUG}
  549. if assigned(current_module^.mainsource) then
  550. comment(v_info,'Start writing nasm-styled assembler output for '+current_module^.mainsource^);
  551. {$endif}
  552. LastSec:=sec_none;
  553. AsmWriteLn('BITS 32');
  554. AsmLn;
  555. countlabelref:=false;
  556. WriteExternals;
  557. { Nasm doesn't support stabs
  558. WriteTree(debuglist);}
  559. WriteTree(codesegment);
  560. WriteTree(datasegment);
  561. WriteTree(consts);
  562. WriteTree(rttilist);
  563. WriteTree(resourcestringlist);
  564. WriteTree(bsssegment);
  565. countlabelref:=true;
  566. AsmLn;
  567. {$ifdef EXTDEBUG}
  568. if assigned(current_module^.mainsource) then
  569. comment(v_info,'Done writing nasm-styled assembler output for '+current_module^.mainsource^);
  570. {$endif EXTDEBUG}
  571. end;
  572. end.
  573. {
  574. $Log$
  575. Revision 1.51 1999-09-10 15:41:18 peter
  576. * added symbol_end
  577. Revision 1.50 1999/09/02 18:47:43 daniel
  578. * Could not compile with TP, some arrays moved to heap
  579. * NOAG386BIN default for TP
  580. * AG386* files were not compatible with TP, fixed.
  581. Revision 1.49 1999/08/25 11:59:38 jonas
  582. * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
  583. Revision 1.48 1999/08/04 00:22:37 florian
  584. * renamed i386asm and i386base to cpuasm and cpubase
  585. Revision 1.47 1999/08/01 18:28:10 florian
  586. * modifications for the new code generator
  587. Revision 1.46 1999/07/22 09:37:33 florian
  588. + resourcestring implemented
  589. + start of longstring support
  590. Revision 1.45 1999/07/18 14:47:20 florian
  591. * bug 487 fixed, (inc(<property>) isn't allowed)
  592. * more fixes to compile with Delphi
  593. Revision 1.44 1999/07/18 10:19:41 florian
  594. * made it compilable with Dlephi 4 again
  595. + fixed problem with large stack allocations on win32
  596. Revision 1.43 1999/06/02 22:44:02 pierre
  597. * previous wrong log corrected
  598. Revision 1.42 1999/06/02 22:25:27 pierre
  599. * changed $ifdef FPC @ into $ifndef TP
  600. Revision 1.41 1999/06/01 14:45:44 peter
  601. * @procvar is now always needed for FPC
  602. Revision 1.40 1999/05/27 19:44:02 peter
  603. * removed oldasm
  604. * plabel -> pasmlabel
  605. * -a switches to source writing automaticly
  606. * assembler readers OOPed
  607. * asmsymbol automaticly external
  608. * jumptables and other label fixes for asm readers
  609. Revision 1.39 1999/05/23 18:41:57 florian
  610. * better error recovering in typed constants
  611. * some problems with arrays of const fixed, some problems
  612. due my previous
  613. - the location type of array constructor is now LOC_MEM
  614. - the pushing of high fixed
  615. - parameter copying fixed
  616. - zero temp. allocation removed
  617. * small problem in the assembler writers fixed:
  618. ref to nil wasn't written correctly
  619. Revision 1.38 1999/05/21 13:54:43 peter
  620. * NEWLAB for label as symbol
  621. Revision 1.37 1999/05/12 00:19:39 peter
  622. * removed R_DEFAULT_SEG
  623. * uniform float names
  624. Revision 1.36 1999/05/11 16:28:16 peter
  625. * long lines fixed
  626. Revision 1.35 1999/05/10 15:18:16 peter
  627. * fixed condition writing
  628. Revision 1.34 1999/05/08 19:52:34 peter
  629. + MessagePos() which is enhanced Message() function but also gets the
  630. position info
  631. * Removed comp warnings
  632. Revision 1.33 1999/05/07 00:08:48 pierre
  633. * AG386BIN cond -> OLDASM, only cosmetic
  634. Revision 1.32 1999/05/06 09:05:11 peter
  635. * generic write_float and str_float
  636. * fixed constant float conversions
  637. Revision 1.31 1999/05/04 21:44:32 florian
  638. * changes to compile it with Delphi 4.0
  639. Revision 1.30 1999/05/02 22:41:50 peter
  640. * moved section names to systems
  641. * fixed nasm,intel writer
  642. Revision 1.29 1999/05/01 13:23:59 peter
  643. * merged nasm compiler
  644. * old asm moved to oldasm/
  645. Revision 1.28 1999/04/17 22:17:06 pierre
  646. * ifdef USE_OP3 released (changed into ifndef NO_OP3)
  647. * SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
  648. Revision 1.27 1999/04/16 11:49:40 peter
  649. + tempalloc
  650. + -at to show temp alloc info in .s file
  651. Revision 1.26 1999/04/16 10:00:56 pierre
  652. + ifdef USE_OP3 code :
  653. added all missing op_... constructors for taicpu needed
  654. for SHRD,SHLD and IMUL code in assembler readers
  655. (check in tests/tbs0123.pp)
  656. Revision 1.25 1999/03/29 16:05:44 peter
  657. * optimizer working for ag386bin
  658. Revision 1.24 1999/03/10 13:25:44 pierre
  659. section order changed to get closer output from coff writer
  660. Revision 1.23 1999/03/04 13:55:39 pierre
  661. * some m68k fixes (still not compilable !)
  662. * new(tobj) does not give warning if tobj has no VMT !
  663. Revision 1.22 1999/03/02 02:56:11 peter
  664. + stabs support for binary writers
  665. * more fixes and missing updates from the previous commit :(
  666. Revision 1.21 1999/03/01 15:46:17 peter
  667. * ag386bin finally make cycles correct
  668. * prefixes are now also normal opcodes
  669. Revision 1.20 1999/02/26 00:48:14 peter
  670. * assembler writers fixed for ag386bin
  671. Revision 1.19 1999/02/25 21:02:19 peter
  672. * ag386bin updates
  673. + coff writer
  674. Revision 1.18 1999/02/22 02:15:00 peter
  675. * updates for ag386bin
  676. Revision 1.17 1998/12/20 16:21:23 peter
  677. * smartlinking doesn't crash anymore
  678. Revision 1.16 1998/12/16 00:27:18 peter
  679. * removed some obsolete version checks
  680. Revision 1.15 1998/12/01 11:19:39 peter
  681. * fixed range problem with in [tasmop]
  682. Revision 1.14 1998/11/30 09:42:56 pierre
  683. * some range check bugs fixed (still not working !)
  684. + added DLL writing support for win32 (also accepts variables)
  685. + TempAnsi for code that could be used for Temporary ansi strings
  686. handling
  687. Revision 1.13 1998/11/17 00:26:10 peter
  688. * fixed for $H+
  689. Revision 1.12 1998/11/12 11:19:34 pierre
  690. * fix for first line of function break
  691. Revision 1.11 1998/10/12 12:20:42 pierre
  692. + added tai_const_symbol_offset
  693. for r : pointer = @var.field;
  694. * better message for different arg names on implementation
  695. of function
  696. Revision 1.10 1998/10/06 17:16:34 pierre
  697. * some memory leaks fixed (thanks to Peter for heaptrc !)
  698. Revision 1.9 1998/10/01 20:19:07 jonas
  699. + ait_marker support
  700. Revision 1.8 1998/09/20 17:11:22 jonas
  701. * released REGALLOC
  702. Revision 1.7 1998/08/11 14:01:43 peter
  703. * fixed fwait bug using direct opcode
  704. Revision 1.6 1998/08/10 15:49:39 peter
  705. * small fixes for 0.99.5
  706. Revision 1.5 1998/08/08 10:19:18 florian
  707. * small fixes to write the extended type correct
  708. Revision 1.4 1998/06/05 17:46:03 peter
  709. * tp doesn't like comp() typecast
  710. Revision 1.3 1998/05/28 17:24:27 peter
  711. - $R- for tp to solve range errors with in[]
  712. Revision 1.2 1998/05/25 17:11:37 pierre
  713. * firstpasscount bug fixed
  714. now all is already set correctly the first time
  715. under EXTDEBUG try -gp to skip all other firstpasses
  716. it works !!
  717. * small bug fixes
  718. - for smallsets with -dTESTSMALLSET
  719. - some warnings removed (by correcting code !)
  720. Revision 1.1 1998/05/23 01:20:56 peter
  721. + aktasmmode, aktoptprocessor, aktoutputformat
  722. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  723. + $LIBNAME to set the library name where the unit will be put in
  724. * splitted cgi386 a bit (codeseg to large for bp7)
  725. * nasm, tasm works again. nasm moved to ag386nsm.pas
  726. }