The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: mikky on June 01, 2010, 09:10:10 AM

Title: display a quad word in a messagebox
Post by: mikky on June 01, 2010, 09:10:10 AM
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
Title: Re: display a quad word in a messagebox
Post by: dedndave on June 01, 2010, 10:31:30 AM
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
Title: Re: display a quad word in a messagebox
Post by: frktons on June 01, 2010, 11:19:11 AM
Ling Long Kai Fang  :lol  :lol  :lol

:clap: :clap: :clap:
Title: Re: display a quad word in a messagebox
Post by: qWord on June 01, 2010, 12:32:26 PM
include masm32rt.inc
...
.data
    qw dq 350
.code
fn MessageBox,0,uqword$(qw),"xyz",0
Title: Re: display a quad word in a messagebox
Post by: dedndave on June 01, 2010, 01:26:02 PM
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