News:

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

display a quad word in a messagebox

Started by mikky, June 01, 2010, 09:10:10 AM

Previous topic - Next topic

mikky

how do i display a quad word in a messagebox in decimal format?
the quadword is let's say 4075E00000000000 hex (which is 350 decimal)
how can i display 350 in a messagebox?
thank you

dedndave

hi Mikky
for starters, 4075E00000000000 hex is not 350 decimal   :bg
4075E00000000000h is 4644864881307156480 decimal
if you are looking at the bytes in reverse order, it is 0E07540h, which is 14710080 decimal

if you use the forum search tool, you will find many routines for converting qwords to ascii decimal strings
search for things like "64-bit to decimal", "qw2dec", or "qw2asc" and so on

at the link below, you will find a set of routines i have written that will convert any practical size integer to ascii decimal
in the LLKF9_1.zip attachment, there are 3 versions, signed, unsigned, and mode-selectable
http://www.masm32.com/board/index.php?topic=12363.msg94779#msg94779

frktons

Ling Long Kai Fang  :lol  :lol  :lol

:clap: :clap: :clap:
Mind is like a parachute. You know what to do in order to use it :-)

qWord

include masm32rt.inc
...
.data
    qw dq 350
.code
fn MessageBox,0,uqword$(qw),"xyz",0
FPU in a trice: SmplMath
It's that simple!

dedndave

playing with qWord's code a bit    :P
        include \masm32\include\masm32rt.inc

        .data
qw1     dq 350
qw2     dq 4075E00000000000h
qw3     dq 0E07540h

        .code
start:  fn      MessageBox,0,uqword$(qw1),"abc",0
        fn      MessageBox,0,uqword$(qw2),"qWord",0
        fn      MessageBox,0,uqword$(qw3),"xyz",0
        exit

        end     start