Author Topic: Re: A2094: Operand Must be Relocatable?  (Read 677 times)

Luke

  • Regular Member
  • *
  • Posts: 1
Re: A2094: Operand Must be Relocatable?
« on: October 20, 2020, 05:33:07 PM »
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.
Code: [Select]
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
Code: [Select]
mLocate MACRO xval,yval
local L1
  cmp xval,0
  jl L1
  cmp yval,0
  jl L1
......
L1 :
ENDM