aboutsummaryrefslogtreecommitdiff
path: root/mips.c
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-06 13:24:47 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-06 13:24:47 +0800
commitbc0b78bde2a8d46a0fb61b32b3fc591b1ae16cd4 (patch)
treeb936da2fd68e6d3d21b30447a283ab3c6b98fedc /mips.c
parent696f1e9fb8f3c4004f22d8adaddec5d709c90e7b (diff)
...
Diffstat (limited to 'mips.c')
-rw-r--r--mips.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/mips.c b/mips.c
index e7719f8..6dce7f5 100644
--- a/mips.c
+++ b/mips.c
@@ -519,6 +519,14 @@ void mips_generate(void) {
int rd = i->dest->reg;
int j;
memset(used_reg, 0, sizeof used_reg);
+ /* NOTE: bad hack */
+ if (i->src1->kind == IMMF && !strcmp(i->src1->info.str, "__print_string"))
+ {
+ printf( "\tlw $a0, 0($sp)\n"
+ "\tli $2, 4\n"
+ "\tsyscall\n");
+ break;
+ }
if (rt->type == CSTRUCT || rt->type == CUNION)
used_reg[30] = 1; /* save $fp */
for (p = defs; p; p = p->next)