The MASM Forum

General => The Workshop => Topic started by: sinsi on March 20, 2018, 09:40:07 PM

Title: Macro on the same line as a label
Post by: sinsi on March 20, 2018, 09:40:07 PM
Just spent a bit of time tracking down a problem (masm bug?)
start:  mov esi,rv(GetModuleHandle,0) is assembled as        mov esi.eaxmissing the call to GetModuleHandle altogether.
Without the start: label it assembles correctly.

Is it a bug or am I missing something?
Title: Re: Macro on the same line as a label
Post by: jj2007 on March 20, 2018, 10:52:24 PM
It's by design :P

This concerns only macros that return something, i.e. functions. The same problem occurs e.g. with
.if eax
.elseif rv(GetModuleHandle,0)!=400000h
.else
.endif


Note that UAsm behaves exactly like MASM. AsmC, in contrast, produces a different result and is thus not MASM-compatible.
Title: Re: Macro on the same line as a label
Post by: sinsi on March 21, 2018, 05:54:02 PM
Jeez, thought I would start using some macros and then this happens. Is it documented anywhere?

QuoteNote that UAsm behaves exactly like MASM. AsmC, in contrast, produces a different correct result and is thus not MASM-compatible.
Title: Re: Macro on the same line as a label
Post by: jj2007 on March 21, 2018, 09:07:26 PM
Correct? It's "by design", meaning that Micros??t will not hold your hot little hand etc etc - you know the story ;)