ag386int.pas 29 KB

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