Merge pull request #168 from davidgiven/dtrg-i167
i80: fix large stack frames
This commit is contained in:
commit
d4d5eee1cd
2 changed files with 10 additions and 7 deletions
|
@ -49,16 +49,18 @@ void con_mult(sz) word sz;
|
||||||
|
|
||||||
void prolog(full nlocals)
|
void prolog(full nlocals)
|
||||||
{
|
{
|
||||||
if (nlocals == 0)
|
int16_t adjustment = -nlocals;
|
||||||
|
|
||||||
|
if (adjustment == 0)
|
||||||
fprintf(codefile, "\tcall .pro0\n");
|
fprintf(codefile, "\tcall .pro0\n");
|
||||||
else if (nlocals == 2)
|
else if (adjustment == -2)
|
||||||
fprintf(codefile, "\tcall .pro2\n");
|
fprintf(codefile, "\tcall .pro2\n");
|
||||||
else if (nlocals == 4)
|
else if (adjustment == -4)
|
||||||
fprintf(codefile, "\tcall .pro4\n");
|
fprintf(codefile, "\tcall .pro4\n");
|
||||||
else if (nlocals < 0x100)
|
else if ((adjustment >= -128) && (adjustment <= 127))
|
||||||
fprintf(codefile, "\tcall .probyte\n\t.data1 %d\n", -nlocals);
|
fprintf(codefile, "\tcall .probyte\n\t.data1 %d\n", adjustment);
|
||||||
else
|
else
|
||||||
fprintf(codefile, "\tcall .proword\n\t.data2 %d\n", -nlocals);
|
fprintf(codefile, "\tcall .proword\n\t.data2 %d\n", adjustment);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mes(type) word type;
|
void mes(type) word type;
|
||||||
|
|
|
@ -350,12 +350,13 @@ pat lol ($1<0) && ($1>=0-STACKHELPERS)
|
||||||
yields de
|
yields de
|
||||||
|
|
||||||
pat lol
|
pat lol
|
||||||
uses dereg
|
uses dereg, hlreg={const2, $1}
|
||||||
gen
|
gen
|
||||||
dad lb
|
dad lb
|
||||||
mov e, {m}
|
mov e, {m}
|
||||||
inx hl
|
inx hl
|
||||||
mov d, {m}
|
mov d, {m}
|
||||||
|
yields de
|
||||||
|
|
||||||
pat loe
|
pat loe
|
||||||
uses hlreg
|
uses hlreg
|
||||||
|
|
Loading…
Add table
Reference in a new issue