AnsweredAssumed Answered

pointer problem (sdcc assembler)

Question asked by remi.essaissi on Sep 26, 2014
Latest reply on Sep 30, 2014 by remi.essaissi
Hello

With the code below, i get returned an incremented caracter it self , the pointer is not,

is it normal ? meaning my code is wrong . i mean i get U not O ...

Or should I file a bug at sdcc comunity?




     ldw     X,#string_0
     ldw     _charptr, X


main_loop:


     LDW     X, #0d50
     CALL     delay_m
     CALL     ledon


     LDW     X, #0d50
     CALL     delay_m
     CALL     ledoff


     ldw     Y,[_charptr]                 ; <---- not returning what is at that address
     ldw     _lcdchar, Y
     call     _lcdwritechar
     ldw     Y, _charptr
     incw     Y
     ldw     _charptr, Y


     JP     main_loop
     .area CODE
string_0:
        .ascii "toto"
        .db 0x00



Outcomes