b43-asm: Pass external conditions as immediates
authorMichael Buesch <mb@bu3sch.de>
Fri, 25 Jan 2008 23:01:17 +0000 (00:01 +0100)
committerMichael Buesch <mb@bu3sch.de>
Fri, 25 Jan 2008 23:01:17 +0000 (00:01 +0100)
This allows using any hex and decimal numbers and even complex immediates for external conditions.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
assembler/main.c
assembler/parser.y
assembler/test.asm

index e90bac8118383f458426be1a8a9ed096220b97e4..a2ace1df993217396e295579569780521cb52a3c 100644 (file)
@@ -469,7 +469,7 @@ static unsigned int merge_external_jmp_into_opcode(struct assembler_context *ctx
 
        ol = insn->operands;
        opcode = opbase;
 
        ol = insn->operands;
        opcode = opbase;
-       cond = ol->oper[0]->u.raw;
+       cond = ol->oper[0]->u.imm->imm;
        if (cond & ~0xFF)
                asm_error(ctx, "External jump condition value too big (> 0xFF)");
        opcode |= cond;
        if (cond & ~0xFF)
                asm_error(ctx, "External jump condition value too big (> 0xFF)");
        opcode |= cond;
index 65bd39dbe1796bbda4c44bf2db9fb0c28236124d..e55c2b7734617c88d26d2c6e92bc44972d42f1f1 100644 (file)
@@ -997,11 +997,11 @@ extended_operlist : decnum COMMA decnum COMMA operand COMMA operand COMMA operan
                  }
                ;
 
                  }
                ;
 
-external_jump_operands : hexnum COMMA operand COMMA operand COMMA labelref {
+external_jump_operands : imm COMMA operand COMMA operand COMMA labelref {
                        struct operlist *ol = xmalloc(sizeof(struct operlist));
                        struct operand *cond = xmalloc(sizeof(struct operand));
                        struct operlist *ol = xmalloc(sizeof(struct operlist));
                        struct operand *cond = xmalloc(sizeof(struct operand));
-                       cond->type = OPER_RAW;
-                       cond->u.raw = (unsigned long)$1;
+                       cond->type = OPER_IMM;
+                       cond->u.imm = $1;
                        ol->oper[0] = cond;
                        ol->oper[1] = $3;
                        ol->oper[2] = $5;
                        ol->oper[0] = cond;
                        ol->oper[1] = $3;
                        ol->oper[2] = $5;
index 05efe34cc415e93eb2bbd178ce35c3b7c1838641..bfd3a08a9e8f7a4406c62619b15f9d393e775d23 100644 (file)
@@ -26,7 +26,7 @@
 
 #define        PSM_BRC         spr848
 
 
 #define        PSM_BRC         spr848
 
-#define ECOND_MAC_ON   0x24
+#define ECOND_MAC_ON   (0x20 | 4)
 
 
 .text
 
 
 .text