News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

character values?

Started by jannes braet, June 19, 2012, 01:49:13 AM

Previous topic - Next topic

dedndave

it could probably be MOVZX, in the case of WM_LBUTTONDOWN type messages
as i recall, they can be negative for WM_MOUSEMOVE, though

jannes braet

word ptr lParam
what does it mean i have never seen something like this. probably i am just following a bad tutorial. can someone tell me a nice tutorial to learn asm?

dedndave

the MOVSX and MOVZX instructions sign-extend or zero-extend a word or byte into a dword register
in the case of wParam and lParam, these parameters are defined as dword's (or dword size, at least)
so - if you want a word from one of those parms, you have to tell the assembler to over-ride the size
        movsx     eax,word ptr wParam      ;sign-extends the low word of wParam into EAX
        movzx     eax,word ptr wParam+2    ;zero-extends the high word of wParam into EAX

otherwise, you will get an error like "operand sizes must match" or "invalid operand"

if the parameter or variable is defined as a word or byte, then you do not need the "ptr" operator
the assembler knows which form of the instruction to use