}});
}
0x3: decode OPCODE_24_21 {
- 0x9: BranchExchange::blx({{ LR = NPC; }});
+ 0x9: BranchExchange::blx({{ }}, Link);
}
}
}
0x5: decode OPCODE_24 {
// Branch (and Link) Instructions
0: Branch::b({{ }});
- 1: Branch::bl({{ LR = NPC; }});
+ 1: Branch::bl({{ }}, Link);
}
0x6: decode CPNUM {
0x1: decode PUNWL {
#Build Instruction Flags
#Use Link & Likely Flags to Add Link/Condition Code
inst_flags = ('IsDirectControl', )
+ linking = False
for x in opt_flags:
if x == 'Link':
+ linking = True
code += 'LR = NPC;\n'
else:
inst_flags += (x, )
icode += ' NPC = NPC + 4 + disp;\n'
icode += '} else {\n'
icode += ' NPC = NPC;\n'
+ if linking:
+ icode += ' LR = LR;\n'
icode += '};\n'
code = icode
#Build Instruction Flags
#Use Link & Likely Flags to Add Link/Condition Code
inst_flags = ('IsIndirectControl', )
+ linking = False
for x in opt_flags:
if x == 'Link':
+ linking = True
code += 'LR = NPC;\n'
else:
inst_flags += (x, )
icode += ' NPC = Rm & 0xfffffffe; // Masks off bottom bit\n'
icode += '} else {\n'
icode += ' NPC = NPC;\n'
+ if linking:
+ icode += ' LR = LR;\n'
icode += '};\n'
code = icode