CPU Bug x86 shl behaviour sets overflow flag
I’ve been writing an x86 emulator, and to debug it, I ran it on a p4 computer in parallel to a debugger on a target program (a upx packed binary). Well.. I got to shl $8, %eax where eax = 0×00ffffff.
The intel documentation says that the overflow flag is only changed for 1 bit shifts. Suprisingly, in the 8 bit shift, the overflow flag became set. In a 7 bit or 9 bit shift of the same value, the overflow flag remains clear (or perhaps unchanged).
I’ve been googling to see other reports of this undocumented behaviour, but either its not out there, or more likely my googling skills are poor. I couldn’t find a reference.
Anyone got more information on this?
[Update: I have had reports from one person which said the behavior varied between setting and clearing the flag depending on the cpu.]

Recent comments
5 days 9 hours ago
5 days 20 hours ago
6 days 11 hours ago
6 days 18 hours ago
1 week 12 hours ago
1 week 12 hours ago
1 week 3 days ago
2 weeks 3 days ago
2 weeks 3 days ago
2 weeks 3 days ago