Commit f981680e authored by Michael Büsch's avatar Michael Büsch

asm/dasm: Let's simply comment out these lines that generate the ext jmp operands.

Nothing bad can happen from commenting out a few stupid lines of code, right?
Signed-off-by: Michael Büsch's avatarMichael Buesch <mb@bu3sch.de>
parent 1c0560b4
......@@ -470,6 +470,9 @@ static unsigned int merge_external_jmp_into_opcode(struct assembler_context *ctx
unsigned int opbase,
struct instruction *insn)
{
struct operand *fake;
struct registr *fake_reg;
struct operand *target;
struct operlist *ol;
unsigned int cond;
unsigned int opcode;
......@@ -480,9 +483,21 @@ static unsigned int merge_external_jmp_into_opcode(struct assembler_context *ctx
if (cond & ~0xFF)
asm_error(ctx, "External jump condition value too big (> 0xFF)");
opcode |= cond;
ol->oper[0] = ol->oper[1];
ol->oper[1] = ol->oper[2];
ol->oper[2] = ol->oper[3];
target = ol->oper[1];
memset(ol->oper, 0, sizeof(ol->oper));
/* This instruction has two fake r0 operands
* at position 0 and 1. */
fake = xmalloc(sizeof(struct operand));
fake_reg = xmalloc(sizeof(struct operand));
fake->type = OPER_REG;
fake->u.reg = fake_reg;
fake_reg->type = GPR;
fake_reg->nr = 0;
ol->oper[0] = fake;
ol->oper[1] = fake;
ol->oper[2] = target;
return opcode;
}
......
......@@ -1004,15 +1004,13 @@ extended_operlist : decnum COMMA decnum COMMA operand COMMA operand COMMA operan
}
;
external_jump_operands : imm COMMA operand COMMA operand COMMA labelref {
external_jump_operands : imm COMMA labelref {
struct operlist *ol = xmalloc(sizeof(struct operlist));
struct operand *cond = xmalloc(sizeof(struct operand));
cond->type = OPER_IMM;
cond->u.imm = $1;
ol->oper[0] = cond;
ol->oper[1] = $3;
ol->oper[2] = $5;
ol->oper[3] = $7;
$$ = ol;
}
;
......
......@@ -38,7 +38,6 @@ label:
addc r0,r1,r2 /* add with carry */
addc. r0,r1,r2 /* add with carry, set carry */
or 0x1000, r0, r0
testlabel:
/* SUB instructions */
sub r0,r1,r2 /* sub */
......@@ -88,8 +87,8 @@ testlabel:
jnzx 7,8,r0,r1,label /* Jump if nonzero after shift and mask */
/* jump on external conditions */
jext ECOND_MAC_ON,r0,r0,label /* jump if external condition is TRUE */
jnext ECOND_MAC_ON,r0,r0,label /* jump if external condition is FALSE */
jext ECOND_MAC_ON,label /* jump if external condition is TRUE */
jnext ECOND_MAC_ON,label /* jump if external condition is FALSE */
/* Subroutines */
call lr0,label /* store PC in lr0, call func at label */
......
......@@ -539,9 +539,13 @@ static void disasm_opcodes(struct disassembler_context *ctx)
snprintf(str, 5, "0x%02X", (bin->opcode & 0x0FF));
stmt->u.insn.operands[0] = str;
disasm_std_operand(stmt, 0, 1, 0);
disasm_std_operand(stmt, 1, 2, 0);
stmt->u.insn.is_labelref = 3;
/* We don't disassemble the first and second operand, as
* that always is a dummy r0 operand.
* disasm_std_operand(stmt, 0, 1, 0);
* disasm_std_operand(stmt, 1, 2, 0);
* stmt->u.insn.is_labelref = 3;
*/
stmt->u.insn.is_labelref = 1;
stmt->u.insn.labeladdr = stmt->u.insn.bin->operands[2];
break;
case 0x700:
......@@ -551,9 +555,13 @@ static void disasm_opcodes(struct disassembler_context *ctx)
snprintf(str, 5, "0x%02X", (bin->opcode & 0x0FF));
stmt->u.insn.operands[0] = str;
disasm_std_operand(stmt, 0, 1, 0);
disasm_std_operand(stmt, 1, 2, 0);
stmt->u.insn.is_labelref = 3;
/* We don't disassemble the first and second operand, as
* that always is a dummy r0 operand.
* disasm_std_operand(stmt, 0, 1, 0);
* disasm_std_operand(stmt, 1, 2, 0);
* stmt->u.insn.is_labelref = 3;
*/
stmt->u.insn.is_labelref = 1;
stmt->u.insn.labeladdr = stmt->u.insn.bin->operands[2];
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment