Thanks,
I basically want to achieve the same as I had in asm, that ir, each
sequential byte having respective number in it. This is not meant to
be a string, just 4 bytes in a row, starting with address of
disp_digits.
Seems like using double quotes was wrong.

I just checked asm code produced by sdcc from that, it is the same as
the original that I had in asm. So, if it still does not work, I have
to look for another error somewhere else.

       PAGESEL $
        .line   37; "main_lcd_disp.c"   disp_digits[0]=0;
        BANKSEL _disp_digits
        CLRF    (_disp_digits + 0)
        .line   38; "main_lcd_disp.c"   disp_digits[1]=1;
        MOVLW   0x01
        MOVWF   (_disp_digits + 1)
        .line   39; "main_lcd_disp.c"   disp_digits[2]=2;
        MOVLW   0x02
        MOVWF   (_disp_digits + 2)
        .line   40; "main_lcd_disp.c"   disp_digits[3]=3;
        MOVLW   0x03
        MOVWF   (_disp_digits + 3)
        .line   42; "main_lcd_disp.c"   DECODE();
        PAGESEL _DECODE
        CALL    _DECODE
        PAGESEL $

I am not using that variable anywhere in C yet, it is just defined
there, and used by asm module (where it is defined), byte-by-byte.


On Thu, May 26, 2011 at 15:19, Richard Gray
<rich...@reallyrathergood.com> wrote:
> This is just a hunch, but I wonder if you actually mean this:-
>
> disp_digits="0123";
>
> This effectively assigns ASCII "0" to the first element, "1" to the second and
> so on, with a null (ASCII 0) in disp_digits[4]. As you have written the code,
> if the array is treated elsewhere as a string, starting with a true zero will
> make it appear like an empty string.
>
> Just a thought - it's such a common mistake that I thought it might be worth a
> mention.
>

-- 
KPL

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to