Skip to content

Commit

Permalink
Added avr sbrs and dalvik return-wide
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed Sep 15, 2021
1 parent 1e86cb4 commit 136b4db
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libdec/arch/avr.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,17 @@
}
return Base.nop();
},
sbrs: function(instr, context, instructions) {
instr.setBadJump();
var next = instructions[instructions.indexOf(instr) + 1];
if (next) {
_compare('(' + instr.parsed.opd[0] + ' & (1 << ' + instr.parsed.opd[1] + '))', '1', context);
context.cond.instr = instr;
_conditional_next(next, context, instructions, 'EQ');
return Base.or(instr.parsed.opd[0], instr.parsed.opd[1]);
}
return Base.nop();
},
sei: function(instr) {
instr.setBadJump();
return Base.macro('ENABLE_INTERRUPTS', '#define ENABLE_INTERRUPTS __asm(sei)');
Expand Down Expand Up @@ -643,6 +654,7 @@
}
},
parse: function(asm) {
asm = asm.toLowerCase();
var ret = asm.replace(/\[|\]/g, ' ').replace(/,/g, ' ');
ret = ret.replace(/\{|\}/g, ' ').replace(/\s+/g, ' ');
ret = ret.trim().replace(/0x00/, '0').split(' ');
Expand Down
6 changes: 6 additions & 0 deletions libdec/arch/dalvik.js
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@
context.returntype = JavaObject;
return Base.return(Variable.local(p.opd[0], instr.bits, true));
},
'return-wide': function(instr, context) {
var p = instr.parsed;
instr.setBadJump();
context.returntype = JavaObject;
return Base.return(Variable.local(p.opd[0], instr.bits, true));
},
'return-void': function(instr, context) {
instr.setBadJump();
context.returntype = 'void';
Expand Down

0 comments on commit 136b4db

Please sign in to comment.