cg386ld.pas 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. Generate i386 assembler for load/assignment nodes
  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. unit cg386ld;
  19. interface
  20. uses
  21. tree;
  22. procedure secondload(var p : ptree);
  23. procedure secondassignment(var p : ptree);
  24. procedure secondfuncret(var p : ptree);
  25. procedure secondarrayconstruct(var p : ptree);
  26. implementation
  27. uses
  28. globtype,systems,
  29. cobjects,verbose,globals,files,
  30. symconst,symtable,aasm,types,
  31. hcodegen,temp_gen,pass_2,
  32. cpubase,cpuasm,
  33. cgai386,tgeni386,cg386cnv,cresstr;
  34. {*****************************************************************************
  35. SecondLoad
  36. *****************************************************************************}
  37. procedure secondload(var p : ptree);
  38. var
  39. hregister : tregister;
  40. symtabletype : tsymtabletype;
  41. i : longint;
  42. hp : preference;
  43. s : pasmsymbol;
  44. popeax : boolean;
  45. pushed : tpushed;
  46. hr : treference;
  47. begin
  48. simple_loadn:=true;
  49. reset_reference(p^.location.reference);
  50. case p^.symtableentry^.typ of
  51. { this is only for toasm and toaddr }
  52. absolutesym :
  53. begin
  54. p^.location.reference.symbol:=nil;
  55. if (pabsolutesym(p^.symtableentry)^.abstyp=toaddr) then
  56. begin
  57. if pabsolutesym(p^.symtableentry)^.absseg then
  58. p^.location.reference.segment:=R_FS;
  59. p^.location.reference.offset:=pabsolutesym(p^.symtableentry)^.address;
  60. end
  61. else
  62. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  63. end;
  64. constsym:
  65. begin
  66. if pconstsym(p^.symtableentry)^.consttype=constresourcestring then
  67. begin
  68. pushusedregisters(pushed,$ff);
  69. emit_const(A_PUSH,S_L,
  70. pconstsym(p^.symtableentry)^.resstrindex);
  71. emit_sym(A_PUSH,S_L,newasmsymbol(pconstsym(p^.symtableentry)^.owner^.name^+'_RESOURCESTRINGLIST'));
  72. emitcall('FPC_GETRESOURCESTRING');
  73. hregister:=getexplicitregister32(R_EAX);
  74. emit_reg_reg(A_MOV,S_L,R_EAX,hregister);
  75. if gettempansistringreference(hr) then
  76. decrstringref(p^.resulttype,hr);
  77. emit_reg_ref(A_MOV,S_L,hregister,
  78. newreference(hr));
  79. ungetregister32(hregister);
  80. popusedregisters(pushed);
  81. p^.location.loc:=LOC_MEM;
  82. p^.location.reference:=hr;
  83. end
  84. else
  85. internalerror(22798);
  86. end;
  87. varsym :
  88. begin
  89. hregister:=R_NO;
  90. { C variable }
  91. if (vo_is_C_var in pvarsym(p^.symtableentry)^.varoptions) then
  92. begin
  93. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  94. end
  95. { DLL variable }
  96. else if (vo_is_dll_var in pvarsym(p^.symtableentry)^.varoptions) then
  97. begin
  98. hregister:=getregister32;
  99. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  100. emit_ref_reg(A_MOV,S_L,newreference(p^.location.reference),hregister);
  101. p^.location.reference.symbol:=nil;
  102. p^.location.reference.base:=hregister;
  103. end
  104. { external variable }
  105. else if (vo_is_external in pvarsym(p^.symtableentry)^.varoptions) then
  106. begin
  107. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  108. end
  109. { thread variable }
  110. else if (vo_is_thread_var in pvarsym(p^.symtableentry)^.varoptions) then
  111. begin
  112. popeax:=not(R_EAX in unused);
  113. if popeax then
  114. emit_reg(A_PUSH,S_L,R_EAX);
  115. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  116. emit_ref(A_PUSH,S_L,newreference(p^.location.reference));
  117. { the called procedure isn't allowed to change }
  118. { any register except EAX }
  119. emitcall('FPC_RELOCATE_THREADVAR');
  120. reset_reference(p^.location.reference);
  121. p^.location.reference.base:=getregister32;
  122. emit_reg_reg(A_MOV,S_L,R_EAX,p^.location.reference.base);
  123. if popeax then
  124. emit_reg(A_POP,S_L,R_EAX);
  125. end
  126. { normal variable }
  127. else
  128. begin
  129. symtabletype:=p^.symtable^.symtabletype;
  130. { in case it is a register variable: }
  131. if pvarsym(p^.symtableentry)^.reg<>R_NO then
  132. begin
  133. if pvarsym(p^.symtableentry)^.reg in [R_ST0..R_ST7] then
  134. begin
  135. p^.location.loc:=LOC_CFPUREGISTER;
  136. p^.location.register:=pvarsym(p^.symtableentry)^.reg;
  137. end
  138. else
  139. begin
  140. p^.location.loc:=LOC_CREGISTER;
  141. p^.location.register:=pvarsym(p^.symtableentry)^.reg;
  142. unused:=unused-[pvarsym(p^.symtableentry)^.reg];
  143. end;
  144. end
  145. else
  146. begin
  147. { first handle local and temporary variables }
  148. if (symtabletype in [parasymtable,inlinelocalsymtable,
  149. inlineparasymtable,localsymtable]) then
  150. begin
  151. p^.location.reference.base:=procinfo.framepointer;
  152. p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address+p^.symtable^.address_fixup;
  153. if (symtabletype in [localsymtable,inlinelocalsymtable]) then
  154. begin
  155. if use_esp_stackframe then
  156. dec(p^.location.reference.offset,
  157. pvarsym(p^.symtableentry)^.getsize)
  158. else
  159. p^.location.reference.offset:=-p^.location.reference.offset;
  160. end;
  161. if (lexlevel>(p^.symtable^.symtablelevel)) then
  162. begin
  163. hregister:=getregister32;
  164. { make a reference }
  165. hp:=new_reference(procinfo.framepointer,
  166. procinfo.framepointer_offset);
  167. emit_ref_reg(A_MOV,S_L,hp,hregister);
  168. simple_loadn:=false;
  169. i:=lexlevel-1;
  170. while i>(p^.symtable^.symtablelevel) do
  171. begin
  172. { make a reference }
  173. hp:=new_reference(hregister,8);
  174. emit_ref_reg(A_MOV,S_L,hp,hregister);
  175. dec(i);
  176. end;
  177. p^.location.reference.base:=hregister;
  178. end;
  179. end
  180. else
  181. case symtabletype of
  182. unitsymtable,globalsymtable,
  183. staticsymtable :
  184. begin
  185. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  186. end;
  187. stt_exceptsymtable:
  188. begin
  189. p^.location.reference.base:=procinfo.framepointer;
  190. p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address;
  191. end;
  192. objectsymtable:
  193. begin
  194. if (sp_static in pvarsym(p^.symtableentry)^.symoptions) then
  195. begin
  196. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  197. end
  198. else
  199. begin
  200. p^.location.reference.base:=R_ESI;
  201. p^.location.reference.offset:=pvarsym(p^.symtableentry)^.address;
  202. end;
  203. end;
  204. withsymtable:
  205. begin
  206. { make a reference }
  207. { symtable datasize field
  208. contains the offset of the temp
  209. stored }
  210. { hp:=new_reference(procinfo.framepointer,
  211. p^.symtable^.datasize);
  212. emit_ref_reg(A_MOV,S_L,hp,hregister);}
  213. if ptree(pwithsymtable(p^.symtable)^.withnode)^.islocal then
  214. begin
  215. p^.location.reference:=ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^;
  216. end
  217. else
  218. begin
  219. hregister:=getregister32;
  220. p^.location.reference.base:=hregister;
  221. emit_ref_reg(A_MOV,S_L,
  222. newreference(ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^),
  223. hregister);
  224. end;
  225. inc(p^.location.reference.offset,pvarsym(p^.symtableentry)^.address);
  226. end;
  227. end;
  228. end;
  229. { in case call by reference, then calculate. Open array
  230. is always an reference! }
  231. if (pvarsym(p^.symtableentry)^.varspez=vs_var) or
  232. is_open_array(pvarsym(p^.symtableentry)^.definition) or
  233. is_array_of_const(pvarsym(p^.symtableentry)^.definition) or
  234. ((pvarsym(p^.symtableentry)^.varspez=vs_const) and
  235. push_addr_param(pvarsym(p^.symtableentry)^.definition)) then
  236. begin
  237. simple_loadn:=false;
  238. if hregister=R_NO then
  239. hregister:=getregister32;
  240. if p^.location.loc=LOC_CREGISTER then
  241. begin
  242. emit_reg_reg(A_MOV,S_L,
  243. p^.location.register,hregister);
  244. p^.location.loc:=LOC_REFERENCE;
  245. end
  246. else
  247. begin
  248. emit_ref_reg(A_MOV,S_L,
  249. newreference(p^.location.reference),
  250. hregister);
  251. end;
  252. reset_reference(p^.location.reference);
  253. p^.location.reference.base:=hregister;
  254. end;
  255. end;
  256. end;
  257. procsym:
  258. begin
  259. if assigned(p^.left) then
  260. begin
  261. secondpass(p^.left);
  262. p^.location.loc:=LOC_MEM;
  263. gettempofsizereference(8,p^.location.reference);
  264. { load class instance address }
  265. case p^.left^.location.loc of
  266. LOC_CREGISTER,
  267. LOC_REGISTER:
  268. begin
  269. hregister:=p^.left^.location.register;
  270. ungetregister32(p^.left^.location.register);
  271. { such code is allowed !
  272. CGMessage(cg_e_illegal_expression); }
  273. end;
  274. LOC_MEM,
  275. LOC_REFERENCE:
  276. begin
  277. hregister:=R_EDI;
  278. emit_ref_reg(A_MOV,S_L,
  279. newreference(p^.left^.location.reference),R_EDI);
  280. del_reference(p^.left^.location.reference);
  281. ungetiftemp(p^.left^.location.reference);
  282. end;
  283. else internalerror(26019);
  284. end;
  285. { store the class instance address }
  286. new(hp);
  287. hp^:=p^.location.reference;
  288. inc(hp^.offset,4);
  289. emit_reg_ref(A_MOV,S_L,
  290. hregister,hp);
  291. { virtual method ? }
  292. if (po_virtualmethod in pprocsym(p^.symtableentry)^.definition^.procoptions) then
  293. begin
  294. new(hp);
  295. reset_reference(hp^);
  296. hp^.base:=hregister;
  297. { load vmt pointer }
  298. emit_ref_reg(A_MOV,S_L,
  299. hp,R_EDI);
  300. {$IfDef regallocfix}
  301. del_reference(hp^);
  302. {$EndIf regallocfix}
  303. { load method address }
  304. new(hp);
  305. reset_reference(hp^);
  306. hp^.base:=R_EDI;
  307. hp^.offset:=pprocsym(p^.symtableentry)^.definition^._class^.vmtmethodoffset(
  308. pprocsym(p^.symtableentry)^.definition^.extnumber);
  309. emit_ref_reg(A_MOV,S_L,
  310. hp,R_EDI);
  311. { ... and store it }
  312. emit_reg_ref(A_MOV,S_L,
  313. R_EDI,newreference(p^.location.reference));
  314. end
  315. else
  316. begin
  317. s:=newasmsymbol(pprocsym(p^.symtableentry)^.definition^.mangledname);
  318. emit_sym_ofs_ref(A_MOV,S_L,s,0,
  319. newreference(p^.location.reference));
  320. end;
  321. end
  322. else
  323. begin
  324. {!!!!! Be aware, work on virtual methods too }
  325. p^.location.reference.symbol:=newasmsymbol(pprocsym(p^.symtableentry)^.definition^.mangledname);
  326. end;
  327. end;
  328. typedconstsym :
  329. begin
  330. p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
  331. end;
  332. else internalerror(4);
  333. end;
  334. end;
  335. {*****************************************************************************
  336. SecondAssignment
  337. *****************************************************************************}
  338. procedure secondassignment(var p : ptree);
  339. var
  340. opsize : topsize;
  341. otlabel,hlabel,oflabel : pasmlabel;
  342. fputyp : tfloattype;
  343. loc : tloc;
  344. r : preference;
  345. ai : paicpu;
  346. op : tasmop;
  347. pushed : boolean;
  348. begin
  349. otlabel:=truelabel;
  350. oflabel:=falselabel;
  351. getlabel(truelabel);
  352. getlabel(falselabel);
  353. { calculate left sides }
  354. if not(p^.concat_string) then
  355. secondpass(p^.left);
  356. if codegenerror then
  357. exit;
  358. {$ifdef dummy}
  359. { we use now the standard mechanism via maybe_push/restore
  360. to do that (FK)
  361. }
  362. case p^.left^.location.loc of
  363. LOC_REFERENCE : begin
  364. { in case left operator uses to register }
  365. { but to few are free then LEA }
  366. if (p^.left^.location.reference.base<>R_NO) and
  367. (p^.left^.location.reference.index<>R_NO) and
  368. (usablereg32<p^.right^.registers32) then
  369. begin
  370. del_reference(p^.left^.location.reference);
  371. hregister:=getregister32;
  372. emit_ref_reg(A_LEA,S_L,newreference(
  373. p^.left^.location.reference),
  374. hregister);
  375. reset_reference(p^.left^.location.reference);
  376. p^.left^.location.reference.base:=hregister;
  377. p^.left^.location.reference.index:=R_NO;
  378. end;
  379. loc:=LOC_REFERENCE;
  380. end;
  381. LOC_CFPUREGISTER:
  382. loc:=LOC_CFPUREGISTER;
  383. LOC_CREGISTER:
  384. loc:=LOC_CREGISTER;
  385. LOC_MMXREGISTER:
  386. loc:=LOC_MMXREGISTER;
  387. LOC_CMMXREGISTER:
  388. loc:=LOC_CMMXREGISTER;
  389. else
  390. begin
  391. CGMessage(cg_e_illegal_expression);
  392. exit;
  393. end;
  394. end;
  395. {$endif dummy}
  396. loc:=p^.left^.location.loc;
  397. { lets try to optimize this (PM) }
  398. { define a dest_loc that is the location }
  399. { and a ptree to verify that it is the right }
  400. { place to insert it }
  401. {$ifdef test_dest_loc}
  402. if (aktexprlevel<4) then
  403. begin
  404. dest_loc_known:=true;
  405. dest_loc:=p^.left^.location;
  406. dest_loc_tree:=p^.right;
  407. end;
  408. {$endif test_dest_loc}
  409. { left can't be never a 64 bit LOC_REGISTER, so the 3. arg }
  410. { can be false }
  411. pushed:=maybe_push(p^.right^.registers32,p^.left,false);
  412. secondpass(p^.right);
  413. if pushed then restore(p^.left,false);
  414. if codegenerror then
  415. exit;
  416. {$ifdef test_dest_loc}
  417. dest_loc_known:=false;
  418. if in_dest_loc then
  419. begin
  420. truelabel:=otlabel;
  421. falselabel:=oflabel;
  422. in_dest_loc:=false;
  423. exit;
  424. end;
  425. {$endif test_dest_loc}
  426. if p^.left^.resulttype^.deftype=stringdef then
  427. begin
  428. if is_ansistring(p^.left^.resulttype) then
  429. begin
  430. { the source and destinations are released
  431. in loadansistring, because an ansi string can
  432. also be in a register
  433. }
  434. loadansistring(p);
  435. end
  436. else
  437. if is_shortstring(p^.left^.resulttype) and
  438. not (p^.concat_string) then
  439. begin
  440. if is_ansistring(p^.right^.resulttype) then
  441. begin
  442. if (p^.right^.treetype=stringconstn) and
  443. (p^.right^.length=0) then
  444. begin
  445. emit_const_ref(A_MOV,S_B,
  446. 0,newreference(p^.left^.location.reference));
  447. {$IfDef regallocfix}
  448. del_reference(p^.left^.location.reference);
  449. {$EndIf regallocfix}
  450. end
  451. else
  452. loadansi2short(p^.right,p^.left);
  453. end
  454. else
  455. begin
  456. { we do not need destination anymore }
  457. del_reference(p^.left^.location.reference);
  458. del_reference(p^.right^.location.reference);
  459. loadshortstring(p);
  460. ungetiftemp(p^.right^.location.reference);
  461. end;
  462. end
  463. else if is_longstring(p^.left^.resulttype) then
  464. begin
  465. end
  466. else
  467. begin
  468. { its the only thing we have to do }
  469. del_reference(p^.right^.location.reference);
  470. end
  471. end
  472. else case p^.right^.location.loc of
  473. LOC_REFERENCE,
  474. LOC_MEM : begin
  475. { extra handling for ordinal constants }
  476. if (p^.right^.treetype in [ordconstn,fixconstn]) or
  477. (loc=LOC_CREGISTER) then
  478. begin
  479. case p^.left^.resulttype^.size of
  480. 1 : opsize:=S_B;
  481. 2 : opsize:=S_W;
  482. 4 : opsize:=S_L;
  483. { S_L is correct, the copy is done }
  484. { with two moves }
  485. 8 : opsize:=S_L;
  486. end;
  487. if loc=LOC_CREGISTER then
  488. begin
  489. emit_ref_reg(A_MOV,opsize,
  490. newreference(p^.right^.location.reference),
  491. p^.left^.location.register);
  492. if is_64bitint(p^.right^.resulttype) then
  493. begin
  494. r:=newreference(p^.right^.location.reference);
  495. inc(r^.offset,4);
  496. emit_ref_reg(A_MOV,opsize,r,
  497. p^.left^.location.registerhigh);
  498. end;
  499. {$IfDef regallocfix}
  500. del_reference(p^.right^.location.reference);
  501. {$EndIf regallocfix}
  502. end
  503. else
  504. begin
  505. emit_const_ref(A_MOV,opsize,
  506. p^.right^.location.reference.offset,
  507. newreference(p^.left^.location.reference));
  508. if is_64bitint(p^.right^.resulttype) then
  509. begin
  510. r:=newreference(p^.left^.location.reference);
  511. inc(r^.offset,4);
  512. emit_const_ref(A_MOV,opsize,
  513. 0,r);
  514. end;
  515. {$IfDef regallocfix}
  516. del_reference(p^.left^.location.reference);
  517. {$EndIf regallocfix}
  518. {emit_const_loc(A_MOV,opsize,
  519. p^.right^.location.reference.offset,
  520. p^.left^.location);}
  521. end;
  522. end
  523. else if loc=LOC_CFPUREGISTER then
  524. begin
  525. floatloadops(pfloatdef(p^.right^.resulttype)^.typ,op,opsize);
  526. emit_ref(op,opsize,
  527. newreference(p^.right^.location.reference));
  528. emit_reg(A_FSTP,S_NO,
  529. correct_fpuregister(p^.left^.location.register,fpuvaroffset+1));
  530. end
  531. else
  532. begin
  533. if (p^.right^.resulttype^.needs_inittable) and
  534. ( (p^.right^.resulttype^.deftype<>objectdef) or
  535. not(pobjectdef(p^.right^.resulttype)^.is_class)) then
  536. begin
  537. { this would be a problem }
  538. if not(p^.left^.resulttype^.needs_inittable) then
  539. internalerror(3457);
  540. { increment source reference counter }
  541. new(r);
  542. reset_reference(r^);
  543. r^.symbol:=p^.right^.resulttype^.get_inittable_label;
  544. emitpushreferenceaddr(r^);
  545. emitpushreferenceaddr(p^.right^.location.reference);
  546. emitcall('FPC_ADDREF');
  547. { decrement destination reference counter }
  548. new(r);
  549. reset_reference(r^);
  550. r^.symbol:=p^.left^.resulttype^.get_inittable_label;
  551. emitpushreferenceaddr(r^);
  552. emitpushreferenceaddr(p^.left^.location.reference);
  553. emitcall('FPC_DECREF');
  554. end;
  555. {$ifdef regallocfix}
  556. concatcopy(p^.right^.location.reference,
  557. p^.left^.location.reference,p^.left^.resulttype^.size,true,false);
  558. ungetiftemp(p^.right^.location.reference);
  559. {$Else regallocfix}
  560. concatcopy(p^.right^.location.reference,
  561. p^.left^.location.reference,p^.left^.resulttype^.size,false,false);
  562. ungetiftemp(p^.right^.location.reference);
  563. {$endif regallocfix}
  564. end;
  565. end;
  566. {$ifdef SUPPORT_MMX}
  567. LOC_CMMXREGISTER,
  568. LOC_MMXREGISTER:
  569. begin
  570. if loc=LOC_CMMXREGISTER then
  571. emit_reg_reg(A_MOVQ,S_NO,
  572. p^.right^.location.register,p^.left^.location.register)
  573. else
  574. emit_reg_ref(A_MOVQ,S_NO,
  575. p^.right^.location.register,newreference(p^.left^.location.reference));
  576. end;
  577. {$endif SUPPORT_MMX}
  578. LOC_REGISTER,
  579. LOC_CREGISTER : begin
  580. case p^.right^.resulttype^.size of
  581. 1 : opsize:=S_B;
  582. 2 : opsize:=S_W;
  583. 4 : opsize:=S_L;
  584. 8 : opsize:=S_L;
  585. end;
  586. { simplified with op_reg_loc }
  587. if loc=LOC_CREGISTER then
  588. begin
  589. emit_reg_reg(A_MOV,opsize,
  590. p^.right^.location.register,
  591. p^.left^.location.register);
  592. {$IfDef regallocfix}
  593. ungetregister(p^.right^.location.register);
  594. {$EndIf regallocfix}
  595. end
  596. else
  597. Begin
  598. emit_reg_ref(A_MOV,opsize,
  599. p^.right^.location.register,
  600. newreference(p^.left^.location.reference));
  601. {$IfDef regallocfix}
  602. ungetregister(p^.right^.location.register);
  603. del_reference(p^.left^.location.reference);
  604. {$EndIf regallocfix}
  605. end;
  606. if is_64bitint(p^.right^.resulttype) then
  607. begin
  608. { simplified with op_reg_loc }
  609. if loc=LOC_CREGISTER then
  610. emit_reg_reg(A_MOV,opsize,
  611. p^.right^.location.registerhigh,
  612. p^.left^.location.registerhigh)
  613. else
  614. begin
  615. r:=newreference(p^.left^.location.reference);
  616. inc(r^.offset,4);
  617. emit_reg_ref(A_MOV,opsize,
  618. p^.right^.location.registerhigh,r);
  619. end;
  620. end;
  621. {emit_reg_loc(A_MOV,opsize,
  622. p^.right^.location.register,
  623. p^.left^.location); }
  624. end;
  625. LOC_FPU : begin
  626. if (p^.left^.resulttype^.deftype=floatdef) then
  627. fputyp:=pfloatdef(p^.left^.resulttype)^.typ
  628. else
  629. if (p^.right^.resulttype^.deftype=floatdef) then
  630. fputyp:=pfloatdef(p^.right^.resulttype)^.typ
  631. else
  632. if (p^.right^.treetype=typeconvn) and
  633. (p^.right^.left^.resulttype^.deftype=floatdef) then
  634. fputyp:=pfloatdef(p^.right^.left^.resulttype)^.typ
  635. else
  636. fputyp:=s32real;
  637. case loc of
  638. LOC_CFPUREGISTER:
  639. begin
  640. emit_reg(A_FSTP,S_NO,
  641. correct_fpuregister(p^.left^.location.register,fpuvaroffset));
  642. dec(fpuvaroffset);
  643. end;
  644. LOC_REFERENCE:
  645. floatstore(fputyp,p^.left^.location.reference);
  646. else
  647. internalerror(48991);
  648. end;
  649. end;
  650. LOC_CFPUREGISTER: begin
  651. if (p^.left^.resulttype^.deftype=floatdef) then
  652. fputyp:=pfloatdef(p^.left^.resulttype)^.typ
  653. else
  654. if (p^.right^.resulttype^.deftype=floatdef) then
  655. fputyp:=pfloatdef(p^.right^.resulttype)^.typ
  656. else
  657. if (p^.right^.treetype=typeconvn) and
  658. (p^.right^.left^.resulttype^.deftype=floatdef) then
  659. fputyp:=pfloatdef(p^.right^.left^.resulttype)^.typ
  660. else
  661. fputyp:=s32real;
  662. emit_reg(A_FLD,S_NO,
  663. correct_fpuregister(p^.right^.location.register,fpuvaroffset));
  664. inc(fpuvaroffset);
  665. case loc of
  666. LOC_CFPUREGISTER:
  667. begin
  668. emit_reg(A_FSTP,S_NO,
  669. correct_fpuregister(p^.right^.location.register,fpuvaroffset));
  670. dec(fpuvaroffset);
  671. end;
  672. LOC_REFERENCE:
  673. floatstore(fputyp,p^.left^.location.reference);
  674. else
  675. internalerror(48992);
  676. end;
  677. end;
  678. LOC_JUMP : begin
  679. getlabel(hlabel);
  680. emitlab(truelabel);
  681. if loc=LOC_CREGISTER then
  682. emit_const_reg(A_MOV,S_B,
  683. 1,p^.left^.location.register)
  684. else
  685. emit_const_ref(A_MOV,S_B,
  686. 1,newreference(p^.left^.location.reference));
  687. {emit_const_loc(A_MOV,S_B,
  688. 1,p^.left^.location);}
  689. emitjmp(C_None,hlabel);
  690. emitlab(falselabel);
  691. if loc=LOC_CREGISTER then
  692. emit_reg_reg(A_XOR,S_B,
  693. p^.left^.location.register,
  694. p^.left^.location.register)
  695. else
  696. begin
  697. emit_const_ref(A_MOV,S_B,
  698. 0,newreference(p^.left^.location.reference));
  699. {$IfDef regallocfix}
  700. del_reference(p^.left^.location.reference);
  701. {$EndIf regallocfix}
  702. end;
  703. emitlab(hlabel);
  704. end;
  705. LOC_FLAGS : begin
  706. if loc=LOC_CREGISTER then
  707. emit_flag2reg(p^.right^.location.resflags,p^.left^.location.register)
  708. else
  709. begin
  710. ai:=new(paicpu,op_ref(A_Setcc,S_B,newreference(p^.left^.location.reference)));
  711. ai^.SetCondition(flag_2_cond[p^.right^.location.resflags]);
  712. exprasmlist^.concat(ai);
  713. end;
  714. {$IfDef regallocfix}
  715. del_reference(p^.left^.location.reference);
  716. {$EndIf regallocfix}
  717. end;
  718. end;
  719. freelabel(truelabel);
  720. freelabel(falselabel);
  721. truelabel:=otlabel;
  722. falselabel:=oflabel;
  723. end;
  724. {*****************************************************************************
  725. SecondFuncRet
  726. *****************************************************************************}
  727. procedure secondfuncret(var p : ptree);
  728. var
  729. hr : tregister;
  730. hp : preference;
  731. pp : pprocinfo;
  732. hr_valid : boolean;
  733. begin
  734. reset_reference(p^.location.reference);
  735. hr_valid:=false;
  736. if @procinfo<>pprocinfo(p^.funcretprocinfo) then
  737. begin
  738. hr:=getregister32;
  739. hr_valid:=true;
  740. hp:=new_reference(procinfo.framepointer,
  741. procinfo.framepointer_offset);
  742. emit_ref_reg(A_MOV,S_L,hp,hr);
  743. pp:=procinfo.parent;
  744. { walk up the stack frame }
  745. while pp<>pprocinfo(p^.funcretprocinfo) do
  746. begin
  747. hp:=new_reference(hr,
  748. pp^.framepointer_offset);
  749. emit_ref_reg(A_MOV,S_L,hp,hr);
  750. pp:=pp^.parent;
  751. end;
  752. p^.location.reference.base:=hr;
  753. end
  754. else
  755. p^.location.reference.base:=procinfo.framepointer;
  756. p^.location.reference.offset:=procinfo.retoffset;
  757. if ret_in_param(p^.retdef) then
  758. begin
  759. if not hr_valid then
  760. hr:=getregister32;
  761. emit_ref_reg(A_MOV,S_L,newreference(p^.location.reference),hr);
  762. p^.location.reference.base:=hr;
  763. p^.location.reference.offset:=0;
  764. end;
  765. end;
  766. {*****************************************************************************
  767. SecondArrayConstruct
  768. *****************************************************************************}
  769. const
  770. vtInteger = 0;
  771. vtBoolean = 1;
  772. vtChar = 2;
  773. vtExtended = 3;
  774. vtString = 4;
  775. vtPointer = 5;
  776. vtPChar = 6;
  777. vtObject = 7;
  778. vtClass = 8;
  779. vtWideChar = 9;
  780. vtPWideChar = 10;
  781. vtAnsiString = 11;
  782. vtCurrency = 12;
  783. vtVariant = 13;
  784. vtInterface = 14;
  785. vtWideString = 15;
  786. vtInt64 = 16;
  787. procedure secondarrayconstruct(var p : ptree);
  788. var
  789. hp : ptree;
  790. href : treference;
  791. lt : pdef;
  792. vaddr : boolean;
  793. vtype : longint;
  794. freetemp,
  795. dovariant : boolean;
  796. elesize : longint;
  797. begin
  798. dovariant:=p^.forcevaria or parraydef(p^.resulttype)^.isvariant;
  799. if dovariant then
  800. elesize:=8
  801. else
  802. begin
  803. elesize:=parraydef(p^.resulttype)^.elesize;
  804. if elesize>4 then
  805. internalerror(8765678);
  806. end;
  807. if not p^.cargs then
  808. begin
  809. reset_reference(p^.location.reference);
  810. { Allocate always a temp, also if no elements are required, to
  811. be sure that location is valid (PFV) }
  812. if parraydef(p^.resulttype)^.highrange=-1 then
  813. gettempofsizereference(elesize,p^.location.reference)
  814. else
  815. gettempofsizereference((parraydef(p^.resulttype)^.highrange+1)*elesize,p^.location.reference);
  816. href:=p^.location.reference;
  817. end;
  818. hp:=p;
  819. while assigned(hp) do
  820. begin
  821. if assigned(hp^.left) then
  822. begin
  823. freetemp:=true;
  824. secondpass(hp^.left);
  825. if codegenerror then
  826. exit;
  827. if dovariant then
  828. begin
  829. { find the correct vtype value }
  830. vtype:=$ff;
  831. vaddr:=false;
  832. lt:=hp^.left^.resulttype;
  833. case lt^.deftype of
  834. enumdef,
  835. orddef :
  836. begin
  837. if (lt^.deftype=enumdef) or
  838. is_integer(lt) then
  839. vtype:=vtInteger
  840. else
  841. if is_boolean(lt) then
  842. vtype:=vtBoolean
  843. else
  844. if (lt^.deftype=orddef) and (porddef(lt)^.typ=uchar) then
  845. vtype:=vtChar;
  846. end;
  847. floatdef :
  848. begin
  849. vtype:=vtExtended;
  850. vaddr:=true;
  851. end;
  852. procvardef,
  853. pointerdef :
  854. begin
  855. if is_pchar(lt) then
  856. vtype:=vtPChar
  857. else
  858. vtype:=vtPointer;
  859. end;
  860. classrefdef :
  861. vtype:=vtClass;
  862. objectdef :
  863. begin
  864. vtype:=vtObject;
  865. end;
  866. stringdef :
  867. begin
  868. if is_shortstring(lt) then
  869. begin
  870. vtype:=vtString;
  871. vaddr:=true;
  872. freetemp:=false;
  873. end
  874. else
  875. if is_ansistring(lt) then
  876. vtype:=vtAnsiString;
  877. end;
  878. end;
  879. if vtype=$ff then
  880. internalerror(14357);
  881. { write C style pushes or an pascal array }
  882. if p^.cargs then
  883. begin
  884. if vaddr then
  885. begin
  886. emit_to_reference(hp^.left);
  887. emit_push_lea_loc(hp^.left^.location,freetemp);
  888. end
  889. else
  890. emit_push_loc(hp^.left^.location);
  891. end
  892. else
  893. begin
  894. { update href to the vtype field and write it }
  895. emit_const_ref(A_MOV,S_L,
  896. vtype,newreference(href));
  897. inc(href.offset,4);
  898. { write changing field update href to the next element }
  899. if vaddr then
  900. begin
  901. emit_to_reference(hp^.left);
  902. emit_lea_loc_ref(hp^.left^.location,href,freetemp);
  903. end
  904. else
  905. emit_mov_loc_ref(hp^.left^.location,href,S_L);
  906. inc(href.offset,4);
  907. end;
  908. end
  909. else
  910. { normal array constructor of the same type }
  911. begin
  912. case elesize of
  913. 1 :
  914. emit_mov_loc_ref(hp^.left^.location,href,S_B);
  915. 2 :
  916. emit_mov_loc_ref(hp^.left^.location,href,S_W);
  917. 4 :
  918. emit_mov_loc_ref(hp^.left^.location,href,S_L);
  919. else
  920. internalerror(87656781);
  921. end;
  922. inc(href.offset,elesize);
  923. end;
  924. end;
  925. { load next entry }
  926. hp:=hp^.right;
  927. end;
  928. end;
  929. end.
  930. {
  931. $Log$
  932. Revision 1.83 1999-09-01 09:37:14 peter
  933. * removed warning
  934. Revision 1.82 1999/09/01 09:26:21 peter
  935. * fixed temp allocation for arrayconstructor
  936. Revision 1.81 1999/08/28 15:34:17 florian
  937. * bug 519 fixed
  938. Revision 1.80 1999/08/26 20:24:37 michael
  939. + Hopefuly last fixes for resourcestrings
  940. Revision 1.79 1999/08/25 16:41:05 peter
  941. * resources are working again
  942. Revision 1.78 1999/08/25 11:59:43 jonas
  943. * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
  944. Revision 1.77 1999/08/24 22:38:51 michael
  945. * more resourcestring changes
  946. Revision 1.76 1999/08/23 11:45:39 michael
  947. * Hopefully final attempt at resourcestrings
  948. Revision 1.75 1999/08/19 13:08:49 pierre
  949. * emit_??? used
  950. Revision 1.74 1999/08/17 13:26:06 peter
  951. * arrayconstructor -> arrayofconst fixed when arraycosntructor was not
  952. variant.
  953. Revision 1.73 1999/08/13 21:33:09 peter
  954. * support for array constructors extended and more error checking
  955. Revision 1.72 1999/08/09 22:19:50 peter
  956. * classes vmt changed to only positive addresses
  957. * sharedlib creation is working
  958. Revision 1.71 1999/08/07 14:20:55 florian
  959. * some small problems fixed
  960. Revision 1.70 1999/08/04 13:45:22 florian
  961. + floating point register variables !!
  962. * pairegalloc is now generated for register variables
  963. Revision 1.69 1999/08/04 00:22:50 florian
  964. * renamed i386asm and i386base to cpuasm and cpubase
  965. Revision 1.68 1999/08/03 22:02:43 peter
  966. * moved bitmask constants to sets
  967. * some other type/const renamings
  968. Revision 1.67 1999/07/27 23:36:36 peter
  969. * try to determine the fpu type needed in assignment
  970. Revision 1.66 1999/07/24 15:12:56 michael
  971. changes for resourcestrings
  972. Revision 1.65 1999/07/23 23:09:06 peter
  973. * resourcestring fix
  974. Revision 1.64 1999/07/22 09:37:37 florian
  975. + resourcestring implemented
  976. + start of longstring support
  977. Revision 1.63 1999/07/05 20:13:12 peter
  978. * removed temp defines
  979. Revision 1.62 1999/06/30 15:43:18 florian
  980. * two bugs regarding method variables fixed
  981. - if you take in a method the address of another method
  982. don't need self anymore
  983. - if the class pointer was in a register, wrong code for a method
  984. variable load was generated
  985. Revision 1.61 1999/06/28 22:29:11 florian
  986. * qword division fixed
  987. + code for qword/int64 type casting added:
  988. range checking isn't implemented yet
  989. Revision 1.60 1999/05/31 12:42:43 peter
  990. * fixed crash with empty array constructor
  991. Revision 1.59 1999/05/27 19:44:14 peter
  992. * removed oldasm
  993. * plabel -> pasmlabel
  994. * -a switches to source writing automaticly
  995. * assembler readers OOPed
  996. * asmsymbol automaticly external
  997. * jumptables and other label fixes for asm readers
  998. Revision 1.58 1999/05/23 18:42:02 florian
  999. * better error recovering in typed constants
  1000. * some problems with arrays of const fixed, some problems
  1001. due my previous
  1002. - the location type of array constructor is now LOC_MEM
  1003. - the pushing of high fixed
  1004. - parameter copying fixed
  1005. - zero temp. allocation removed
  1006. * small problem in the assembler writers fixed:
  1007. ref to nil wasn't written correctly
  1008. Revision 1.57 1999/05/21 13:54:51 peter
  1009. * NEWLAB for label as symbol
  1010. Revision 1.56 1999/05/17 23:51:38 peter
  1011. * with temp vars now use a reference with a persistant temp instead
  1012. of setting datasize
  1013. Revision 1.55 1999/05/17 21:57:04 florian
  1014. * new temporary ansistring handling
  1015. Revision 1.54 1999/05/12 00:19:43 peter
  1016. * removed R_DEFAULT_SEG
  1017. * uniform float names
  1018. Revision 1.53 1999/05/06 09:05:16 peter
  1019. * generic write_float and str_float
  1020. * fixed constant float conversions
  1021. Revision 1.52 1999/05/01 13:24:10 peter
  1022. * merged nasm compiler
  1023. * old asm moved to oldasm/
  1024. Revision 1.51 1999/04/28 06:01:55 florian
  1025. * changes of Bruessel:
  1026. + message handler can now take an explicit self
  1027. * typinfo fixed: sometimes the type names weren't written
  1028. * the type checking for pointer comparisations and subtraction
  1029. and are now more strict (was also buggy)
  1030. * small bug fix to link.pas to support compiling on another
  1031. drive
  1032. * probable bug in popt386 fixed: call/jmp => push/jmp
  1033. transformation didn't count correctly the jmp references
  1034. + threadvar support
  1035. * warning if ln/sqrt gets an invalid constant argument
  1036. Revision 1.50 1999/04/16 13:42:26 jonas
  1037. * more regalloc fixes (still not complete)
  1038. Revision 1.49 1999/04/13 18:57:48 florian
  1039. * classes which contain ansistring get unnecessary calls
  1040. to addref/decref when they are assigned, fixed
  1041. Revision 1.48 1999/04/09 15:48:47 jonas
  1042. * added fix for missing register deallocation (-dregallocfix)
  1043. Revision 1.47 1999/03/31 13:55:07 peter
  1044. * assembler inlining working for ag386bin
  1045. Revision 1.46 1999/03/24 23:16:52 peter
  1046. * fixed bugs 212,222,225,227,229,231,233
  1047. Revision 1.45 1999/02/25 21:02:28 peter
  1048. * ag386bin updates
  1049. + coff writer
  1050. Revision 1.44 1999/02/22 02:15:12 peter
  1051. * updates for ag386bin
  1052. Revision 1.43 1999/01/27 00:13:54 florian
  1053. * "procedure of object"-stuff fixed
  1054. Revision 1.42 1999/01/21 22:10:40 peter
  1055. * fixed array of const
  1056. * generic platform independent high() support
  1057. Revision 1.41 1999/01/20 10:20:18 peter
  1058. * don't make localvar copies for assembler procedures
  1059. Revision 1.40 1998/12/30 13:41:07 peter
  1060. * released valuepara
  1061. Revision 1.39 1998/12/19 00:23:45 florian
  1062. * ansistring memory leaks fixed
  1063. Revision 1.38 1998/12/11 00:02:51 peter
  1064. + globtype,tokens,version unit splitted from globals
  1065. Revision 1.37 1998/12/10 09:47:17 florian
  1066. + basic operations with int64/qord (compiler with -dint64)
  1067. + rtti of enumerations extended: names are now written
  1068. Revision 1.36 1998/12/04 10:18:06 florian
  1069. * some stuff for procedures of object added
  1070. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1071. Revision 1.35 1998/11/30 09:43:04 pierre
  1072. * some range check bugs fixed (still not working !)
  1073. + added DLL writing support for win32 (also accepts variables)
  1074. + TempAnsi for code that could be used for Temporary ansi strings
  1075. handling
  1076. Revision 1.34 1998/11/28 16:20:48 peter
  1077. + support for dll variables
  1078. Revision 1.33 1998/11/27 14:50:33 peter
  1079. + open strings, $P switch support
  1080. Revision 1.32 1998/11/26 09:53:36 florian
  1081. * for classes no init/final. code is necessary, fixed
  1082. Revision 1.31 1998/11/20 15:35:54 florian
  1083. * problems with rtti fixed, hope it works
  1084. Revision 1.30 1998/11/18 17:45:24 peter
  1085. * fixes for VALUEPARA
  1086. Revision 1.29 1998/11/18 15:44:11 peter
  1087. * VALUEPARA for tp7 compatible value parameters
  1088. Revision 1.28 1998/11/17 11:32:44 peter
  1089. * optimize str:='' in H+ mode
  1090. + -! to test ansistrings
  1091. Revision 1.27 1998/11/16 15:35:39 peter
  1092. * rename laod/copystring -> load/copyshortstring
  1093. * fixed int-bool cnv bug
  1094. + char-ansistring conversion
  1095. Revision 1.26 1998/11/10 10:09:10 peter
  1096. * va_list -> array of const
  1097. Revision 1.25 1998/11/05 12:02:35 peter
  1098. * released useansistring
  1099. * removed -Sv, its now available in fpc modes
  1100. Revision 1.24 1998/10/14 08:47:14 pierre
  1101. * bugs in secondfuncret for result in subprocedures removed
  1102. Revision 1.23 1998/10/06 17:16:44 pierre
  1103. * some memory leaks fixed (thanks to Peter for heaptrc !)
  1104. Revision 1.22 1998/10/01 09:22:53 peter
  1105. * fixed value openarray
  1106. * ungettemp of arrayconstruct
  1107. Revision 1.21 1998/09/28 11:07:39 peter
  1108. + floatdef support for array of const
  1109. Revision 1.20 1998/09/24 14:26:03 peter
  1110. * updated for new tvarrec
  1111. Revision 1.19 1998/09/23 17:49:59 peter
  1112. * high(arrayconstructor) is now correct
  1113. * procvardef support for variant record
  1114. Revision 1.18 1998/09/23 09:58:48 peter
  1115. * first working array of const things
  1116. Revision 1.17 1998/09/20 18:00:19 florian
  1117. * small compiling problems fixed
  1118. Revision 1.16 1998/09/20 17:46:48 florian
  1119. * some things regarding ansistrings fixed
  1120. Revision 1.15 1998/09/17 09:42:16 peter
  1121. + pass_2 for cg386
  1122. * Message() -> CGMessage() for pass_1/pass_2
  1123. Revision 1.14 1998/09/14 10:43:50 peter
  1124. * all internal RTL functions start with FPC_
  1125. Revision 1.13 1998/09/04 12:24:24 florian
  1126. * bug0159 fixed
  1127. Revision 1.12 1998/09/04 11:55:17 florian
  1128. * problem with -Or fixed
  1129. Revision 1.11 1998/09/03 16:03:14 florian
  1130. + rtti generation
  1131. * init table generation changed
  1132. Revision 1.10 1998/08/21 14:08:40 pierre
  1133. + TEST_FUNCRET now default (old code removed)
  1134. works also for m68k (at least compiles)
  1135. Revision 1.9 1998/08/20 09:26:37 pierre
  1136. + funcret setting in underproc testing
  1137. compile with _dTEST_FUNCRET
  1138. Revision 1.8 1998/08/10 14:49:48 peter
  1139. + localswitches, moduleswitches, globalswitches splitting
  1140. Revision 1.7 1998/07/30 13:30:33 florian
  1141. * final implemenation of exception support, maybe it needs
  1142. some fixes :)
  1143. Revision 1.6 1998/07/26 21:58:57 florian
  1144. + better support for switch $H
  1145. + index access to ansi strings added
  1146. + assigment of data (records/arrays) containing ansi strings
  1147. Revision 1.5 1998/07/24 22:16:54 florian
  1148. * internal error 10 together with array access fixed. I hope
  1149. that's the final fix.
  1150. Revision 1.4 1998/06/11 13:58:45 peter
  1151. * fixed too long line
  1152. Revision 1.3 1998/06/09 16:01:35 pierre
  1153. + added procedure directive parsing for procvars
  1154. (accepted are popstack cdecl and pascal)
  1155. + added C vars with the following syntax
  1156. var C calias 'true_c_name';(can be followed by external)
  1157. reason is that you must add the Cprefix
  1158. which is target dependent
  1159. Revision 1.2 1998/06/08 13:13:34 pierre
  1160. + temporary variables now in temp_gen.pas unit
  1161. because it is processor independent
  1162. * mppc68k.bat modified to undefine i386 and support_mmx
  1163. (which are defaults for i386)
  1164. Revision 1.1 1998/06/05 17:44:12 peter
  1165. * splitted cgi386
  1166. }