aboutsummaryrefslogtreecommitdiff
path: root/mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'mips.c')
-rw-r--r--mips.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mips.c b/mips.c
index 4e1c26e..27f7e58 100644
--- a/mips.c
+++ b/mips.c
@@ -92,7 +92,7 @@ void mips_store(int reg, COpr_t opr) {
/* TODO: struct */
if (var->global)
printf("\t%s $%d, _%s\n", l, reg, var->name);
- else
+ else if (opr->reg == -1)
printf("\t%s $%d, %d($sp)\t#%s\n", l, reg, var->start, var->name);
}
@@ -446,7 +446,7 @@ void mips_generate() {
if (i->src1->reg != -1)
{
if (i->src1->kind == IMM)
- printf("\tli$%d, %d\n", reg_v0, i->src1->info.imm);
+ printf("\tli $%d, %d\n", reg_v0, i->src1->info.imm);
else
{
used_reg[i->src1->reg] = 1;