avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Change EEPROM SFR definition.


From: Björn Haase
Subject: Re: [avr-libc-dev] Change EEPROM SFR definition.
Date: Thu, 30 Jun 2005 19:33:27 +0200
User-agent: KMail/1.7.1

Joerg Wunsch wrote on Donnerstag, 30. Juni 2005 07:00 :
> As Anatoly Sokolov wrote:
> > In new ATMega devices EEPROM support registers are located to other
> > addresses than in AT90S/old ATMega/ ATTiny, it does illogical and
> > error prone the generalized definition of these registers in IO.h.
>
Very briefly: IMO, the most elegant solution of the EEPROM issue would be the 
following:

1.) Patch avr-as so that it accepts instructions like

        out address_of_eeprom_register_that_is_resolved_at_link_time,r0

2.) Resolve the addresses of the registers at link time. E.g. by inserting 
appropriate equates in the device-specific crt file.

When doing this, one would no longer need per-device libs. Presently, 
unfortunately, as does not have the required support.

Another alternative is to provide smarter macros or inline functions for 
eeprom support that contain inline assembly for calling different versions of 
the eeprom routines. Enclosing the call instruction within inline assembly 
would also make it possible to clearly communicate to gcc which subset of 
registers will be clobbered by the eeprom routines. This is what I am doing 
in my professional projects.

Yours,

Björn




reply via email to

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