News:

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

help convert time

Started by ecube, March 25, 2010, 09:08:33 PM

Previous topic - Next topic

ecube

thanks qword

qWord

seems like an byte swap:
xTime db "0123" ;=> db 30h,31h,32h,33h
the algo does:
30h SHL 24 + 31h SHL 16 + 32h SHL 8 + 33h = 30313233h
stored in mem: db 33h,32h,31h,30h


bswap is your friend:
mov eax,DWORD ptr xTime
bswap eax
;eax = result


FPU in a trice: SmplMath
It's that simple!

qWord

how can an 4 byte numeric string exceed 9999 (or if hex decimal 0xffff) ?

EDIT: didn't see your example  :red - this also works! even with: FF FF FF FF
FPU in a trice: SmplMath
It's that simple!

qWord

bswap is correct for converting an DWORD from Network byte order to Little-Endian.
Did you ever heard of differenc between signed and unsigned int  :U
FPU in a trice: SmplMath
It's that simple!