Thanks for your suggestion. I had thought of this long before I investigated many other possibilities. It is a question of personal preference
and I prefer to leave the 32-bit code base as is and replace the 64-bit variations with macros, leaving the code readable as 32-bit code.
The biggest problem I also found with a method like the one you suggested is that it plays havoc with editor syntax highlighting; all register
names end up being indistinguishable from local/global variable names. This readability aspect was a particular annoyance.
As it happens I had a workaround a while back which I am using now. It's not great but the volume of code changes were small so reducing
the possibility of new bugs being introduced through large code change volume.
... which sort of makes sense except for the fact that <eax> should already be literal text and not force any sort of macro expansion without % .. the ! shouldn't even be required as it's the same as < >
When MASM does any kind of evaluation of a command or a function parameter list, all open references to text are automatically expanded
as macros before anything else. This is a core "feature" of MASM but it is MASM and there are many people including myself who have had
no choice but to rely on this behaviour over the years to get a particular task done.
It has some particularly tedious ramifications. For example, this:
MyMacro MACRO
LOCAL temp
temp = 3
%echo the value of temp is @CatStr(%temp)
ENDM
MyMacro
produces:
the value of ??010F is 3
It appears that you can protect against macro expansion by placing the word to be protected in single or double quotes. E.g.
MyMacro MACRO
LOCAL temp
temp = 3
%echo the value of 'temp' is @CatStr(%temp)
ENDM
MyMacro
produces:
the value of 'temp' is 3
However, this is useless when passing text variables around as the name of the variable ends up in quotes, not the value of the variable!
This is the problem when trying to maintain compatibility with a tool that itself has more bugs and inconsistencies than you care to mention.
It's a hard pill to swallow, but being compatible is not about having the most elegant or fastest implementation; it is about being compatible;
a one-for-one likeness whether one agrees with the correctness of the original implementation or not.
I do thank you, though, for acknowledging the fact that there is a difference in behaviour and for being kind enough to suggest a workaround.
Cheers.