Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

a few more fixes.

  • Loading branch information...
1 parent 4a29348 commit 4b1c32867e6d83777c57f290330fdd05ef1c2d4b @kjs kjs committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/gencode.c
12 src/gencode.c
@@ -1052,7 +1052,7 @@ gencode_return(M1_compiler *comp, m1_expression *e) {
fprintf(OUT, "\tset_imm\tI%d, 0, %c0\n",, reg_chars[(int)retvalreg.type]);
/* index the current callframe, and set in its R0 register the value from the return expression. */
- INS (M0_SET_REF, "%d, %I, %R", CF,, retvalreg);
+ INS (M0_SET_REF, "%X, %I, %R", CF,, retvalreg);
fprintf(OUT, "\tset_ref\tCF, I%d, %c%d\n",, reg_chars[(int)retvalreg.type],;
free_reg(comp, indexreg);
@@ -1074,19 +1074,19 @@ gencode_return(M1_compiler *comp, m1_expression *e) {
chunk_index = alloc_reg(comp, VAL_INT);
retpc_reg = alloc_reg(comp, VAL_INT);
- INS (M0_SET_IMM, "%I, %d, %d",, 0, RETPC);
+ INS (M0_SET_IMM, "%I, %d, %X",, 0, RETPC);
fprintf(OUT, "\tset_imm I%d, 0, RETPC\n",;
- INS (M0_DEREF, "%I, %d, %I",, PCF,;
+ INS (M0_DEREF, "%I, %X, %I",, PCF,;
fprintf(OUT, "\tderef I%d, PCF, I%d\n",,;
- INS (M0_SET_IMM, "%I, %d, %d",, 0, CHUNK);
+ INS (M0_SET_IMM, "%I, %d, %X",, 0, CHUNK);
fprintf(OUT, "\tset_imm I%d, 0, CHUNK\n",;
- INS (M0_DEREF, "%I, %d, %I",, PCF,;
+ INS (M0_DEREF, "%I, %X, %I",, PCF,;
fprintf(OUT, "\tderef I%d, PCF, I%d\n",,;
- INS (M0_GOTO_CHUNK, "%I, %I, %d",,, 0);
+ INS (M0_GOTO_CHUNK, "%I, %I",,;
fprintf(OUT, "\tgoto_chunk I%d, I%d, x\n",,;
free_reg(comp, chunk_index);

0 comments on commit 4b1c328

Please sign in to comment.
Something went wrong with that request. Please try again.