Skip to content

Commit

Permalink
r12 and r13 encode like rsp and rbp, respectively
Browse files Browse the repository at this point in the history
so in counting bytes, we need to take that into account too
  • Loading branch information
bdw committed Sep 16, 2015
1 parent a31bc22 commit 348ee12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dasm_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ dasm_link (Dst_DECL, size_t * szp)
int type = (flag & 3);
int mode = ((flag >> 2) & 3);
/* fprintf(stderr, "VREG: mode = %d, type = %d, val=%d\n", mode, type, val); */
if (mode != 3 && type == 0 && val == 4) {
if (mode != 3 && type == 0 && (val&7) == 4) {
ofs++;
} else if (val == 5 && (type < 2) && *p == DASM_DISP && b[pos] == 0) {
} else if ((val&7) == 5 && (type < 2) && *p == DASM_DISP && b[pos] == 0) {
/* extra byte is necessary for rbp encoding, which is weird again */
ofs++;
}
Expand Down

0 comments on commit 348ee12

Please sign in to comment.