From: Michael Buesch Date: Sun, 18 May 2008 12:31:19 +0000 (+0200) Subject: b43-asm: Change JMP emulation from JE to JEXT X-Git-Tag: b43-fwcutter-013~54 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=7300a854837ee58f13af1e66acd96295b8811d05;p=b43-tools.git b43-asm: Change JMP emulation from JE to JEXT The external condition 0x7F is always true. This is what is supposed to be used for an unconditional jump. Signed-off-by: Michael Buesch --- diff --git a/assembler/main.c b/assembler/main.c index 3f207ba..3562a04 100644 --- a/assembler/main.c +++ b/assembler/main.c @@ -571,19 +571,20 @@ static void emulate_jmp_insn(struct assembler_context *ctx, { struct instruction em_insn; struct operlist em_ol; - struct operand em_op; - struct immediate em_imm; - - /* This is a pseudo-OP. We emulate it by JE */ - - em_insn.op = OP_JE; - em_imm.imm = 1; - em_op.type = OPER_IMM; - em_op.u.imm = &em_imm; - em_ol.oper[0] = &em_op; - em_ol.oper[1] = &em_op; - em_ol.oper[2] = insn->operands->oper[0]; + struct immediate em_condition; + struct operand em_cond_op; + + /* This is a pseudo-OP. We emulate it with + * JEXT 0x7F, target */ + + em_insn.op = OP_JEXT; + em_condition.imm = 0x7F; /* Ext cond: Always true */ + em_cond_op.type = OPER_IMM; + em_cond_op.u.imm = &em_condition; + em_ol.oper[0] = &em_cond_op; + em_ol.oper[1] = insn->operands->oper[0]; /* Target */ em_insn.operands = &em_ol; + assemble_instruction(ctx, &em_insn); /* recurse */ }