Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #10873

Re: Inconsistent results between char/short/int

From Nobody <nobody@nowhere.com>
Subject Re: Inconsistent results between char/short/int
Date 2011-09-24 18:26 +0100
Message-Id <pan.2011.09.24.17.26.53.650000@nowhere.com>
Newsgroups comp.lang.c
References <j5i2ki$72q$1@ccpntc8.in2p3.fr> <j5j7qd$pr1$1@dont-email.me>
Organization Zen Internet

Show all headers | View raw


On Fri, 23 Sep 2011 20:21:31 -0400, Eric Sosman wrote:

>      - The processor completely ignores the offending low-order
>        address bits, so when you fetch an int from 0x81600001 you
>        get the four bytes 0x81600000-0x81600003 instead of the
>        intended 0x81600001-0x81600004.  Peculiar results ensue.

The historical ARM behaviour is similar, but with the result rotated such
that the byte at the specified address is the least significant byte of
the result.

IOW, reads use the top 30 bits to determine the address, and the
bottom 2 bits to determine the rotation. Byte reads mask the resulting
word with 0xFF, word reads don't.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Inconsistent results between char/short/int Guillaume Dargaud <use_the_contact_form@www.gdargaud.net> - 2011-09-23 15:46 +0200
  Re: Inconsistent results between char/short/int Noob <root@127.0.0.1> - 2011-09-23 16:44 +0200
  Re: Inconsistent results between char/short/int Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-23 17:16 +0100
    Re: Inconsistent results between char/short/int Guillaume Dargaud <use_the_contact_form@www.gdargaud.net> - 2011-09-29 14:53 +0200
  Re: Inconsistent results between char/short/int Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-23 20:21 -0400
    Re: Inconsistent results between char/short/int Nobody <nobody@nowhere.com> - 2011-09-24 18:26 +0100
      Re: Inconsistent results between char/short/int Guillaume Dargaud <use_the_contact_form@www.gdargaud.net> - 2011-09-29 14:50 +0200
    Re: Inconsistent results between char/short/int Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-09-29 21:57 +0000

csiph-web