Re: Microchip Introduces First 16-bit Microcontroller Product Line - the PIC24



On Sun, 16 Oct 2005, Andreas Schwarz wrote:

> Ian Bell schrieb:
> > Andreas Schwarz wrote:
> > > Ian Bell schrieb:
> > > > Michael N. Moran wrote:
> > > > > Ian Bell wrote:
> > > > > > Andreas Schwarz wrote:
> > > > > > > The problem is that you need different instructions to
> > > > > > > read from RAM
> > > > > > > and ROM, so you often end up with two functions that
> > > > > > > do the same thing,
> > > > > > > one for RAM arguments (printf), and one for ROM
> > > > > > > arguments (printf_P).
> > > > > >
> > > > > > Right so the *real* problem is handling large constant
> > > > > > strings.
> > > > >
> > > > > Well ... strings are only one part of the problem.
> > > > > Any constant tables/arrays, such as:
> > > > >
> > > > > o state tables
> > > > > o lookup-tables
> > > > > o <shield-up> v-tables <shield-down>
> > > > >
> > > > > are problematic to most traditional compilers/languages that
> > > > > only understand a single contiguous address space.
> > > > >
> > > > >
> > > >
> > > >
> > > > But surely that is a *compiler* issue not a fault of the
> > > > underlying
> > > > architecture?
> > >
> > > No. To achive true transparency, the compiler would have to generate
> > > code that can tell a ROM address from a RAM address at runtime.
> > > Otherwise functions that take pointer arguments would not be possible.
> >
> >
> > So it *is* a compiler issue.
>
> Any hardware annoyance can be hidden by a layer of software. Still I think
> it's fair to think of it as a fault of the architecture.
>

No you do not always need to add a LAYER of software. Most of the time it
is just a case of generating code that looks horrible to YOU.

On a PIC you can insert RAM page select instructions in front of all
instructions if you wish *** OR *** you can analyse your code and only
insert them where you NEED them. This may not be "nice" because it
involves extra work for you. But if you do the job properly you end up
with a VERY LOW page select overhead, much lower than if each instruction
actually carried the extra bits required.

The trick is to use a high level language or sophisticated assembler that
will do this work for you. This is not adding a layer of software.


Regards
Sergio Masci

http://www.xcprod.com/titan/XCSB - optimising PIC compiler
FREE for personal non-commercial use



..

.



Relevant Pages

  • RetroForth ANS Layer now available
    ... I've recently built an Standard Forth compatibility layer for the RetroForth ... compiler. ...
    (comp.lang.forth)
  • Re: C++ in the kernel
    ... interest for C++ runtime support in FreeBSD and if anyone is already ... significantly for any non GPLv3 compiler we might consider. ... a layer which we have 100% ... FreeBSD committer | BSD since 4.3-tahoe ...
    (freebsd-arch)
  • Re: microcontroller programming -- how to begin
    ... Pooh Bear wrote: ... Andreas Schwarz wrote: ... An assembler also has little need for updating, but a compiler can always be improved. ... Whether it is worth doing or not is a different matter, of course, but no compiler ever generates truly optimal code, and can therefore be improved. ...
    (sci.electronics.design)
  • Re: MPI/Fortran95 incompatibility? Was - Re: Pass by reference in Fortran77 standard?
    ... No compiler vendor is going to constrain what future compilers might ... >Does anyone know if the Fortran API for MPI is a layer on top of "base" C (I presume, ... >whatever language) code -- ala netCDF, where the f90 API is an additional layer on top of ...
    (comp.lang.fortran)
  • Re: C embedded programming books?
    ... Andreas Schwarz wrote: ... Because it depends on the compiler how the elements of a bit field are ... aligned in memory. ... I suspected that this is the reason. ...
    (comp.arch.embedded)