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?