In the case of the macro, you cannot use any label inside because the name will be duplicated. For instance, something stupid like:
LOCO: MACRO #a, #b
jpnz .nothing
ld a, #a
ld a, #b
.nothing:
xor a
ENDMACRO
It will complain .nothing already exists when using the macro twice. I assume that this is not the desired way of working in case we have a loop inside the macro.
My proposal would be to modify how the local labels work. I have seen in some assemblers that they refer to local labels using the previous global, for example: A global named MAN and then a local defined as .GLER. Internally the local label would be MAN.GLER.
This way we would be able to repeat local label names. I have to get more information about other assemblers to check how they behave.
In the case of the macro, you cannot use any label inside because the name will be duplicated. For instance, something stupid like:
It will complain
.nothingalready exists when using the macro twice. I assume that this is not the desired way of working in case we have a loop inside the macro.My proposal would be to modify how the local labels work. I have seen in some assemblers that they refer to local labels using the previous global, for example: A global named
MANand then a local defined as.GLER. Internally the local label would beMAN.GLER.This way we would be able to repeat local label names. I have to get more information about other assemblers to check how they behave.