avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] LCD print problem


From: Theodore A. Roth
Subject: Re: [avr-gcc-list] LCD print problem
Date: Tue, 21 Oct 2003 15:23:43 -0700 (PDT)


On Wed, 22 Oct 2003, Gavin Jackson wrote:

> Hi all
>
> I used to have a working LCD print function but seem to have some
> trouble with it after a recent build. The prototype for the function
> looks like this:
>
> void _lcd_print(const char* pChar)
>
> The list file for the module looks as follows:
>
>  645 0000 4845 4C4C         .string "HELLO WORLD"
>  645         4F20 574F
>  645         524C 4400
>
>  260:../lcd_char.c ****
>  261:../lcd_char.c ****     _lcd_print("HELLO WORLD");
>  670                    .stabn 68,0,261,.LM79-SetupLCD2
>  671                .LM79:
>  672 0182 80E0              ldi r24,lo8(.LC0)
>  673 0184 90E0              ldi r25,hi8(.LC0)
>  674 0186 D4DF              rcall _lcd_print
>
> Which all seems ok until you have a look at the dump from the elf
> file. The words "HELLO WORLD" are not located at 0x0060 in FLASH but
> are found at the end of the hex file.
>
>     _lcd_print("HELLO WORLD");
>  a2e:   80 e6           ldi r24, 0x60   ; 96
>  a30:   90 e0           ldi r25, 0x00   ; 0
>  a32:   d4 df           rcall   .-88        ; 0x9dc
>
> Could someone please explain why this is occurring and where the
> above address of 0x0060 comes from?

What you are seeing is the "HELLO WORLD" string is copied from flash
(address 645) to sram (address 0x0060) by the startup code.

The 0x0060 is the first address of internal sram (at least for some
devices).

Ted Roth


reply via email to

[Prev in Thread] Current Thread [Next in Thread]