From: David Given Date: Sat, 15 Oct 2016 21:39:38 +0000 (+0200) Subject: Various bits of cleanup; we should almost be ready to try sending this to the X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6a23906ad890612fe8c0af54ca76db8e0c232f21;p=ack.git Various bits of cleanup; we should almost be ready to try sending this to the assembler soon... --- diff --git a/mach/proto/mcg/main.c b/mach/proto/mcg/main.c index 36696bca4..b518bff59 100644 --- a/mach/proto/mcg/main.c +++ b/mach/proto/mcg/main.c @@ -101,6 +101,8 @@ int main(int argc, char* const argv[]) else outputfile = stdout; + fprintf(outputfile, ".sect .text\n.sect .rom\n.sect .data\n.sect .bss\n"); + /* Reads in the EM, outputs the data sections, parses any code and * generates IR trees. */ diff --git a/mach/proto/mcg/powerpc.c b/mach/proto/mcg/powerpc.c index fbd669e3e..1c900bea0 100644 --- a/mach/proto/mcg/powerpc.c +++ b/mach/proto/mcg/powerpc.c @@ -30,9 +30,9 @@ struct hop* platform_prologue(void) hop_add_insel(hop, "! spills_size = %d bytes", current_proc->spills_size); hop_add_insel(hop, "! locals_size = %d bytes", current_proc->locals_size); hop_add_insel(hop, "addi sp, sp, %d", -(current_proc->fp_to_ab + current_proc->locals_size)); - hop_add_insel(hop, "mfspr 0, lr"); + hop_add_insel(hop, "mfspr r0, lr"); hop_add_insel(hop, "stw fp, %d(sp)", current_proc->fp_to_st + current_proc->locals_size); - hop_add_insel(hop, "stw 0, %d(sp)", current_proc->fp_to_st + current_proc->locals_size + 4); + hop_add_insel(hop, "stw r0, %d(sp)", current_proc->fp_to_st + current_proc->locals_size + 4); hop_add_insel(hop, "addi fp, sp, %d", current_proc->locals_size); return hop; diff --git a/mach/proto/mcg/procedure.c b/mach/proto/mcg/procedure.c index 1484c2af9..320dedf7b 100644 --- a/mach/proto/mcg/procedure.c +++ b/mach/proto/mcg/procedure.c @@ -110,6 +110,7 @@ static void emit_procedure(struct procedure* proc) { int i, j; + fprintf(outputfile, "\n.sect .text\n"); for (i=0; i