I have the following simple program written in MASM for an i386 processor:
TITLE BLA
.MODEL SMALL
.386
.STACK
.DATA
.CODE
MAIN PROC FAR
.STARTUP
MOV EBX,0FFFFFFFFH; (1)
MOV EAX,0EEEEEEEEH; (2)
.EXIT
MAIN ENDP
END
I am confused about the behavior of the EBX register. After the (1) instruction the EBX is set to 1-s:
Executing the (2) instruction not only loads the value into EAX, but also zero outs the upper half of EBX:
Why does it actually happen?


According to Microsoft this is a known bug in Codeview. See Knowledge Base article Q87548:
According to this article the fix is to get a hold of Codeview 4.1 or greater.