News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

convert ax to eax

Started by ragdog, April 01, 2008, 04:05:28 PM

Previous topic - Next topic

ragdog

hi all

i have a little question to convert a ax register to eax register

is this correct??


ThreadProc PROC USES ecx Param:DWORD

Restart:
invoke GetLocalTime,offset time

ch_hour:
invoke GetLocalTime,offset time
;mov ax,time.wHour
  movzx eax, time.wHour
mov Hours, eax

cmp eax, buffer
je ch_minute
jne Restart

ch_minute:
invoke MessageBox,Param,0,0,MB_OK
;mov ax,time.wMinute
   movzx eax, time.wMinute
mov minute, eax
cmp eax,offset buffer1
je reset
jne Restart
reset:

invoke MessageBox,Param,0,0,MB_OK
invoke TerminateThread,hThread,0
  ret
ThreadProc ENDP



greets
ragdog

u

yes, movzx eax,reg16/mem16 is correct
so is movzx eax,reg8/mem8, too

the signed-extend version of the instruction is movsx
Please use a smaller graphic in your signature.

ragdog

thanks  :U

can your help this works not from getdlgitemtext

i will not use getdlgiteminit.



.data?
buffer dd ?
Hours dd ?

.code
invoke GetDlgItemText,hWnd,1001,addr buffer,3


ThreadProc PROC USES ecx Param:DWORD

Restart:

invoke GetLocalTime,offset time
  movzx eax, time.wHour
mov Hours, eax

cmp eax, offset buffer
je reset
jne Restart
reset:

invoke MessageBox,Param,0,0,MB_OK
invoke TerminateThread,hThread,0
  ret
ThreadProc ENDP