I try to write my own clear which clears a number of locations starting with an address by using a macro. i.e. clear $1200 5 it clears content of from $1200 to $1205. However, I can't do like in macro
In macro try
How can it be fixed?
Code:
;The code section works well, The issue I can't integrate it in macro
LDX $1200
CLR 1, X+
Code:
clear MACRO
LDX \1
LDAB #\2
\@SONERLOOP
CLR 1, x+ ; it will clear current address then increment adress one more not content (first issue incrementing adress)
DECB #\2 ; I have also tried DEC to decrement counter but not work (second issue decrementing counter)
BNE \@SONERLOOP
ENDM