Skip to content

Commit

Permalink
Add pic16 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed May 15, 2024
1 parent a3811c5 commit 7d6f23b
Show file tree
Hide file tree
Showing 4 changed files with 506 additions and 97 deletions.
3 changes: 2 additions & 1 deletion librz/arch/isa/pic/pic_il.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// SPDX-License-Identifier: LGPL-3.0-only

static inline RzILOpPure *pure_slice(RzILOpPure *x, ut8 l, ut8 r) {
return LOGAND(SHIFTR0(x, U16(l)), U16(~(-1 << (r - l + 1))));
rz_return_val_if_fail(l < r, NULL);
return UNSIGNED(r - l, SHIFTR0(x, U16(l)));
}

#define SEXT(B, x, b) ((st##B)(x << (B - b)) >> (B - b))
Expand Down
23 changes: 12 additions & 11 deletions librz/arch/isa/pic/pic_midrange_analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,28 @@ char *pic_midrange_get_reg_profile(RzAnalysis *a) {
"=A1 portb\n"
"gpr indf0 .8 0 0\n"
"gpr indf1 .8 1 0\n"
"gpr pcl .8 2 0\n"
"gpr pcl .8 2 0\n"
"gpr status .8 3 0\n"
"flg c .1 3.0 0\n"
"flg dc .1 3.1 0\n"
"flg z .1 3.2 0\n"
"flg pd .1 3.3 0\n"
"flg to .1 3.4 0\n"
"flg c .1 3.0 0\n"
"flg dc .1 3.1 0\n"
"flg z .1 3.2 0\n"
"flg pd .1 3.3 0\n"
"flg to .1 3.4 0\n"
"gpr fsr0l .8 4 0\n"
"gpr fsr0h .8 5 0\n"
"gpr fsr1l .8 6 0\n"
"gpr fsr1h .8 7 0\n"
"gpr bsr .8 8 0\n"
"gpr bsr .8 8 0\n"
"gpr wreg .8 9 0\n"
"gpr pclath .8 10 0\n"
"gpr intcon .8 11 0\n"
"gpr pc .16 12 0\n"
"gpr pc .16 12 0\n"
"gpr stkptr .8 14 0\n"
"gpr _sram .32 15 0\n"
"gpr _stack .32 19 0\n"
"gpr tos .8 21 0\n"
"gpr tris .8 22 0\n"
"gpr _bank .8 23 0\n";
"gpr tosl .8 24 0\n"
"gpr tosh .8 25 0\n"
"gpr tris .8 26 0\n"
"gpr _bank .8 27 0\n";
return strdup(p);
}
Loading

0 comments on commit 7d6f23b

Please sign in to comment.