News:

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

Main Menu

Double quotes in masm64

Started by BugCatcher, December 29, 2024, 03:25:32 AM

Previous topic - Next topic

HSE

Hi BugCatcher!

Quote from: BugCatcher on December 31, 2024, 12:47:46 AMinvoke TextOut hDc,100,100,"This is a string",16

For only that use fn macro:
fn TextOut hDc,100,100,"This is a string",16
If you are using Ml64, previously you have declare somewhere:@WordSize equ 8
Regards, HSE

Equations in Assembly: SmplMath

BugCatcher

Turns out the code to get the string pointer is in the 64bit TextOut function itself (gdi32). It loads the string length first. So I can't cheat to get the string length before the function starts. So y'all right, for large strings the best way is the old way to create a buffer and get lengthof from the buffer.

zedd151

Quote from: BugCatcher on December 31, 2024, 02:59:08 AMTurns out the code to get the string pointer is in the 64bit TextOut function itself (gdi32).

I am pretty sure (> 90%) that it's the 'invoke' macro (in masm64 SDK) that does that, (supplying the pointer to the string to TextOut, that is).
But yes I noticed that as well, when I was trying to find a 'work around' that does what you wanted to do.

Tweaking the 'invoke' macro (in the masm64 sdk), it might be possible to get the string length there, and return that in a register (rax maybe). That will take some work to get working without screwing up any other functionality of that macro though. Kind of beyond my level of knowledge unfortunately, and may not even be possible if rax is needed elsewhere in the macro. I might take a look at that proposal, but I will need plenty of 'spare time', as it may not be an easy (for me) task.
:cool: