News:

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

Main Menu

Re: A2094: Operand Must be Relocatable?

Started by Luke, October 20, 2020, 05:33:07 PM

Previous topic - Next topic

Luke

Add an actual parameter, compare it with the formal parameter, it can be debugged, but according to my experience, the assembler will only compare the size of the two actual parameter addresses.

mLocate MACRO xval,yval,haha
  mov haha,0
IF xval lt haha
  exitm
ENDIF
IF yval lt haha
  exitm
ENDIF
......
ENDM

This can be debugged successfully, but it seems that the assembler only compares the size of the formal parameter memory address, not the size of the data pointed to by the memory
It's better to use cmp jl to jump to the end of the macro

mLocate MACRO xval,yval
local L1
  cmp xval,0
  jl L1
  cmp yval,0
  jl L1
......
L1 :
ENDM