News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

wsprintf(X64)

Started by six_L, March 18, 2021, 07:39:35 PM

Previous topic - Next topic

six_L

Hi,all
the high dword has been disappeared.
Say you, Say me, Say the codes together for ever.

jj2007

That's unfair - values should never disappear like that ;-)

TimoVJL

wsprintf don't support long long in 32-bit form.
In x64 %IX is for long long / QWORD
QuoteIx, IX
    64-bit unsigned hexadecimal integer in lowercase or uppercase on 64-bit platforms, 32-bit unsigned hexadecimal integer in lowercase or uppercase on 32-bit platforms.
Try StringCbPrintf with %llX
May the source be with you

jj2007

Quote from: TimoVJL on March 18, 2021, 08:12:08 PM
wsprintf don't support long long in 32-bit form.

Under the hood, the JBasic version of Str$() is crt_sprintf

six_L

Hi jj2007,TimoVJL
Thanks you for the answer.
QuoteIn x64 %IX is for long long / QWORD
:thumbsup:
Say you, Say me, Say the codes together for ever.

jj2007

More precisely:
  mov rax, 0FFFFFFFFFFFFFF12h
  mov dqData, rax
  PrintLine Str$("The value is %llx", dqData)
  PrintLine Str$("The value is %llX", dqData)
  PrintLine Str$("The value is %lX", dqData)

The value is ffffffffffffff12
The value is FFFFFFFFFFFFFF12
The value is FFFFFF12

TouEnMasm


Not recommended by microsot wsprintf.
Quote
Note  Do not use. Consider using one of the following functions instead: StringCbPrintf, StringCbPrintfEx, StringCchPrintf, or StringCchPrintfEx. See Security Considerations.
personnaly i use sprintf who works.

Fa is a musical note to play with CL

TimoVJL

Quote from: TouEnMasm on March 19, 2021, 12:21:27 AM
personnaly i use sprintf who works.
Windows OS sprintf is limited, probably you mean same function in msvcrt.dll or in Visual C++ runtime.
May the source be with you