Skip to content

Conversation

@snowkat
Copy link
Contributor

@snowkat snowkat commented Dec 15, 2025

Summary

This fixes an issue in the FE opcode (referred in Intel docs as "INC/DEC Grp 4") where any ModR/M Opcode bits other than 000 act as DEC r/m8. All other values than 000 or 001 are invalid and should throw #UD on processors that support that.

This also shows on actual hardware: similarly-configured Cyrix 5x86 and 486DX systems throw a #UD exception, but not in 86Box. (Thanks to @goshhhy for testing this!)

Checklist

References

Intel® 64 and IA-32 Architectures Software Developer's Manual Combined Volumes 2A, 2B, 2C, and 2D, Appendix A.4.2.

Tested using the boot sector program here: https://datagirl.xyz/pub/grp4test.bin (source code: https://datagirl.xyz/pub/grp4test.asm)

Only FE /0 (INC r/m8) and FE /1 (DEC r/m8) are valid instructions in
INC/DEC Grp 4. All other ModR/M opcode bits are reserved and should
throw #UD.
@OBattler OBattler merged commit 97cd239 into 86Box:master Dec 15, 2025
35 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants