Deutsch English Français Italiano |
<j2a73jleerqgjuqee148i0hunhvvkgih6l@4ax.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: John Savard <quadibloc@servername.invalid> Newsgroups: comp.arch Subject: Re: Byte Addressability And Beyond Date: Thu, 02 May 2024 08:58:23 -0600 Organization: A noiseless patient Spider Lines: 41 Message-ID: <j2a73jleerqgjuqee148i0hunhvvkgih6l@4ax.com> References: <v0s17o$2okf4$2@dont-email.me> <v0s744$l3v$1@gal.iecc.com> <v0snlh$30rmc$2@dont-email.me> <v0u95n$1oje$1@gal.iecc.com> <v0uihh$3e0vg$5@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 02 May 2024 16:58:25 +0200 (CEST) Injection-Info: dont-email.me; posting-host="21fce946276226c6e7eebe5c77f92d44"; logging-data="4116729"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IXzYLBQg9d8b3YKqr9Bpr/3Lyh9yPG1A=" Cancel-Lock: sha1:sdAru3P64+aSP3fpmwWVf5K+vxs= X-Newsreader: Forte Free Agent 3.3/32.846 Bytes: 2747 On Wed, 1 May 2024 23:17:06 -0000 (UTC), Lawrence D'Oliveiro <ldo@nz.invalid> wrote: >On a little-endian architecture, it is always the lowest-significance >byte. > >But on a big-endian architecture, for a register-memory-register move, it >will be the highest-significance byte. But for the memory-register-memory >case, it will be the lowest-significance byte. > >In other words, even on big-endian architectures, registers are still >interpreted as little-endian! > >Isn’t that fun? It had never occured to me to think about it in this way. To me, it just made sense that, since registers contain quantities, if you load the value "8" into a reigster, it will contain the number 8. So in a byte operation, the least significant bits of the register are used. While if yiou store something in a memory location, you're only using the length corresponding to the size of the operand. So, yes, storing a value into a byte in memory... puts it at the location of the most significant 8 bits of a 32-bit quantity having the same address. But so what? Usually, a memory location is used for only one size of data. If EQUIVALENCE magic is going on, it makes more sense to have numbers in memory look the way we write them, so it's easy to understand. Plus, if you load a single precision float into a floating-point register, you are loading on the left side, not the right side, so the inconsistency to which you're referring now impacts the little-endian machines. (Of course, though, that's no longer quite true with IEEE 754, since the exponent isn't the same size for all precisions, the way it was with old-fashioned machines.) John Savard