tcinl.pas 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Type checking and register allocation for inline 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 tcinl;
  19. interface
  20. uses
  21. tree;
  22. procedure firstinline(var p : ptree);
  23. implementation
  24. uses
  25. cobjects,verbose,globals,systems,
  26. globtype,
  27. symconst,symtable,aasm,types,
  28. hcodegen,htypechk,pass_1,
  29. tccal,cpubase
  30. {$ifdef i386}
  31. ,tgeni386
  32. {$endif}
  33. ;
  34. {*****************************************************************************
  35. FirstInLine
  36. *****************************************************************************}
  37. procedure firstinline(var p : ptree);
  38. var
  39. vl,vl2 : longint;
  40. vr : bestreal;
  41. p1,hp,hpp : ptree;
  42. {$ifndef NOCOLONCHECK}
  43. frac_para,length_para : ptree;
  44. {$endif ndef NOCOLONCHECK}
  45. extra_register,
  46. isreal,
  47. dowrite,
  48. file_is_typed : boolean;
  49. procedure do_lowhigh(adef : pdef);
  50. var
  51. v : longint;
  52. enum : penumsym;
  53. begin
  54. case Adef^.deftype of
  55. orddef:
  56. begin
  57. if p^.inlinenumber=in_low_x then
  58. v:=porddef(Adef)^.low
  59. else
  60. v:=porddef(Adef)^.high;
  61. hp:=genordinalconstnode(v,adef);
  62. firstpass(hp);
  63. disposetree(p);
  64. p:=hp;
  65. end;
  66. enumdef:
  67. begin
  68. enum:=Penumdef(Adef)^.firstenum;
  69. if p^.inlinenumber=in_high_x then
  70. while enum^.nextenum<>nil do
  71. enum:=enum^.nextenum;
  72. hp:=genenumnode(enum);
  73. disposetree(p);
  74. p:=hp;
  75. end;
  76. else
  77. internalerror(87);
  78. end;
  79. end;
  80. function getconstrealvalue : bestreal;
  81. begin
  82. case p^.left^.treetype of
  83. ordconstn:
  84. getconstrealvalue:=p^.left^.value;
  85. realconstn:
  86. getconstrealvalue:=p^.left^.value_real;
  87. else
  88. internalerror(309992);
  89. end;
  90. end;
  91. procedure setconstrealvalue(r : bestreal);
  92. var
  93. hp : ptree;
  94. begin
  95. hp:=genrealconstnode(r,bestrealdef^);
  96. disposetree(p);
  97. p:=hp;
  98. firstpass(p);
  99. end;
  100. procedure handleextendedfunction;
  101. begin
  102. p^.location.loc:=LOC_FPU;
  103. p^.resulttype:=s80floatdef;
  104. { redo firstpass for varstate status PM }
  105. set_varstate(p^.left,true);
  106. if (p^.left^.resulttype^.deftype<>floatdef) or
  107. (pfloatdef(p^.left^.resulttype)^.typ<>s80real) then
  108. begin
  109. p^.left:=gentypeconvnode(p^.left,s80floatdef);
  110. firstpass(p^.left);
  111. end;
  112. p^.registers32:=p^.left^.registers32;
  113. p^.registersfpu:=p^.left^.registersfpu;
  114. {$ifdef SUPPORT_MMX}
  115. p^.registersmmx:=p^.left^.registersmmx;
  116. {$endif SUPPORT_MMX}
  117. end;
  118. begin
  119. { if we handle writeln; p^.left contains no valid address }
  120. if assigned(p^.left) then
  121. begin
  122. if p^.left^.treetype=callparan then
  123. firstcallparan(p^.left,nil,false)
  124. else
  125. firstpass(p^.left);
  126. left_right_max(p);
  127. set_location(p^.location,p^.left^.location);
  128. end;
  129. inc(parsing_para_level);
  130. { handle intern constant functions in separate case }
  131. if p^.inlineconst then
  132. begin
  133. hp:=nil;
  134. { no parameters? }
  135. if not assigned(p^.left) then
  136. begin
  137. case p^.inlinenumber of
  138. in_const_pi :
  139. hp:=genrealconstnode(pi,bestrealdef^);
  140. else
  141. internalerror(89);
  142. end;
  143. end
  144. else
  145. { process constant expression with parameter }
  146. begin
  147. vl:=0;
  148. vl2:=0; { second parameter Ex: ptr(vl,vl2) }
  149. vr:=0;
  150. isreal:=false;
  151. case p^.left^.treetype of
  152. realconstn :
  153. begin
  154. isreal:=true;
  155. vr:=p^.left^.value_real;
  156. end;
  157. ordconstn :
  158. vl:=p^.left^.value;
  159. callparan :
  160. begin
  161. { both exists, else it was not generated }
  162. vl:=p^.left^.left^.value;
  163. vl2:=p^.left^.right^.left^.value;
  164. end;
  165. else
  166. CGMessage(cg_e_illegal_expression);
  167. end;
  168. case p^.inlinenumber of
  169. in_const_trunc :
  170. begin
  171. if isreal then
  172. begin
  173. if (vr>=2147483648.0) or (vr<=-2147483649.0) then
  174. begin
  175. CGMessage(parser_e_range_check_error);
  176. hp:=genordinalconstnode(1,s32bitdef)
  177. end
  178. else
  179. hp:=genordinalconstnode(trunc(vr),s32bitdef)
  180. end
  181. else
  182. hp:=genordinalconstnode(trunc(vl),s32bitdef);
  183. end;
  184. in_const_round :
  185. begin
  186. if isreal then
  187. begin
  188. if (vr>=2147483647.5) or (vr<=-2147483648.5) then
  189. begin
  190. CGMessage(parser_e_range_check_error);
  191. hp:=genordinalconstnode(1,s32bitdef)
  192. end
  193. else
  194. hp:=genordinalconstnode(round(vr),s32bitdef)
  195. end
  196. else
  197. hp:=genordinalconstnode(round(vl),s32bitdef);
  198. end;
  199. in_const_frac :
  200. begin
  201. if isreal then
  202. hp:=genrealconstnode(frac(vr),bestrealdef^)
  203. else
  204. hp:=genrealconstnode(frac(vl),bestrealdef^);
  205. end;
  206. in_const_int :
  207. begin
  208. if isreal then
  209. hp:=genrealconstnode(int(vr),bestrealdef^)
  210. else
  211. hp:=genrealconstnode(int(vl),bestrealdef^);
  212. end;
  213. in_const_abs :
  214. begin
  215. if isreal then
  216. hp:=genrealconstnode(abs(vr),bestrealdef^)
  217. else
  218. hp:=genordinalconstnode(abs(vl),p^.left^.resulttype);
  219. end;
  220. in_const_sqr :
  221. begin
  222. if isreal then
  223. hp:=genrealconstnode(sqr(vr),bestrealdef^)
  224. else
  225. hp:=genordinalconstnode(sqr(vl),p^.left^.resulttype);
  226. end;
  227. in_const_odd :
  228. begin
  229. if isreal then
  230. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  231. else
  232. hp:=genordinalconstnode(byte(odd(vl)),booldef);
  233. end;
  234. in_const_swap_word :
  235. begin
  236. if isreal then
  237. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  238. else
  239. hp:=genordinalconstnode((vl and $ff) shl 8+(vl shr 8),p^.left^.resulttype);
  240. end;
  241. in_const_swap_long :
  242. begin
  243. if isreal then
  244. CGMessage(type_e_mismatch)
  245. else
  246. hp:=genordinalconstnode((vl and $ffff) shl 16+(vl shr 16),p^.left^.resulttype);
  247. end;
  248. in_const_ptr :
  249. begin
  250. if isreal then
  251. CGMessage(type_e_mismatch)
  252. else
  253. hp:=genordinalconstnode((vl2 shl 16) or vl,voidpointerdef);
  254. end;
  255. in_const_sqrt :
  256. begin
  257. if isreal then
  258. begin
  259. if vr<0.0 then
  260. CGMessage(type_e_wrong_math_argument)
  261. else
  262. hp:=genrealconstnode(sqrt(vr),bestrealdef^)
  263. end
  264. else
  265. begin
  266. if vl<0 then
  267. CGMessage(type_e_wrong_math_argument)
  268. else
  269. hp:=genrealconstnode(sqrt(vl),bestrealdef^);
  270. end;
  271. end;
  272. in_const_arctan :
  273. begin
  274. if isreal then
  275. hp:=genrealconstnode(arctan(vr),bestrealdef^)
  276. else
  277. hp:=genrealconstnode(arctan(vl),bestrealdef^);
  278. end;
  279. in_const_cos :
  280. begin
  281. if isreal then
  282. hp:=genrealconstnode(cos(vr),bestrealdef^)
  283. else
  284. hp:=genrealconstnode(cos(vl),bestrealdef^);
  285. end;
  286. in_const_sin :
  287. begin
  288. if isreal then
  289. hp:=genrealconstnode(sin(vr),bestrealdef^)
  290. else
  291. hp:=genrealconstnode(sin(vl),bestrealdef^);
  292. end;
  293. in_const_exp :
  294. begin
  295. if isreal then
  296. hp:=genrealconstnode(exp(vr),bestrealdef^)
  297. else
  298. hp:=genrealconstnode(exp(vl),bestrealdef^);
  299. end;
  300. in_const_ln :
  301. begin
  302. if isreal then
  303. begin
  304. if vr<=0.0 then
  305. CGMessage(type_e_wrong_math_argument)
  306. else
  307. hp:=genrealconstnode(ln(vr),bestrealdef^)
  308. end
  309. else
  310. begin
  311. if vl<=0 then
  312. CGMessage(type_e_wrong_math_argument)
  313. else
  314. hp:=genrealconstnode(ln(vl),bestrealdef^);
  315. end;
  316. end;
  317. else
  318. internalerror(88);
  319. end;
  320. end;
  321. disposetree(p);
  322. if hp=nil then
  323. hp:=genzeronode(errorn);
  324. firstpass(hp);
  325. p:=hp;
  326. end
  327. else
  328. begin
  329. case p^.inlinenumber of
  330. in_lo_qword,
  331. in_hi_qword,
  332. in_lo_long,
  333. in_hi_long,
  334. in_lo_word,
  335. in_hi_word:
  336. begin
  337. set_varstate(p^.left,true);
  338. if p^.registers32<1 then
  339. p^.registers32:=1;
  340. if p^.inlinenumber in [in_lo_word,in_hi_word] then
  341. p^.resulttype:=u8bitdef
  342. else if p^.inlinenumber in [in_lo_qword,in_hi_qword] then
  343. begin
  344. p^.resulttype:=u32bitdef;
  345. if (m_tp in aktmodeswitches) or
  346. (m_delphi in aktmodeswitches) then
  347. CGMessage(type_w_maybe_wrong_hi_lo);
  348. end
  349. else
  350. begin
  351. p^.resulttype:=u16bitdef;
  352. if (m_tp in aktmodeswitches) or
  353. (m_delphi in aktmodeswitches) then
  354. CGMessage(type_w_maybe_wrong_hi_lo);
  355. end;
  356. p^.location.loc:=LOC_REGISTER;
  357. if not is_integer(p^.left^.resulttype) then
  358. CGMessage(type_e_mismatch)
  359. else
  360. begin
  361. if p^.left^.treetype=ordconstn then
  362. begin
  363. case p^.inlinenumber of
  364. in_lo_word : hp:=genordinalconstnode(p^.left^.value and $ff,p^.left^.resulttype);
  365. in_hi_word : hp:=genordinalconstnode(p^.left^.value shr 8,p^.left^.resulttype);
  366. in_lo_long : hp:=genordinalconstnode(p^.left^.value and $ffff,p^.left^.resulttype);
  367. in_hi_long : hp:=genordinalconstnode(p^.left^.value shr 16,p^.left^.resulttype);
  368. in_lo_qword : hp:=genordinalconstnode(p^.left^.value and $ffffffff,p^.left^.resulttype);
  369. in_hi_qword : hp:=genordinalconstnode(p^.left^.value shr 32,p^.left^.resulttype);
  370. end;
  371. disposetree(p);
  372. firstpass(hp);
  373. p:=hp;
  374. end;
  375. end;
  376. end;
  377. in_sizeof_x:
  378. begin
  379. set_varstate(p^.left,false);
  380. if push_high_param(p^.left^.resulttype) then
  381. begin
  382. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  383. hp:=gennode(addn,genloadnode(pvarsym(srsym),p^.left^.symtable),
  384. genordinalconstnode(1,s32bitdef));
  385. if (p^.left^.resulttype^.deftype=arraydef) and
  386. (parraydef(p^.left^.resulttype)^.elesize<>1) then
  387. hp:=gennode(muln,hp,genordinalconstnode(parraydef(p^.left^.resulttype)^.elesize,s32bitdef));
  388. disposetree(p);
  389. p:=hp;
  390. firstpass(p);
  391. end;
  392. if p^.registers32<1 then
  393. p^.registers32:=1;
  394. p^.resulttype:=s32bitdef;
  395. p^.location.loc:=LOC_REGISTER;
  396. end;
  397. in_typeof_x:
  398. begin
  399. set_varstate(p^.left,false);
  400. if p^.registers32<1 then
  401. p^.registers32:=1;
  402. p^.location.loc:=LOC_REGISTER;
  403. p^.resulttype:=voidpointerdef;
  404. end;
  405. in_ord_x:
  406. begin
  407. set_varstate(p^.left,true);
  408. if (p^.left^.treetype=ordconstn) then
  409. begin
  410. hp:=genordinalconstnode(p^.left^.value,s32bitdef);
  411. disposetree(p);
  412. p:=hp;
  413. firstpass(p);
  414. end
  415. else
  416. begin
  417. if (p^.left^.resulttype^.deftype=orddef) then
  418. if (porddef(p^.left^.resulttype)^.typ in [uchar,bool8bit]) then
  419. begin
  420. if porddef(p^.left^.resulttype)^.typ=bool8bit then
  421. begin
  422. hp:=gentypeconvnode(p^.left,u8bitdef);
  423. putnode(p);
  424. p:=hp;
  425. p^.convtyp:=tc_bool_2_int;
  426. p^.explizit:=true;
  427. firstpass(p);
  428. end
  429. else
  430. begin
  431. hp:=gentypeconvnode(p^.left,u8bitdef);
  432. putnode(p);
  433. p:=hp;
  434. p^.explizit:=true;
  435. firstpass(p);
  436. end;
  437. end
  438. { can this happen ? }
  439. else if (porddef(p^.left^.resulttype)^.typ=uvoid) then
  440. CGMessage(type_e_mismatch)
  441. else
  442. { all other orddef need no transformation }
  443. begin
  444. hp:=p^.left;
  445. putnode(p);
  446. p:=hp;
  447. end
  448. else if (p^.left^.resulttype^.deftype=enumdef) then
  449. begin
  450. hp:=gentypeconvnode(p^.left,s32bitdef);
  451. putnode(p);
  452. p:=hp;
  453. p^.explizit:=true;
  454. firstpass(p);
  455. end
  456. else
  457. begin
  458. { can anything else be ord() ?}
  459. CGMessage(type_e_mismatch);
  460. end;
  461. end;
  462. end;
  463. in_chr_byte:
  464. begin
  465. set_varstate(p^.left,true);
  466. hp:=gentypeconvnode(p^.left,cchardef);
  467. putnode(p);
  468. p:=hp;
  469. p^.explizit:=true;
  470. firstpass(p);
  471. end;
  472. in_length_string:
  473. begin
  474. set_varstate(p^.left,true);
  475. if is_ansistring(p^.left^.resulttype) then
  476. p^.resulttype:=s32bitdef
  477. else
  478. p^.resulttype:=u8bitdef;
  479. { we don't need string conversations here }
  480. if (p^.left^.treetype=typeconvn) and
  481. (p^.left^.left^.resulttype^.deftype=stringdef) then
  482. begin
  483. hp:=p^.left^.left;
  484. putnode(p^.left);
  485. p^.left:=hp;
  486. end;
  487. { check the type, must be string or char }
  488. if (p^.left^.resulttype^.deftype<>stringdef) and
  489. (not is_char(p^.left^.resulttype)) then
  490. CGMessage(type_e_mismatch);
  491. { evaluates length of constant strings direct }
  492. if (p^.left^.treetype=stringconstn) then
  493. begin
  494. hp:=genordinalconstnode(p^.left^.length,s32bitdef);
  495. disposetree(p);
  496. firstpass(hp);
  497. p:=hp;
  498. end
  499. { length of char is one allways }
  500. else if is_constcharnode(p^.left) then
  501. begin
  502. hp:=genordinalconstnode(1,s32bitdef);
  503. disposetree(p);
  504. firstpass(hp);
  505. p:=hp;
  506. end;
  507. end;
  508. in_assigned_x:
  509. begin
  510. set_varstate(p^.left,true);
  511. p^.resulttype:=booldef;
  512. p^.location.loc:=LOC_FLAGS;
  513. end;
  514. in_ofs_x,
  515. in_seg_x :
  516. set_varstate(p^.left,false);
  517. in_pred_x,
  518. in_succ_x:
  519. begin
  520. p^.resulttype:=p^.left^.resulttype;
  521. if is_64bitint(p^.resulttype) then
  522. begin
  523. if (p^.registers32<2) then
  524. p^.registers32:=2
  525. end
  526. else
  527. begin
  528. if (p^.registers32<1) then
  529. p^.registers32:=1;
  530. end;
  531. p^.location.loc:=LOC_REGISTER;
  532. set_varstate(p^.left,true);
  533. if not is_ordinal(p^.resulttype) then
  534. CGMessage(type_e_ordinal_expr_expected)
  535. else
  536. begin
  537. if (p^.resulttype^.deftype=enumdef) and
  538. (penumdef(p^.resulttype)^.has_jumps) then
  539. CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible)
  540. else
  541. if p^.left^.treetype=ordconstn then
  542. begin
  543. if p^.inlinenumber=in_succ_x then
  544. hp:=genordinalconstnode(p^.left^.value+1,p^.left^.resulttype)
  545. else
  546. hp:=genordinalconstnode(p^.left^.value-1,p^.left^.resulttype);
  547. disposetree(p);
  548. firstpass(hp);
  549. p:=hp;
  550. end;
  551. end;
  552. end;
  553. in_inc_x,
  554. in_dec_x:
  555. begin
  556. p^.resulttype:=voiddef;
  557. if assigned(p^.left) then
  558. begin
  559. firstcallparan(p^.left,nil,true);
  560. set_varstate(p^.left,true);
  561. if codegenerror then
  562. exit;
  563. { first param must be var }
  564. valid_for_assign(p^.left^.left,false);
  565. { check type }
  566. if (p^.left^.resulttype^.deftype in [enumdef,pointerdef]) or
  567. is_ordinal(p^.left^.resulttype) then
  568. begin
  569. { two paras ? }
  570. if assigned(p^.left^.right) then
  571. begin
  572. { insert a type conversion }
  573. { the second param is always longint }
  574. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,s32bitdef);
  575. { check the type conversion }
  576. firstpass(p^.left^.right^.left);
  577. { need we an additional register ? }
  578. if not(is_constintnode(p^.left^.right^.left)) and
  579. (p^.left^.right^.left^.location.loc in [LOC_MEM,LOC_REFERENCE]) and
  580. (p^.left^.right^.left^.registers32<=1) then
  581. inc(p^.registers32);
  582. { do we need an additional register to restore the first parameter? }
  583. if p^.left^.right^.left^.registers32>=p^.registers32 then
  584. inc(p^.registers32);
  585. if assigned(p^.left^.right^.right) then
  586. CGMessage(cg_e_illegal_expression);
  587. end;
  588. end
  589. else
  590. CGMessage(type_e_ordinal_expr_expected);
  591. end
  592. else
  593. CGMessage(type_e_mismatch);
  594. end;
  595. in_read_x,
  596. in_readln_x,
  597. in_write_x,
  598. in_writeln_x :
  599. begin
  600. { needs a call }
  601. procinfo^.flags:=procinfo^.flags or pi_do_call;
  602. p^.resulttype:=voiddef;
  603. { true, if readln needs an extra register }
  604. extra_register:=false;
  605. { we must know if it is a typed file or not }
  606. { but we must first do the firstpass for it }
  607. file_is_typed:=false;
  608. if assigned(p^.left) then
  609. begin
  610. dowrite:=(p^.inlinenumber in [in_write_x,in_writeln_x]);
  611. firstcallparan(p^.left,nil,true);
  612. set_varstate(p^.left,dowrite);
  613. { now we can check }
  614. hp:=p^.left;
  615. while assigned(hp^.right) do
  616. hp:=hp^.right;
  617. { if resulttype is not assigned, then automatically }
  618. { file is not typed. }
  619. if assigned(hp) and assigned(hp^.resulttype) then
  620. Begin
  621. if (hp^.resulttype^.deftype=filedef) and
  622. (pfiledef(hp^.resulttype)^.filetyp=ft_typed) then
  623. begin
  624. file_is_typed:=true;
  625. { test the type }
  626. hpp:=p^.left;
  627. while (hpp<>hp) do
  628. begin
  629. if (hpp^.left^.treetype=typen) then
  630. CGMessage(type_e_cant_read_write_type);
  631. if not is_equal(hpp^.resulttype,pfiledef(hp^.resulttype)^.typedfiletype.def) then
  632. CGMessage(type_e_mismatch);
  633. { generate the high() value for the shortstring }
  634. if ((not dowrite) and is_shortstring(hpp^.left^.resulttype)) or
  635. (is_chararray(hpp^.left^.resulttype)) then
  636. gen_high_tree(hpp,true);
  637. hpp:=hpp^.right;
  638. end;
  639. end;
  640. end; { endif assigned(hp) }
  641. { insert type conversions for write(ln) }
  642. if (not file_is_typed) then
  643. begin
  644. hp:=p^.left;
  645. while assigned(hp) do
  646. begin
  647. if (hp^.left^.treetype=typen) then
  648. CGMessage(type_e_cant_read_write_type);
  649. if assigned(hp^.left^.resulttype) then
  650. begin
  651. isreal:=false;
  652. { support writeln(procvar) }
  653. if (hp^.left^.resulttype^.deftype=procvardef) then
  654. begin
  655. p1:=gencallnode(nil,nil);
  656. p1^.right:=hp^.left;
  657. p1^.resulttype:=pprocvardef(hp^.left^.resulttype)^.rettype.def;
  658. firstpass(p1);
  659. hp^.left:=p1;
  660. end;
  661. case hp^.left^.resulttype^.deftype of
  662. filedef :
  663. begin
  664. { only allowed as first parameter }
  665. if assigned(hp^.right) then
  666. CGMessage(type_e_cant_read_write_type);
  667. end;
  668. stringdef :
  669. begin
  670. { generate the high() value for the shortstring }
  671. if (not dowrite) and
  672. is_shortstring(hp^.left^.resulttype) then
  673. gen_high_tree(hp,true);
  674. end;
  675. pointerdef :
  676. begin
  677. if not is_pchar(hp^.left^.resulttype) then
  678. CGMessage(type_e_cant_read_write_type);
  679. end;
  680. floatdef :
  681. begin
  682. isreal:=true;
  683. end;
  684. orddef :
  685. begin
  686. case porddef(hp^.left^.resulttype)^.typ of
  687. uchar,
  688. u32bit,s32bit,
  689. u64bit,s64bit:
  690. ;
  691. u8bit,s8bit,
  692. u16bit,s16bit :
  693. if dowrite then
  694. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  695. bool8bit,
  696. bool16bit,
  697. bool32bit :
  698. if dowrite then
  699. hp^.left:=gentypeconvnode(hp^.left,booldef)
  700. else
  701. CGMessage(type_e_cant_read_write_type);
  702. else
  703. CGMessage(type_e_cant_read_write_type);
  704. end;
  705. if not(dowrite) and
  706. not(is_64bitint(hp^.left^.resulttype)) then
  707. extra_register:=true;
  708. end;
  709. arraydef :
  710. begin
  711. if is_chararray(hp^.left^.resulttype) then
  712. gen_high_tree(hp,true)
  713. else
  714. CGMessage(type_e_cant_read_write_type);
  715. end;
  716. else
  717. CGMessage(type_e_cant_read_write_type);
  718. end;
  719. { some format options ? }
  720. if hp^.is_colon_para then
  721. begin
  722. if hp^.right^.is_colon_para then
  723. begin
  724. frac_para:=hp;
  725. length_para:=hp^.right;
  726. hp:=hp^.right;
  727. hpp:=hp^.right;
  728. end
  729. else
  730. begin
  731. length_para:=hp;
  732. frac_para:=nil;
  733. hpp:=hp^.right;
  734. end;
  735. isreal:=(hpp^.left^.resulttype^.deftype=floatdef);
  736. if (not is_integer(length_para^.left^.resulttype)) then
  737. CGMessage1(type_e_integer_expr_expected,length_para^.left^.resulttype^.typename)
  738. else
  739. length_para^.left:=gentypeconvnode(length_para^.left,s32bitdef);
  740. if assigned(frac_para) then
  741. begin
  742. if isreal then
  743. begin
  744. if (not is_integer(frac_para^.left^.resulttype)) then
  745. CGMessage1(type_e_integer_expr_expected,frac_para^.left^.resulttype^.typename)
  746. else
  747. frac_para^.left:=gentypeconvnode(frac_para^.left,s32bitdef);
  748. end
  749. else
  750. CGMessage(parser_e_illegal_colon_qualifier);
  751. end;
  752. { do the checking for the colon'd arg }
  753. hp:=length_para;
  754. end;
  755. end;
  756. hp:=hp^.right;
  757. end;
  758. end;
  759. { pass all parameters again for the typeconversions }
  760. if codegenerror then
  761. exit;
  762. firstcallparan(p^.left,nil,true);
  763. set_varstate(p^.left,true);
  764. { calc registers }
  765. left_right_max(p);
  766. if extra_register then
  767. inc(p^.registers32);
  768. end;
  769. end;
  770. in_settextbuf_file_x :
  771. begin
  772. { warning here p^.left is the callparannode
  773. not the argument directly }
  774. { p^.left^.left is text var }
  775. { p^.left^.right^.left is the buffer var }
  776. { firstcallparan(p^.left,nil);
  777. already done in firstcalln }
  778. { now we know the type of buffer }
  779. getsymonlyin(systemunit,'SETTEXTBUF');
  780. hp:=gencallnode(pprocsym(srsym),systemunit);
  781. hp^.left:=gencallparanode(
  782. genordinalconstnode(p^.left^.left^.resulttype^.size,s32bitdef),p^.left);
  783. putnode(p);
  784. p:=hp;
  785. firstpass(p);
  786. end;
  787. { the firstpass of the arg has been done in firstcalln ? }
  788. in_reset_typedfile,
  789. in_rewrite_typedfile :
  790. begin
  791. procinfo^.flags:=procinfo^.flags or pi_do_call;
  792. firstpass(p^.left);
  793. set_varstate(p^.left,true);
  794. p^.resulttype:=voiddef;
  795. end;
  796. in_str_x_string :
  797. begin
  798. procinfo^.flags:=procinfo^.flags or pi_do_call;
  799. p^.resulttype:=voiddef;
  800. { check the amount of parameters }
  801. if not(assigned(p^.left)) or
  802. not(assigned(p^.left^.right)) then
  803. begin
  804. CGMessage(parser_e_wrong_parameter_size);
  805. exit;
  806. end;
  807. { first pass just the string for first local use }
  808. hp:=p^.left^.right;
  809. p^.left^.right:=nil;
  810. firstcallparan(p^.left,nil,true);
  811. set_varstate(p^.left,false);
  812. { remove warning when result is passed }
  813. set_funcret_is_valid(p^.left^.left);
  814. p^.left^.right:=hp;
  815. firstcallparan(p^.left^.right,nil,true);
  816. set_varstate(p^.left^.right,true);
  817. hp:=p^.left;
  818. { valid string ? }
  819. if not assigned(hp) or
  820. (hp^.left^.resulttype^.deftype<>stringdef) or
  821. (hp^.right=nil) then
  822. CGMessage(cg_e_illegal_expression);
  823. { we need a var parameter }
  824. valid_for_assign(hp^.left,false);
  825. { generate the high() value for the shortstring }
  826. if is_shortstring(hp^.left^.resulttype) then
  827. gen_high_tree(hp,true);
  828. { !!!! check length of string }
  829. while assigned(hp^.right) do
  830. hp:=hp^.right;
  831. { check and convert the first param }
  832. if hp^.is_colon_para then
  833. CGMessage(cg_e_illegal_expression);
  834. isreal:=false;
  835. case hp^.resulttype^.deftype of
  836. orddef :
  837. begin
  838. case porddef(hp^.left^.resulttype)^.typ of
  839. u32bit,s32bit,
  840. s64bit,u64bit:
  841. ;
  842. u8bit,s8bit,
  843. u16bit,s16bit:
  844. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  845. else
  846. CGMessage(type_e_integer_or_real_expr_expected);
  847. end;
  848. end;
  849. floatdef :
  850. begin
  851. isreal:=true;
  852. end;
  853. else
  854. CGMessage(type_e_integer_or_real_expr_expected);
  855. end;
  856. { some format options ? }
  857. hpp:=p^.left^.right;
  858. if assigned(hpp) and hpp^.is_colon_para then
  859. begin
  860. firstpass(hpp^.left);
  861. set_varstate(hpp^.left,true);
  862. if (not is_integer(hpp^.left^.resulttype)) then
  863. CGMessage1(type_e_integer_expr_expected,hpp^.left^.resulttype^.typename)
  864. else
  865. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  866. hpp:=hpp^.right;
  867. if assigned(hpp) and hpp^.is_colon_para then
  868. begin
  869. if isreal then
  870. begin
  871. if (not is_integer(hpp^.left^.resulttype)) then
  872. CGMessage1(type_e_integer_expr_expected,hpp^.left^.resulttype^.typename)
  873. else
  874. begin
  875. firstpass(hpp^.left);
  876. set_varstate(hpp^.left,true);
  877. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  878. end;
  879. end
  880. else
  881. CGMessage(parser_e_illegal_colon_qualifier);
  882. end;
  883. end;
  884. { pass all parameters again for the typeconversions }
  885. if codegenerror then
  886. exit;
  887. firstcallparan(p^.left,nil,true);
  888. { calc registers }
  889. left_right_max(p);
  890. end;
  891. in_val_x :
  892. begin
  893. procinfo^.flags:=procinfo^.flags or pi_do_call;
  894. p^.resulttype:=voiddef;
  895. { check the amount of parameters }
  896. if not(assigned(p^.left)) or
  897. not(assigned(p^.left^.right)) then
  898. begin
  899. CGMessage(parser_e_wrong_parameter_size);
  900. exit;
  901. end;
  902. If Assigned(p^.left^.right^.right) Then
  903. {there is a "code" parameter}
  904. Begin
  905. { first pass just the code parameter for first local use}
  906. hp := p^.left^.right;
  907. p^.left^.right := nil;
  908. make_not_regable(p^.left^.left);
  909. firstcallparan(p^.left, nil,true);
  910. set_varstate(p^.left,false);
  911. if codegenerror then exit;
  912. p^.left^.right := hp;
  913. {code has to be a var parameter}
  914. if valid_for_assign(p^.left^.left,false) then
  915. begin
  916. if (p^.left^.left^.resulttype^.deftype <> orddef) or
  917. not(porddef(p^.left^.left^.resulttype)^.typ in
  918. [u16bit,s16bit,u32bit,s32bit]) then
  919. CGMessage(type_e_mismatch);
  920. end;
  921. hpp := p^.left^.right
  922. End
  923. Else hpp := p^.left;
  924. {now hpp = the destination value tree}
  925. { first pass just the destination parameter for first local use}
  926. hp:=hpp^.right;
  927. hpp^.right:=nil;
  928. {hpp = destination}
  929. make_not_regable(hpp^.left);
  930. firstcallparan(hpp,nil,true);
  931. set_varstate(hpp,false);
  932. if codegenerror then
  933. exit;
  934. { remove warning when result is passed }
  935. set_funcret_is_valid(hpp^.left);
  936. hpp^.right := hp;
  937. if valid_for_assign(hpp^.left,false) then
  938. begin
  939. If Not((hpp^.left^.resulttype^.deftype = floatdef) or
  940. ((hpp^.left^.resulttype^.deftype = orddef) And
  941. (POrdDef(hpp^.left^.resulttype)^.typ in
  942. [u32bit,s32bit,
  943. u8bit,s8bit,u16bit,s16bit,s64bit,u64bit]))) Then
  944. CGMessage(type_e_mismatch);
  945. end;
  946. {hp = source (String)}
  947. { count_ref := false; WHY ?? }
  948. firstcallparan(hp,nil,true);
  949. set_varstate(hp,true);
  950. if codegenerror then
  951. exit;
  952. { if not a stringdef then insert a type conv which
  953. does the other type checking }
  954. If (hp^.left^.resulttype^.deftype<>stringdef) then
  955. begin
  956. hp^.left:=gentypeconvnode(hp^.left,cshortstringdef);
  957. firstpass(hp);
  958. end;
  959. { calc registers }
  960. left_right_max(p);
  961. { val doesn't calculate the registers really }
  962. { correct, we need one register extra (FK) }
  963. if is_64bitint(hpp^.left^.resulttype) then
  964. inc(p^.registers32,2)
  965. else
  966. inc(p^.registers32,1);
  967. end;
  968. in_include_x_y,
  969. in_exclude_x_y:
  970. begin
  971. p^.resulttype:=voiddef;
  972. if assigned(p^.left) then
  973. begin
  974. firstcallparan(p^.left,nil,true);
  975. set_varstate(p^.left,true);
  976. p^.registers32:=p^.left^.registers32;
  977. p^.registersfpu:=p^.left^.registersfpu;
  978. {$ifdef SUPPORT_MMX}
  979. p^.registersmmx:=p^.left^.registersmmx;
  980. {$endif SUPPORT_MMX}
  981. { remove warning when result is passed }
  982. set_funcret_is_valid(p^.left^.left);
  983. { first param must be var }
  984. valid_for_assign(p^.left^.left,false);
  985. { check type }
  986. if (p^.left^.resulttype^.deftype=setdef) then
  987. begin
  988. { two paras ? }
  989. if assigned(p^.left^.right) then
  990. begin
  991. { insert a type conversion }
  992. { to the type of the set elements }
  993. p^.left^.right^.left:=gentypeconvnode(
  994. p^.left^.right^.left,
  995. psetdef(p^.left^.resulttype)^.elementtype.def);
  996. { check the type conversion }
  997. firstpass(p^.left^.right^.left);
  998. { only three parameters are allowed }
  999. if assigned(p^.left^.right^.right) then
  1000. CGMessage(cg_e_illegal_expression);
  1001. end;
  1002. end
  1003. else
  1004. CGMessage(type_e_mismatch);
  1005. end
  1006. else
  1007. CGMessage(type_e_mismatch);
  1008. end;
  1009. in_low_x,
  1010. in_high_x:
  1011. begin
  1012. set_varstate(p^.left,false);
  1013. if p^.left^.treetype in [typen,loadn,subscriptn] then
  1014. begin
  1015. case p^.left^.resulttype^.deftype of
  1016. orddef,enumdef:
  1017. begin
  1018. do_lowhigh(p^.left^.resulttype);
  1019. firstpass(p);
  1020. end;
  1021. setdef:
  1022. begin
  1023. do_lowhigh(Psetdef(p^.left^.resulttype)^.elementtype.def);
  1024. firstpass(p);
  1025. end;
  1026. arraydef:
  1027. begin
  1028. if p^.inlinenumber=in_low_x then
  1029. begin
  1030. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.lowrange,
  1031. Parraydef(p^.left^.resulttype)^.rangetype.def);
  1032. disposetree(p);
  1033. p:=hp;
  1034. firstpass(p);
  1035. end
  1036. else
  1037. begin
  1038. if is_open_array(p^.left^.resulttype) or
  1039. is_array_of_const(p^.left^.resulttype) then
  1040. begin
  1041. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1042. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1043. disposetree(p);
  1044. p:=hp;
  1045. firstpass(p);
  1046. end
  1047. else
  1048. begin
  1049. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.highrange,
  1050. Parraydef(p^.left^.resulttype)^.rangetype.def);
  1051. disposetree(p);
  1052. p:=hp;
  1053. firstpass(p);
  1054. end;
  1055. end;
  1056. end;
  1057. stringdef:
  1058. begin
  1059. if p^.inlinenumber=in_low_x then
  1060. begin
  1061. hp:=genordinalconstnode(0,u8bitdef);
  1062. disposetree(p);
  1063. p:=hp;
  1064. firstpass(p);
  1065. end
  1066. else
  1067. begin
  1068. if is_open_string(p^.left^.resulttype) then
  1069. begin
  1070. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1071. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1072. disposetree(p);
  1073. p:=hp;
  1074. firstpass(p);
  1075. end
  1076. else
  1077. begin
  1078. hp:=genordinalconstnode(Pstringdef(p^.left^.resulttype)^.len,u8bitdef);
  1079. disposetree(p);
  1080. p:=hp;
  1081. firstpass(p);
  1082. end;
  1083. end;
  1084. end;
  1085. else
  1086. CGMessage(type_e_mismatch);
  1087. end;
  1088. end
  1089. else
  1090. CGMessage(type_e_varid_or_typeid_expected);
  1091. end;
  1092. in_cos_extended:
  1093. begin
  1094. if p^.left^.treetype in [ordconstn,realconstn] then
  1095. setconstrealvalue(cos(getconstrealvalue))
  1096. else
  1097. handleextendedfunction;
  1098. end;
  1099. in_sin_extended:
  1100. begin
  1101. if p^.left^.treetype in [ordconstn,realconstn] then
  1102. setconstrealvalue(sin(getconstrealvalue))
  1103. else
  1104. handleextendedfunction;
  1105. end;
  1106. in_arctan_extended:
  1107. begin
  1108. if p^.left^.treetype in [ordconstn,realconstn] then
  1109. setconstrealvalue(arctan(getconstrealvalue))
  1110. else
  1111. handleextendedfunction;
  1112. end;
  1113. in_pi:
  1114. if block_type=bt_const then
  1115. setconstrealvalue(pi)
  1116. else
  1117. begin
  1118. p^.location.loc:=LOC_FPU;
  1119. p^.resulttype:=s80floatdef;
  1120. end;
  1121. in_abs_extended:
  1122. begin
  1123. if p^.left^.treetype in [ordconstn,realconstn] then
  1124. setconstrealvalue(abs(getconstrealvalue))
  1125. else
  1126. handleextendedfunction;
  1127. end;
  1128. in_sqr_extended:
  1129. begin
  1130. if p^.left^.treetype in [ordconstn,realconstn] then
  1131. setconstrealvalue(sqr(getconstrealvalue))
  1132. else
  1133. handleextendedfunction;
  1134. end;
  1135. in_sqrt_extended:
  1136. begin
  1137. if p^.left^.treetype in [ordconstn,realconstn] then
  1138. begin
  1139. vr:=getconstrealvalue;
  1140. if vr<0.0 then
  1141. begin
  1142. CGMessage(type_e_wrong_math_argument);
  1143. setconstrealvalue(0);
  1144. end
  1145. else
  1146. setconstrealvalue(sqrt(vr));
  1147. end
  1148. else
  1149. handleextendedfunction;
  1150. end;
  1151. in_ln_extended:
  1152. begin
  1153. if p^.left^.treetype in [ordconstn,realconstn] then
  1154. begin
  1155. vr:=getconstrealvalue;
  1156. if vr<=0.0 then
  1157. begin
  1158. CGMessage(type_e_wrong_math_argument);
  1159. setconstrealvalue(0);
  1160. end
  1161. else
  1162. setconstrealvalue(ln(vr));
  1163. end
  1164. else
  1165. handleextendedfunction;
  1166. end;
  1167. {$ifdef SUPPORT_MMX}
  1168. in_mmx_pcmpeqb..in_mmx_pcmpgtw:
  1169. begin
  1170. end;
  1171. {$endif SUPPORT_MMX}
  1172. in_assert_x_y :
  1173. begin
  1174. p^.resulttype:=voiddef;
  1175. if assigned(p^.left) then
  1176. begin
  1177. firstcallparan(p^.left,nil,true);
  1178. set_varstate(p^.left,true);
  1179. p^.registers32:=p^.left^.registers32;
  1180. p^.registersfpu:=p^.left^.registersfpu;
  1181. {$ifdef SUPPORT_MMX}
  1182. p^.registersmmx:=p^.left^.registersmmx;
  1183. {$endif SUPPORT_MMX}
  1184. { check type }
  1185. if is_boolean(p^.left^.resulttype) then
  1186. begin
  1187. { must always be a string }
  1188. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,cshortstringdef);
  1189. firstpass(p^.left^.right^.left);
  1190. end
  1191. else
  1192. CGMessage(type_e_mismatch);
  1193. end
  1194. else
  1195. CGMessage(type_e_mismatch);
  1196. { We've checked the whole statement for correctness, now we
  1197. can remove it if assertions are off }
  1198. if not(cs_do_assertion in aktlocalswitches) then
  1199. begin
  1200. disposetree(p^.left);
  1201. putnode(p);
  1202. { we need a valid node, so insert a nothingn }
  1203. p:=genzeronode(nothingn);
  1204. end;
  1205. end;
  1206. else
  1207. internalerror(8);
  1208. end;
  1209. end;
  1210. { generate an error if no resulttype is set }
  1211. if not assigned(p^.resulttype) then
  1212. p^.resulttype:=generrordef;
  1213. dec(parsing_para_level);
  1214. end;
  1215. end.
  1216. {
  1217. $Log$
  1218. Revision 1.65 2000-02-09 13:23:07 peter
  1219. * log truncated
  1220. Revision 1.64 2000/01/07 01:14:45 peter
  1221. * updated copyright to 2000
  1222. Revision 1.63 1999/12/30 15:02:10 peter
  1223. * fixed crash with undefined variable
  1224. Revision 1.62 1999/12/02 12:38:45 florian
  1225. + added support for succ/pred(<qword/int64>)
  1226. Revision 1.61 1999/11/30 10:40:58 peter
  1227. + ttype, tsymlist
  1228. Revision 1.60 1999/11/18 15:34:49 pierre
  1229. * Notes/Hints for local syms changed to
  1230. Set_varstate function
  1231. Revision 1.59 1999/11/17 17:05:07 pierre
  1232. * Notes/hints changes
  1233. Revision 1.58 1999/11/06 14:34:30 peter
  1234. * truncated log to 20 revs
  1235. Revision 1.57 1999/10/29 15:28:51 peter
  1236. * fixed assert, the tree is now disposed in firstpass if assertions
  1237. are off.
  1238. Revision 1.56 1999/10/26 12:30:46 peter
  1239. * const parameter is now checked
  1240. * better and generic check if a node can be used for assigning
  1241. * export fixes
  1242. * procvar equal works now (it never had worked at least from 0.99.8)
  1243. * defcoll changed to linkedlist with pparaitem so it can easily be
  1244. walked both directions
  1245. Revision 1.55 1999/10/22 14:37:31 peter
  1246. * error when properties are passed to var parameters
  1247. Revision 1.54 1999/10/21 16:41:41 florian
  1248. * problems with readln fixed: esi wasn't restored correctly when
  1249. reading ordinal fields of objects futher the register allocation
  1250. didn't take care of the extra register when reading ordinal values
  1251. * enumerations can now be used in constant indexes of properties
  1252. Revision 1.53 1999/09/28 20:48:27 florian
  1253. * fixed bug 610
  1254. + added $D- for TP in symtable.pas else it can't be compiled anymore
  1255. (too much symbols :()
  1256. Revision 1.52 1999/09/27 23:45:01 peter
  1257. * procinfo is now a pointer
  1258. * support for result setting in sub procedure
  1259. Revision 1.51 1999/09/15 20:35:46 florian
  1260. * small fix to operator overloading when in MMX mode
  1261. + the compiler uses now fldz and fld1 if possible
  1262. + some fixes to floating point registers
  1263. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1264. * .... ???
  1265. Revision 1.50 1999/09/07 14:05:11 pierre
  1266. * halt removed in do_lowhigh
  1267. Revision 1.49 1999/08/28 15:34:21 florian
  1268. * bug 519 fixed
  1269. Revision 1.48 1999/08/23 23:41:04 pierre
  1270. * in_inc_x register allocation corrected
  1271. Revision 1.47 1999/08/06 12:43:13 jonas
  1272. * fix for regvars with the val code
  1273. Revision 1.46 1999/08/05 16:53:23 peter
  1274. * V_Fatal=1, all other V_ are also increased
  1275. * Check for local procedure when assigning procvar
  1276. * fixed comment parsing because directives
  1277. * oldtp mode directives better supported
  1278. * added some messages to errore.msg
  1279. Revision 1.45 1999/08/04 00:23:40 florian
  1280. * renamed i386asm and i386base to cpuasm and cpubase
  1281. }