News:

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

Main Menu

ustr$ Problem ?

Started by dedndave, April 16, 2013, 03:18:04 PM

Previous topic - Next topic

dedndave

mov eax,-216152991
print ustr$(eax),13,10
inkey
exit


result.....
-216152991

i thought ustr$ displayed unsigned dwords

      ustr$ MACRO number
        LOCAL buffer
        .data?
          buffer TCHAR 40 dup (?)
          align 4
        .code
        IFNDEF __UNICODE__
          invoke crt__itoa,number,ADDR buffer,10
        ELSE
          invoke crt__itow,number,ADDR buffer,10
        ENDIF
        EXITM <eax>
      ENDM


oops
i think crt__ultoa/crt__ultow was what you wanted

can't believe i am just now finding this - lol

Magnum

Dave,

I did not see a question.

Are you talking to yourself  ? :biggrin:

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

dedndave

oops
i think crt__ultoa/crt__ultow was what you wanted


reporting an error
Hutch doesn't like it when we ask questions in this sub-forum - lol

hutch--

I have read it but have not had time to look at the problem.

dedndave

i am guessing it was a simple copy/paste mistake   :P

dedndave


jj2007


Gunther

Jochen,

what has lingo's old avatar to do with Dave?

Gunther
You have to know the facts before you can distort them.

dedndave

 :biggrin:

i try to maintain my masm32 library so it's compatible with other members
but, i may go off the grid with str$, ustr$, and uhex$
probably the stuff i use most out of m32lib

i would also like to upgrade them so they are unicode aware
i don't control the library, but i do have control of it on my disk   :biggrin:

qWord

yep, beside some bugs, there are some macros that are currently not TCHAR aware. Also I'm missing some important macros in this context. e.g. for declaring TCHAR data in arbitrary segment.

For hutch it might be more helpful if we supply him such an file with some comments what has been added and corrected...
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

Quote from: Gunther on May 13, 2013, 01:21:05 AM
what has lingo's old avatar to do with Dave?

Nothing. Just a warning to the little bird in the glass 8)

Gunther

Quote from: jj2007 on May 13, 2013, 03:42:35 AM
Nothing. Just a warning to the little bird in the glass 8)

Ah, I understand. Thank you for the advice.  ;)

Gunther
You have to know the facts before you can distort them.

dedndave

something else that is handy is, sometimes, i want to load the address into a register
        mov        edx,uhex$(eax)

it works for uhex$ because the macro is written to exit with the address
      uhex$ MACRO DDvalue   ;; unsigned DWORD to hex string
;
;
;
        EXITM <OFFSET rvstring>
      ENDM


but, it doesn't work for ustr$ or sstr$
      ustr$ MACRO number
;
;
;
        EXITM <eax>
      ENDM

qWord

Quote from: dedndave on May 13, 2013, 05:35:59 AMbut, it doesn't work for ustr$ or sstr$
why does it not work? EAX holds the address.
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

Quote from: dedndave on May 13, 2013, 05:35:59 AM
but, it doesn't work for ustr$ or sstr$
...
        EXITM <eax>

Works fine, Dave. What doesn't work is
      mov eax, str$(123)
because of
      EXITM <ADDR rvstring>

I recommend
      mov esi, Str$("This is %i times more powerful", 100)
;)