Okay When I was making macros I couldn’t get the loop to work proper if I did.
move macro x,y
mov esi, 0
mov ecx, SIZEOF x
a:
mov al, x[esi]
mov y[esi], al
inc esi
LOOP a
endm
But when I add a parameter and change the label it works fine
move macro x,y,a
mov esi, 0
mov ecx, SIZEOF x
a:
mov al, x[esi]
mov y[esi], al
inc esi
LOOP a
endm
When I call the macro I do something along the line of
move a,b,L1
move c,d,L2
But I’m not sure why its working..
If you don’t parameterize the label, you’ll put the same label in every instance where you use the macro. You can’t have the same label name at more than one place. Your solution looks reasonable, but your assembler might also support local labels (
@@:in some, numbered like1:in others), which would also solve your problem and in an easier-to-use way.