some fixes/improvements
This commit is contained in:
parent
3ea0fc0fe6
commit
4059840c43
1 changed files with 12 additions and 12 deletions
|
@ -49,11 +49,11 @@ con_float() {
|
||||||
if (i!= 4 && i!= 8)
|
if (i!= 4 && i!= 8)
|
||||||
fatal("bad fcon size");
|
fatal("bad fcon size");
|
||||||
if (! warning_given) {
|
if (! warning_given) {
|
||||||
fprintf(stderr, "Warning: dummy floating point constant(s)\n");
|
fputs("Warning: dummy floating point constant(s)\n", stderr);
|
||||||
warning_given = 1;
|
warning_given = 1;
|
||||||
}
|
}
|
||||||
while ( i ) {
|
while ( i ) {
|
||||||
fprintf(codefile," .data2 0,0\n") ;
|
fputs(" .data2 0,0\n", codefile) ;
|
||||||
i -=4 ;
|
i -=4 ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,13 +69,13 @@ string holstr(n) word n; {
|
||||||
|
|
||||||
prolog(nlocals) full nlocals; {
|
prolog(nlocals) full nlocals; {
|
||||||
|
|
||||||
fprintf(codefile,"\tpush\tbp\n\tmov\tbp,sp\n");
|
fputs("\tpush\tbp\n\tmov\tbp,sp\n", codefile);
|
||||||
switch (nlocals) {
|
switch (nlocals) {
|
||||||
case 4: printf("\tpush\tax\n");
|
case 4: fputs("\tpush\tax\n", codefile);
|
||||||
case 2: printf("\tpush\tax\n");
|
case 2: fputs("\tpush\tax\n", codefile);
|
||||||
case 0: break;
|
case 0: break;
|
||||||
default:
|
default:
|
||||||
printf("\tsub\tsp,%d\n",nlocals); break;
|
fprintf(codefile, "\tsub\tsp,%d\n",nlocals); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,14 +130,14 @@ regsave(regstr, off, size)
|
||||||
regreturn()
|
regreturn()
|
||||||
{
|
{
|
||||||
if (firstreg == 1) {
|
if (firstreg == 1) {
|
||||||
if (si_off != -1) fputs("pop si\n", codefile);
|
if (si_off != -1) fputs("jmp .sdret\n", codefile);
|
||||||
fputs("pop di\n", codefile);
|
else fputs("jmp .dret\n", codefile);
|
||||||
}
|
}
|
||||||
else if (firstreg == -1) {
|
else if (firstreg == -1) {
|
||||||
if (di_off != -1) fputs("pop di\n", codefile);
|
if (di_off != -1) fputs("jmp .dsret\n", codefile);
|
||||||
fputs("pop si\n", codefile);
|
else fputs("jmp .sret\n", codefile);
|
||||||
}
|
}
|
||||||
fputs("mov sp,bp\npop bp\nret\n", codefile);
|
else fputs("jmp .cret\n", codefile);
|
||||||
}
|
}
|
||||||
#endif REGVARS
|
#endif REGVARS
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ mes(type) word type ; {
|
||||||
return ;
|
return ;
|
||||||
default:
|
default:
|
||||||
strarg(argt) ;
|
strarg(argt) ;
|
||||||
printf(".define %s\n",argstr) ;
|
fprintf(codefile, ".define %s\n",argstr) ;
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue