ag386int.pas 29 KB

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