News:

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

Main Menu

Macro on the same line as a label

Started by sinsi, March 20, 2018, 09:40:07 PM

Previous topic - Next topic

sinsi

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?
Tá fuinneoga a haon déag níos fearr :biggrin:

jj2007

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.

sinsi

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.
Tá fuinneoga a haon déag níos fearr :biggrin:

jj2007

Correct? It's "by design", meaning that Micros??t will not hold your hot little hand etc etc - you know the story ;)