First post, by vladstamate
- Rank
- Oldbie
Hoping to get people to post quirkiness issues with x86 platform.
Here is one from me. This instruction
db 036h
db 0f3h
div word[2]
is actually legal (the processor ignores the REPZ) and it looks something like this:
REPZ
DIV WORD[SS:2]
Now the weird part is if it causes an overflow (because of a divide by 0 let's say) the CS:IP that is pushed on the stack is that of the REPZ instruction (to indicate to Interrupt 0 what is the faulty instruction) because to the x86 processor prefixes like REPZ and SS: are part of the instruction and they do not stand by themselves.
I discovered this because my emulator was not pushing the correct CS:IP in the stack in this extreme case.
Does anyone have other strange discoveries?
YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/