Well, any help is appreciated, so thank you anyway, but this is not what I'm asking.
My intent is not to use Arraywrite because consumes a lot of space.
With this sample code that now works I transfer a ROM string to an array, but I want also the destination array to be a parameter passed to the macro.
So with a single macro I could transfer to inbuff or testbuff or any buffer Is declared.
Code:
Define USE_LFSR 1
DEFINE OSC 8
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 4
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_MODE 0
OSCCON =%01110000
inbuff VAR BYTE[100]
x VAR BYTE
y VAR BYTE
LS0 VAR WORD
LS1 VAR WORD
goto Lp1
ASM
LoadInbuff macro Text
CHK?RP _LS0
movlw low Text ; here I load in LS0 the ROM address of the source string
movwf _LS0
movlw High Text
movwf _LS0 + 1
L?CALL _Lstr
endm
ENDASM
Lstr:
y=0
do
peekcode LS0, x
inbuff(y)=x
if x=0 then exit
y=y+1
LS0=LS0+2
loop
return
Lp1:
@ LoadInbuff _ROM_CfgString
debug str inbuff\100,13,10
goto lp1
ROM_CfgString: PokeCode "This a test string",0
Bookmarks