assembly - Machine Code (.asm & movsx) -


i'm looking @ these problems in book , trying figure out mean exactly.

.data  1 word 8002h  2 word 4321h  .code  mov   edx,21348041h  movsx edx,one  movsx edx,two 

^ edx starts out value of 21348041 hex right? because of movsx edx adds fffff8002 hex? edx adds fffff4321 hex? confusing, assuming book explaining movsx converts signed?

the first 1 correct, not "adds". mov* moves data.

because request data treated signed, , you're using less 1 word of data (assuming 32 bit architecture), actual data moved padded left 1 if source number has left-most bit set (ie negative).

note addendum @ end. because 0x4321 isn't negative (less 0x8000), if treat signed it's still positive. move literal value give it.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -