xor ebx,ebx mov bh ,0x04;how to change that "bh" to "ebx" ,and keep codes same meaning?
Assuming I understand you correctly, what you want is this:
mov ebx, 0x0400
(bh
is the upper 8 bits of bx
, which is itself the lower 16 bits of ebx
. So the value you need is the original value shifted left by 8, which we get by adding two hex 0 digits).
why people always use xor instead of mov XXX,0 ?
To put it simply: because it's shorter and faster. See What is the purpose of XORing a register with itself? and Does using xor reg, reg give advantage over mov reg, 0?