Skip to content

Commit 9a67cb9

Browse files
authored
Fix 16-bit disp16 precedence bug in getecommon16o (#1066)
In C, == binds tighter than &, so 'm&7==6' parsed as 'm&(7==6)' = 'm&0' = always false. Disp16 was never fetched for mod==00,rm==110 16-bit addressing (GET_EW16_OFFS), leaving a wrong effective address and unadvanced EIP. Parenthesize as '(m&7)==6' to match getecommon16.
1 parent 39d3ed2 commit 9a67cb9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/emu/modrm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
case 7: base = R_BX; break; \
109109
} \
110110
switch((m>>6)&3) { \
111-
case 0: if(m&7==6) base = F16S; break; \
111+
case 0: if((m&7)==6) base = F16S; break; \
112112
case 1: base += F8S; break; \
113113
case 2: base += F16S; break; \
114114
} \

0 commit comments

Comments
 (0)