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



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.

Sounds to me like a case of the tail wagging the dog.

Ian
.



Relevant Pages