--- In gbadev@y..., James Daniels <james.daniels@a...> wrote:
> Hi yerricde,
>
> > I interpret "even" to mean "4n" and "odd" as "4n + 2". Reads
> > from "odd" addresses from IWRAM should not be any different than
> > reads from "even" addresses because the whole 32-bit quantity
> > gets placed on the CPU's bus.
>
> I meant odd and even in the traditional sense - i.e. an even
> address is exactly divisible by 2 (2n) whereas an odd address is
> not (2n+1).
>
> > For fun, I added in an unaligned (odd-byte-address)
> > EWRAM read, and its color bar was the same height.
>
> This answers my question - thanks! (Did you get the same result
> for IWRAM?)
You should, as a read from an odd (4n + c where 1 <= c <= 3) address
is merely a read from 4n followed by a rotation.
However, note that unlike on x86, you're really not supposed to
do unaligned reads or writes on ARM. The results are well-defined
but not what you'd think at first.
Consult the ARM Architecture Reference Manual and the ARM7TDMI
documentation for more information.
--
Damian