assembler: Fix label-immediate for v15
authorMichael Buesch <mb@bu3sch.de>
Sun, 11 Nov 2007 01:38:44 +0000 (02:38 +0100)
committerMichael Buesch <mb@bu3sch.de>
Sun, 11 Nov 2007 01:38:44 +0000 (02:38 +0100)
Signed-off-by: Michael Buesch <mb@bu3sch.de>
assembler/main.c

index 2c4749344305b606daa16e5452ce7e3f8a8d173f..701721d6f202b2db71b34bee1bdfe4355b98989b 100644 (file)
@@ -947,8 +947,16 @@ recalculate_addresses:
                                if (addr < 0)
                                        goto does_not_exist;
                                c->operands[i].u.operand = addr;
-                               if (i != 2) /* Is not a jump target */
-                                       c->operands[i].u.operand |= 0xC00; /* Make it be an immediate */
+                               if (i != 2) {
+                                       /* Is not a jump target.
+                                        * Make it be an immediate */
+                                       if (ctx->arch == 5)
+                                               c->operands[i].u.operand |= 0xC00;
+                                       else if (ctx->arch == 15)
+                                               c->operands[i].u.operand |= 0xC00 << 1;
+                                       else
+                                               asm_error(ctx, "Internal error: label res imm");
+                               }
                        }
                        break;
                case OUT_LABEL: