Peet19
Member
Hello!
I want to pass the value of a register to a macro, but I don't know.
How can this be solved?
I decreased the value of the XY register by 10 in each cycle.
If I enter the name of the register as a parameter of the macro, it does not pass the value.
I already tried changing the value of XY to a variable and passing it when calling the macro, but that's no good either.
What could be the problem?
Here is the macro:
Mist:
BEIR MACRO A
MOVLW A
MOVWF ZZ
ENDM
But if I enter a number when calling the macro it works.
I don't understand the problem.
Thank you in advance for your help!
I want to pass the value of a register to a macro, but I don't know.
How can this be solved?
Code:
MOVLW 100
MOVWF XY
LOOP
MOVLW 10
SUBWF XY
VAR1 SET XY
BEIR VAR1
GOTO LOOP
I decreased the value of the XY register by 10 in each cycle.
If I enter the name of the register as a parameter of the macro, it does not pass the value.
I already tried changing the value of XY to a variable and passing it when calling the macro, but that's no good either.
What could be the problem?
Here is the macro:
Mist:
BEIR MACRO A
MOVLW A
MOVWF ZZ
ENDM
But if I enter a number when calling the macro it works.
I don't understand the problem.
Thank you in advance for your help!
Last edited: