COMPORT – Compilador Portugol - Nilo Menezes
COMPORT – Compilador Portugol - Nilo Menezes
COMPORT – Compilador Portugol - Nilo Menezes
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
{<br />
}<br />
long r;<br />
if (x.type == ftyp)<br />
{<br />
if (Class == Par)<br />
{<br />
if (x.mode == Var)<br />
{<br />
if (x.a != 0)<br />
{<br />
if (x.lev != 0)<br />
{<br />
rel[relx] = SHORT (pc);<br />
relx++;<br />
}<br />
GetReg (r);<br />
Put (ADDI, r, x.r, x.a);<br />
}<br />
else<br />
r = x.r;<br />
}<br />
else<br />
Mark ("illegal parameter mode");<br />
Put (PSH, r, SP, 4);<br />
EXCL (regs, r);<br />
}<br />
else<br />
{<br />
if (x.mode != Reg)<br />
load (x);<br />
Put (PSH, x.r, SP, 4);<br />
EXCL (regs, x.r);<br />
}<br />
}<br />
else<br />
Mark ("bad parameter type");<br />
void<br />
CJump (Item & x)<br />
{<br />
if (x.type->form == Boolean)<br />
{<br />
if (x.mode != Cond)<br />
loadBool (x);<br />
Put (BEQ + negated (x.c), x.r, 0, x.a);<br />
EXCL (regs, x.r);<br />
FixLink (x.b);<br />
x.a = pc - 1;<br />
}<br />
else<br />
{<br />
Mark ("Boolean?");<br />
x.a = pc;<br />
}<br />
}<br />
void<br />
BJump (long L)<br />
{<br />
Put (BEQ, 0, 0, L - pc);<br />
ComPort <strong>–</strong> <strong>Compilador</strong> <strong>Portugol</strong><br />
95