From: Michael Buesch Date: Fri, 25 Jan 2008 23:01:17 +0000 (+0100) Subject: b43-asm: Pass external conditions as immediates X-Git-Tag: b43-fwcutter-013~70 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=05e57ce6fbe1ebf597ab5a7e4d10e6f275f47e44;p=b43-tools.git b43-asm: Pass external conditions as immediates This allows using any hex and decimal numbers and even complex immediates for external conditions. Signed-off-by: Michael Buesch --- diff --git a/assembler/main.c b/assembler/main.c index e90bac8..a2ace1d 100644 --- a/assembler/main.c +++ b/assembler/main.c @@ -469,7 +469,7 @@ static unsigned int merge_external_jmp_into_opcode(struct assembler_context *ctx 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; diff --git a/assembler/parser.y b/assembler/parser.y index 65bd39d..e55c2b7 100644 --- a/assembler/parser.y +++ b/assembler/parser.y @@ -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)); - 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; diff --git a/assembler/test.asm b/assembler/test.asm index 05efe34..bfd3a08 100644 --- a/assembler/test.asm +++ b/assembler/test.asm @@ -26,7 +26,7 @@ #define PSM_BRC spr848 -#define ECOND_MAC_ON 0x24 +#define ECOND_MAC_ON (0x20 | 4) .text