News:

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

Main Menu

input and output 32 bit unsigned numbers to console

Started by DanWebb314, June 13, 2012, 09:01:54 AM

Previous topic - Next topic

DanWebb314

What can I use to input and output 32 bit unsigned numbers to the console?

This works for Inputting signed numbers:
   mov str1, input("  Enter MAX : ")
   invoke atodw, str1

I have written code to replace it.  You can even use commas (,).

This works for outputting signed numbers:
print ustr$(eax),13,10
I tried to cheat and use the above line of code plus other code.  The result was humorous but not effective with all numbers.  Back to the drawing board.

Thank you
Dan

DanWebb314

I found

    mov edx, 0ffffffffH
    printf("%u\n", edx);

DanWebb314

I hit post to soon.
If I want output commas, as in "1,000", I will have to write my own code.

My this will help some one else.

KeepingRealBusy

Dan,

The code already exists. See my post for QWORD to ASCII (the second ,zip attachment I posted - the one that is ABI compliant). My solution is not the fastest, but it also inserted the comma separators (not Locale sensitive, but printable). These postings were just mainly just for conversions where presentation wasn't exercised, but mine at least had presentable output.

Dave.