Permalink
Browse files

r12 and r13 encode like rsp and rbp, respectively

so in counting bytes, we need to take that into account too
  • Loading branch information...
bdw committed Sep 16, 2015
1 parent a31bc22 commit 348ee123640393df01489173793c2f80dbda483e
Showing with 2 additions and 2 deletions.
  1. +2 −2 dasm_x86.h
View
@@ -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++;
}

0 comments on commit 348ee12

Please sign in to comment.