This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Porting GCC to 8051-Microcontroler: memory layout


Mueller-Lehnitz@t-online.de (Anja Müller) writes:

> Now my question: do you think that it is a better solution to define
> only the Registers DPL and DPH instead of DPTR to the GCC, because it is
> the only 16 Bit Register ? Then there would be only 8-Bit-Registers - a
> fact that maybe makes it easier to define some other Machine Macros and
> the machine description. But in this case: how does the GCC know that an
> address can be 16-Bit and has to be loaded byte by byte into DPH and
> DPL

Look to my 8bit gcc port for ATMEL AVR micro controllers.
This is a 8bit micro controllers with three pointer registers
X (r26,r27)
Y (r28,r29)
Z (r30,r31)

In my port sources you can find answers at your questions.

Look to http://medo.fov.uni-mb.si/mapp/uTools

Also look to http://home.worldnet.fr/stcarrez/m68hc11_port.html
This is a 8bit port for 68HC11 micro controller.


> Independantly whether this register is defined as  DPTR or DPL and DPH :
> Is it advisable to define DPTR (or DPL/DPH) as FIXED_REGISTER ? On the
> one hand it can also be used as general register, but on the other hand
> it has this special function to address the external memory.

IMHO DPL and DPH must be in FIXED_REGISTER because gcc can't normally
work with one pointer register. (It's only my opinion you can try)


> 
> Another problem: the 8051 has seperated memory for data and program
> code: I already mentioned the data memory above, that is seperated in
> internal and external RAM. The Program Code is loaded in the 64KByte
> read-only Program memory (ROM). There are different instructions to
> access ROM or RAM.

This is a big problem.

Today gcc can't work with harvard architectures.
(You can resolve this problem by hacking gcc sources)
For example look to port for Analog Device's SHARC or AD2181 DSP's.
IMHO Alan Lehotsky <lehotsky@tiac.net> can help you with port location.



Denis.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]