2003-07-24 11:05 PM
2003-07-17 01:59 AM
...
segment 'rom' .data DC.W Hello .Hello DC.B ''Hye'',0 ... .main ld A,([data.w],X) Error 54: Can't match Addressing mode What is wrong, please ?[ This message was edited by: Padb on 17-07-2003 14:32 ]2003-07-17 05:51 AM
Hi
use LD A, (data,X) The [xx.w] version refers to a 16 bit address location in zero space memory. The programming manual available from the download section of this site covers this very well. ensure there is no space between the , and the X on all instructions regards, Simon2003-07-17 05:56 AM
Hi,
I just read it again. sorry...... declare it in RAM: segment 'ram0' .data ds.w Hello segment 'rom' .Hello DC.B ''Hye'',0 ... .main ld A,([data.w],X) You can then change the ram locations to point to different arrays/strings and scan through the string using X Simon2003-07-18 02:17 AM
''constant.asm''
segment 'ram0' WORDS .data DS.W HELLO ;Pointeur sur Hello segment 'rom' .HELLO DC.B ''Hye'',0 ''Constant.INC'' EXTERN data.w EXTERN HELLO.w ''Myprogram.ASM'' #INCLUDE ''ST72F324.inc'' ; ST72F324 registers and memory mapping file #INCLUDE ''constant.inc'' ; Définition des constantes ld A,([data.w],X) constant.asm(50): as1 : Fatal 97: DS.n length is extern/relative derived, must be absolute '.data DS.W HELLO Please, what's the matter ???2003-07-18 03:05 AM
Hi there,
You are not setting up your pointer, try this segment 'ram0' .data DS.W 1 WORDS segment 'rom' .HELLO DC.B ''hello'',0 ld A, #HELLO.h ld data, A ld A, #HELLO.l ld {data+1}, A ; setup pointer to our data clr X ld A, ([data.w],X) ; A holds first char of data do you need tio use a pointer you could do: clr X ld A, (HELLO,X) ; without a pointer Hope this helps SJO2003-07-24 09:02 PM
WORDS
.pointer DS.W 1 ; segment 'rom' .HELLO DC.B ''Bonjour'',0 ld A,#HELLO.h ld pointer,A ld A,#HELLO.l ld {pointer+1},A ; setup pointer to our data clr X ld A,([pointer.w],X) ; A holds first char of data as1 : Error 54: Can't match Addressing mode ' ld A,([pointer.w],X)2003-07-24 09:38 PM
Hi,
You need to do it this way: WORDS segment 'rom' .HELLO DC.B ''Bonjour'',0 clr X ld A,(HELLO,X) ; A holds first char of data Simon Anglia2003-07-24 10:22 PM
You have received that warning because you used WORDS rather than BYTES eg.
BYTES .pointer DS.W 1 ; WORDS segment 'rom' .HELLO DC.B ''Bonjour'',0 ld A,#HELLO.h ld pointer,A ld A,#HELLO.l ld {pointer+1},A ; setup pointer to our data clr X ld A,([pointer.w],X) ; A holds first char of data Regards SJO2003-07-24 11:05 PM
You are a champion !!!