cg386ld.pas 53 KB

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