aboutsummaryrefslogtreecommitdiff
path: root/mips.c
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-18 14:59:36 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-18 14:59:36 +0800
commit8f734c1befb10321577ba715edb0f17deec5f9db (patch)
tree4a76c28fa2a0ceaac69c64cd4d747e2997bf75ac /mips.c
parent1cf0c5b7c23987a05790c50a8c7cb8ebe5eba363 (diff)
...
Diffstat (limited to 'mips.c')
-rw-r--r--mips.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mips.c b/mips.c
index a34f463..da6ab05 100644
--- a/mips.c
+++ b/mips.c
@@ -156,7 +156,9 @@ int mips_to_reg(COpr_t opr, int reg0) {
}
else if (opr->kind == IMMF)
{
- printf("\tla $%d, _func_%s\n", reg0, opr->info.str);
+ printf("\tla $%d, %s%s\n", reg0,
+ strcmp(opr->info.str, "main") ? "_func_" : "",
+ opr->info.str);
return reg0;
}
if (opr->reg != -1)