Quote:Original post by NisseBosseLasse
When I look in my big-ol'-book-of-asm, I read out this:
*** Source Snippet Removed ***
Isn't movs a string function (like "rep movs")?
Yes, if I recall correctly, MOVS moves DS:SI to ES:DI. It shouldn't take an operand, and uses the direction flag, and CX stores the length of the memory to copy. He's trying to move an immediate into a register, which is what MOV is for, not MOVS. (Unless for some reason he's not using the X86 instruction set, but that's what it appears to be).
*Edit*
As for the sign extention, mov doesn't care. That's what the Sign Flag is for, and you're not going be manipulating that.
Take the following binary
10101011
What does this equal should you put it in an unsigned char vs a char? And if you MOV that value to a register, you're not going to chop off the significant bit.
Even more edit:
Alright, I dug out my ASM books. IBM PC Assembly Language and Programming by Peter Abel
MOVSX: Move with Sign Extend (80386+)
Copies an 8 or 16 bit source operand into a larger 16 or 32 bit destination operand. MOVSX fills the sign bit into the leftmost bits.