Warn on usage of offset register 6. It is broken.
authorMichael Buesch <mb@bu3sch.de>
Sat, 14 Jun 2008 12:57:37 +0000 (14:57 +0200)
committerMichael Buesch <mb@bu3sch.de>
Sat, 14 Jun 2008 12:57:37 +0000 (14:57 +0200)
Signed-off-by: Michael Buesch <mb@bu3sch.de>
assembler/main.c

index 54252dabe95fe89b762524ced673fd3d4a80fd5c..51de8f7a2880717b7639a41cc36c0421ad4f56ee 100644 (file)
@@ -341,8 +341,14 @@ static unsigned int generate_mem_operand(struct assembler_context *ctx,
                        asm_warn(ctx, "INDIRECT memoffset 0x%X too long (> 6 bits)", off);
                        off &= 0x3F;
                }
-               if (reg & ~0x7)
+               if (reg > 6) {
+                       /* Assembler bug. The parser shouldn't pass this value. */
                        asm_error(ctx, "OFFR-nr too big");
+               }
+               if (reg == 6) {
+                       asm_warn(ctx, "Using offset register 6. This register is broken "
+                                "on certain devices. Use off0 to off5 only.");
+               }
                val |= off;
                val |= (reg << 6);
                break;