ag386int.pas 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  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. AsmCreate(pai_cut(hp)^.place);
  523. end;
  524. { avoid empty files }
  525. while assigned(hp^.next) and (pai(hp^.next)^.typ in [ait_cut,ait_section,ait_comment]) do
  526. begin
  527. if pai(hp^.next)^.typ=ait_section then
  528. begin
  529. lastsec:=pai_section(hp^.next)^.sec;
  530. end;
  531. hp:=pai(hp^.next);
  532. end;
  533. AsmWriteLn(#9'.386p');
  534. AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
  535. if lastsec<>sec_none then
  536. AsmWriteLn('_'+target_asm.secnames[lastsec]+#9#9+
  537. 'SEGMENT'#9'PARA PUBLIC USE32 '''+
  538. target_asm.secnames[lastsec]+'''');
  539. AsmStartSize:=AsmSize;
  540. end;
  541. ait_marker: ;
  542. else
  543. internalerror(10000);
  544. end;
  545. hp:=pai(hp^.next);
  546. end;
  547. end;
  548. var
  549. currentasmlist : PAsmList;
  550. procedure writeexternal(p:pnamedindexobject);{$ifndef FPC}far;{$endif}
  551. begin
  552. if pasmsymbol(p)^.typ=AS_EXTERNAL then
  553. currentasmlist^.AsmWriteln(#9'EXTRN'#9+p^.name);
  554. end;
  555. procedure ti386intasmlist.WriteExternals;
  556. begin
  557. currentasmlist:=@self;
  558. AsmSymbolList^.foreach({$ifndef VER70}@{$endif}writeexternal);
  559. end;
  560. procedure ti386intasmlist.WriteAsmList;
  561. begin
  562. {$ifdef EXTDEBUG}
  563. if assigned(current_module^.mainsource) then
  564. comment(v_info,'Start writing intel-styled assembler output for '+current_module^.mainsource^);
  565. {$endif}
  566. LastSec:=sec_none;
  567. AsmWriteLn(#9'.386p');
  568. AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
  569. AsmWriteLn('DGROUP'#9'GROUP'#9'_BSS,_DATA');
  570. AsmWriteLn(#9'ASSUME'#9'CS:_CODE,ES:DGROUP,DS:DGROUP,SS:DGROUP');
  571. AsmLn;
  572. countlabelref:=false;
  573. WriteExternals;
  574. { INTEL ASM doesn't support stabs
  575. WriteTree(debuglist);}
  576. WriteTree(codesegment);
  577. WriteTree(datasegment);
  578. WriteTree(consts);
  579. WriteTree(rttilist);
  580. WriteTree(resourcestringlist);
  581. WriteTree(bsssegment);
  582. countlabelref:=true;
  583. AsmWriteLn(#9'END');
  584. AsmLn;
  585. {$ifdef EXTDEBUG}
  586. if assigned(current_module^.mainsource) then
  587. comment(v_info,'Done writing intel-styled assembler output for '+current_module^.mainsource^);
  588. {$endif EXTDEBUG}
  589. end;
  590. end.
  591. {
  592. $Log$
  593. Revision 1.55 1999-11-02 15:06:56 peter
  594. * import library fixes for win32
  595. * alignment works again
  596. Revision 1.54 1999/09/10 15:41:18 peter
  597. * added symbol_end
  598. Revision 1.53 1999/09/02 18:47:42 daniel
  599. * Could not compile with TP, some arrays moved to heap
  600. * NOAG386BIN default for TP
  601. * AG386* files were not compatible with TP, fixed.
  602. Revision 1.52 1999/08/25 11:59:36 jonas
  603. * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
  604. Revision 1.51 1999/08/04 00:22:36 florian
  605. * renamed i386asm and i386base to cpuasm and cpubase
  606. Revision 1.50 1999/07/22 09:37:31 florian
  607. + resourcestring implemented
  608. + start of longstring support
  609. Revision 1.49 1999/07/18 14:47:19 florian
  610. * bug 487 fixed, (inc(<property>) isn't allowed)
  611. * more fixes to compile with Delphi
  612. Revision 1.48 1999/07/18 10:19:39 florian
  613. * made it compilable with Dlephi 4 again
  614. + fixed problem with large stack allocations on win32
  615. Revision 1.47 1999/06/02 22:44:01 pierre
  616. * previous wrong log corrected
  617. Revision 1.46 1999/06/02 22:25:26 pierre
  618. * changed $ifdef FPC @ into $ifndef TP
  619. Revision 1.45 1999/06/01 14:45:43 peter
  620. * @procvar is now always needed for FPC
  621. Revision 1.44 1999/05/27 19:44:00 peter
  622. * removed oldasm
  623. * plabel -> pasmlabel
  624. * -a switches to source writing automaticly
  625. * assembler readers OOPed
  626. * asmsymbol automaticly external
  627. * jumptables and other label fixes for asm readers
  628. Revision 1.43 1999/05/23 18:41:55 florian
  629. * better error recovering in typed constants
  630. * some problems with arrays of const fixed, some problems
  631. due my previous
  632. - the location type of array constructor is now LOC_MEM
  633. - the pushing of high fixed
  634. - parameter copying fixed
  635. - zero temp. allocation removed
  636. * small problem in the assembler writers fixed:
  637. ref to nil wasn't written correctly
  638. Revision 1.42 1999/05/21 13:54:42 peter
  639. * NEWLAB for label as symbol
  640. Revision 1.41 1999/05/12 00:19:38 peter
  641. * removed R_DEFAULT_SEG
  642. * uniform float names
  643. Revision 1.40 1999/05/10 15:18:14 peter
  644. * fixed condition writing
  645. Revision 1.39 1999/05/08 19:52:33 peter
  646. + MessagePos() which is enhanced Message() function but also gets the
  647. position info
  648. * Removed comp warnings
  649. Revision 1.38 1999/05/07 00:08:49 pierre
  650. * AG386BIN cond -> OLDASM, only cosmetic
  651. Revision 1.37 1999/05/06 09:05:09 peter
  652. * generic write_float and str_float
  653. * fixed constant float conversions
  654. Revision 1.36 1999/05/04 21:44:31 florian
  655. * changes to compile it with Delphi 4.0
  656. Revision 1.35 1999/05/02 22:41:49 peter
  657. * moved section names to systems
  658. * fixed nasm,intel writer
  659. Revision 1.34 1999/05/01 13:23:58 peter
  660. * merged nasm compiler
  661. * old asm moved to oldasm/
  662. Revision 1.33 1999/04/17 22:17:05 pierre
  663. * ifdef USE_OP3 released (changed into ifndef NO_OP3)
  664. * SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
  665. Revision 1.32 1999/04/16 11:49:39 peter
  666. + tempalloc
  667. + -at to show temp alloc info in .s file
  668. Revision 1.31 1999/04/16 10:00:55 pierre
  669. + ifdef USE_OP3 code :
  670. added all missing op_... constructors for taicpu needed
  671. for SHRD,SHLD and IMUL code in assembler readers
  672. (check in tests/tbs0123.pp)
  673. Revision 1.30 1999/03/29 16:05:43 peter
  674. * optimizer working for ag386bin
  675. Revision 1.29 1999/03/02 02:56:10 peter
  676. + stabs support for binary writers
  677. * more fixes and missing updates from the previous commit :(
  678. Revision 1.28 1999/03/01 15:46:16 peter
  679. * ag386bin finally make cycles correct
  680. * prefixes are now also normal opcodes
  681. Revision 1.27 1999/02/26 00:48:13 peter
  682. * assembler writers fixed for ag386bin
  683. Revision 1.26 1999/02/25 21:02:18 peter
  684. * ag386bin updates
  685. + coff writer
  686. Revision 1.25 1999/02/22 02:14:59 peter
  687. * updates for ag386bin
  688. Revision 1.24 1998/12/20 16:21:22 peter
  689. * smartlinking doesn't crash anymore
  690. Revision 1.23 1998/12/16 00:27:17 peter
  691. * removed some obsolete version checks
  692. Revision 1.22 1998/12/01 11:19:38 peter
  693. * fixed range problem with in [tasmop]
  694. Revision 1.21 1998/11/30 09:42:55 pierre
  695. * some range check bugs fixed (still not working !)
  696. + added DLL writing support for win32 (also accepts variables)
  697. + TempAnsi for code that could be used for Temporary ansi strings
  698. handling
  699. Revision 1.20 1998/11/17 00:26:09 peter
  700. * fixed for $H+
  701. Revision 1.19 1998/11/16 12:38:05 jonas
  702. + readded ait_marker support
  703. Revision 1.18 1998/11/12 11:19:33 pierre
  704. * fix for first line of function break
  705. Revision 1.17 1998/10/12 12:20:40 pierre
  706. + added tai_const_symbol_offset
  707. for r : pointer = @var.field;
  708. * better message for different arg names on implementation
  709. of function
  710. Revision 1.16 1998/10/06 17:16:33 pierre
  711. * some memory leaks fixed (thanks to Peter for heaptrc !)
  712. Revision 1.15 1998/10/01 20:19:06 jonas
  713. + ait_marker support
  714. Revision 1.14 1998/09/20 17:11:21 jonas
  715. * released REGALLOC
  716. Revision 1.13 1998/08/10 15:49:38 peter
  717. * small fixes for 0.99.5
  718. Revision 1.12 1998/08/08 10:19:17 florian
  719. * small fixes to write the extended type correct
  720. Revision 1.11 1998/06/05 17:46:02 peter
  721. * tp doesn't like comp() typecast
  722. Revision 1.10 1998/05/25 17:11:36 pierre
  723. * firstpasscount bug fixed
  724. now all is already set correctly the first time
  725. under EXTDEBUG try -gp to skip all other firstpasses
  726. it works !!
  727. * small bug fixes
  728. - for smallsets with -dTESTSMALLSET
  729. - some warnings removed (by correcting code !)
  730. Revision 1.9 1998/05/23 01:20:55 peter
  731. + aktasmmode, aktoptprocessor, aktoutputformat
  732. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  733. + $LIBNAME to set the library name where the unit will be put in
  734. * splitted cgi386 a bit (codeseg to large for bp7)
  735. * nasm, tasm works again. nasm moved to ag386nsm.pas
  736. Revision 1.8 1998/05/06 18:36:53 peter
  737. * tai_section extended with code,data,bss sections and enumerated type
  738. * ident 'compiled by FPC' moved to pmodules
  739. * small fix for smartlink
  740. Revision 1.7 1998/05/06 08:38:32 pierre
  741. * better position info with UseTokenInfo
  742. UseTokenInfo greatly simplified
  743. + added check for changed tree after first time firstpass
  744. (if we could remove all the cases were it happen
  745. we could skip all firstpass if firstpasscount > 1)
  746. Only with ExtDebug
  747. Revision 1.6 1998/05/04 17:54:24 peter
  748. + smartlinking works (only case jumptable left todo)
  749. * redesign of systems.pas to support assemblers and linkers
  750. + Unitname is now also in the PPU-file, increased version to 14
  751. Revision 1.5 1998/05/01 07:43:52 florian
  752. + basics for rtti implemented
  753. + switch $m (generate rtti for published sections)
  754. Revision 1.4 1998/04/29 10:33:41 pierre
  755. + added some code for ansistring (not complete nor working yet)
  756. * corrected operator overloading
  757. * corrected nasm output
  758. + started inline procedures
  759. + added starstarn : use ** for exponentiation (^ gave problems)
  760. + started UseTokenInfo cond to get accurate positions
  761. Revision 1.3 1998/04/08 16:58:01 pierre
  762. * several bugfixes
  763. ADD ADC and AND are also sign extended
  764. nasm output OK (program still crashes at end
  765. and creates wrong assembler files !!)
  766. procsym types sym in tdef removed !!
  767. Revision 1.2 1998/04/08 11:34:17 peter
  768. * nasm works (linux only tested)
  769. }