Re: C programming on ARM
- From: "Wilco Dijkstra" <Wilco_dot_Dijkstra@xxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 23:56:56 GMT
"Hans-Bernhard Bröker" <HBBroeker@xxxxxxxxxxx> wrote in message news:fnr0vs$mp6$00$1@xxxxxxxxxxxxxxxxxxxx
Wilco Dijkstra wrote:
With any byte addressable architecture, a pointer is just a pointer.
But there are quite a few non-byte addressable architectures out there.
Including ARM, last I checked.
Actually most architectures are byte addressable, including ARM,
Depends on what exactly you mean by the term.
AFAIK ARM7 is byte-addressable only for bytes, but not for larger objects. Well, may be it's just me, but I wouldn't
call what happens when an ARM7 accesses a 32-bit integer without 4-byte alignment "addressing".
Obviously not all possible pointer values are valid for all types. This doesn't
affect byte addressability as casting between char* and int* doesn't lose
information. Accessing a misaligned pointer will result in an exception
(which is a good way to detect corrupted pointers). However if you use
the correct type (eg. __packed int *p rather than int *p), the compiler will
generate an unaligned access.
Similarly a 32-bit CPU with less than 4GB of memory doesn't have
(say) a 18.25-bit address space - it still has a 32-bit address space of
which only a small proportion is valid.
Wilco
.
- Follow-Ups:
- Re: C programming on ARM
- From: Grant Edwards
- Re: C programming on ARM
- References:
- C programming on ARM
- From: aamer
- Re: C programming on ARM
- From: Arlet Ottens
- Re: C programming on ARM
- From: Jim Relsh
- Re: C programming on ARM
- From: CBFalconer
- Re: C programming on ARM
- From: Paul Keinanen
- Re: C programming on ARM
- From: Hans-Bernhard Bröker
- Re: C programming on ARM
- From: Wilco Dijkstra
- Re: C programming on ARM
- From: Hans-Bernhard Bröker
- C programming on ARM
- Prev by Date: Re: Embeded System Recomendation
- Next by Date: Re: C programming on ARM
- Previous by thread: Re: C programming on ARM
- Next by thread: Re: C programming on ARM
- Index(es):
Relevant Pages
|