Reputation:
I'm aware that the following code:
MOV AL, 8 ;
will put the value 8 (decimal) into the lowest byte of EAX. However, if EAX already has the decimal value 1 stored therein, what happens, does it overwrite it?
So...
XOR EAX, EAX ;
INC EAX ;
MOV AL, 8 ;
Does EAX now just contain the decimal 8?
Upvotes: 0
Views: 606
Reputation: 2715
When EAX contains 1, the higher bytes contain 0 and AL 1 - that's the number representation in a 32 bits integer. When moving 8 in AL, EAX has still the three other bytes with 0 and the whole integer is 8 now.
Upvotes: 2
Reputation: 276
Yes it copies and replaces the destination operand with the source operand, the source operand is unchanged.
Upvotes: 0