Changed method of allocating locals

This commit is contained in:
ceriel 1991-02-20 09:54:55 +00:00
parent 1fec35a71e
commit c9ece34fc5

View file

@ -60,19 +60,23 @@ string holstr(n) word n; {
prolog(nlocals) full nlocals; { prolog(nlocals) full nlocals; {
fputs("push ebp\nmov ebp,esp\n", codefile); fputs("push ebp\nmov ebp,esp\n", codefile);
if (nlocals == 0) return;
#ifdef NOTDEF
probably not better on 386.
switch(nlocals) { switch(nlocals) {
case 8: case 8:
fputs("push eax\n", codefile); fputs("push eax\n", codefile);
/* fall through */ /* fall through */
case 4: case 4:
fputs("push eax\n", codefile); fputs("push eax\n", codefile);
/* fall through */
case 0:
break; break;
default: default:
#endif
fprintf(codefile, "\tsub\tesp,%ld\n",nlocals); fprintf(codefile, "\tsub\tesp,%ld\n",nlocals);
#ifdef NOTDEF
break; break;
} }
#endif
} }
#ifdef REGVARS #ifdef REGVARS