I wasn't trying to detect the presence of an 8086/80186, but I discovered by accident that they could be detected in that way.XCHG wrote:How did it crash? Didn't you just PUSH SP into the stack and POP it into a 16-bit register? How could it crash?(
Detecting 186 CPUs
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
No you can't, since if it's a 8086, it'll hang (there's no exception handling in the 8086).Cemre wrote:so by your detection method, if you conclude that cpu is not 286, you might simply try using those new instructions and check for an error by using CPU unknown-opcode interrupt handler to determine if it is a 8086 or 80186.
An additional issue with the 80186 is that it is still being made, in different flavours, for the embedded industry. I don't think it's very useful detecting it though, if you're not planning on going embedded.
JAL