Author Topic: input and output 32 bit unsigned numbers to console  (Read 4427 times)

DanWebb314

  • Guest
input and output 32 bit unsigned numbers to console
« on: June 13, 2012, 09:01:54 AM »
What can I use to input and output 32 bit unsigned numbers to the console?

This works for Inputting signed numbers:
Code: [Select]
   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:
Code: [Select]
print ustr$(eax),13,10I 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

  • Guest
Re: input and output 32 bit unsigned numbers to console
« Reply #1 on: June 13, 2012, 10:26:15 AM »
I found

Code: [Select]
    mov edx, 0ffffffffH
    printf("%u\n", edx);

DanWebb314

  • Guest
Re: input and output 32 bit unsigned numbers to console
« Reply #2 on: June 13, 2012, 10:29:42 AM »
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

  • Member
  • ***
  • Posts: 426
Re: input and output 32 bit unsigned numbers to console
« Reply #3 on: June 13, 2012, 01:21:51 PM »
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.