Thanks ZhangJennie ....To simplify everything ..... I tried to create new project ... a small example of testing in "relocable assembler":
main.asm:
; Include derivative-specific definitions
INCLUDE 'derivative.inc'
; export symbols
XDEF Entry, _Startup, main
XREF __SEG_END_SSTACK ; symbol defined by the linker for the end of the stack
MyBRA macro
if (\1<(*+256))
BRA \1
else
LBRA \1
endif
endm
; variable/data section
MY_EXTENDED_RAM: SECTION
Counter ds.w 1
; code section
MyCode: SECTION
main:
_Startup:
Entry:
LDS #__SEG_END_SSTACK ; initialize the stack pointer
EndlessLoop:
LDX #1 ; X contains counter
CouterLoop:
STX Counter ; update global.
LDX Counter
INX
CPX #24 ; larger values cause overflow.
BNE CouterLoop
MyBRA EndlessLoop ; restart. ;<<<<<<<<<<<<<<<< My macro <<<<<<<<
Unfortunately now it gives me a different mistake
A2401:Complex relocable expression not supported
Macro Expression "if(EndlessLoop <* + 256)"