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


Groups > comp.lang.c > #59535

Re: Alignment requirement of basic types

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Alignment requirement of basic types
Date Fri, 03 Apr 2015 11:06:46 -0700
Organization None to speak of
Lines 19
Message-ID <874moxytl5.fsf@kst-u.example.com> (permalink)
References <mfm5mg$4rp$1@dont-email.me> <20150403092630.239@kylheku.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="9be37d943435275679235b07c7947eef"; logging-data="1474"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/09fO5MyT4ipI1Ar+JX4NI"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:J3F0dkUpwbJG4nmegJ/snRTGH7c= sha1:6tq8f3Kz9eyUcfy+csEWOjvoUkU=
Xref csiph.com comp.lang.c:59535

Show key headers only | View raw


Kaz Kylheku <kaz@kylheku.com> writes:
[...]
> The 8086 and 8088 processors do not have alignment restrictions; you can read
> words from odd addresses. Many classic CISC processors are that way, such
> as Motorola 68K.
[...]

My admittedly hazy memory tells me that accessing a 16-bit word at an
odd address on a 68K would cause a fatal trap, probably a bus error.

(At least one non-C implementation took advantage of this by making the
null pointer's representation 0x1, so any attempt to dereference it
would cause a trap.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

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


Thread

Alignment requirement of basic types Noob <root@127.0.0.1> - 2015-04-03 15:48 +0200
  Re: Alignment requirement of basic types Tim Prince <tprince@computer.org> - 2015-04-03 10:23 -0400
  Re: Alignment requirement of basic types James Kuyper <jameskuyper@verizon.net> - 2015-04-03 11:37 -0400
    Re: Alignment requirement of basic types John Temples <usenet@xargs-spam.com> - 2015-04-03 17:21 +0000
      Re: Alignment requirement of basic types James Kuyper <jameskuyper@verizon.net> - 2015-04-03 13:45 -0400
        Re: Alignment requirement of basic types Kaz Kylheku <kaz@kylheku.com> - 2015-04-03 18:40 +0000
      Re: Alignment requirement of basic types Keith Thompson <kst-u@mib.org> - 2015-04-03 10:50 -0700
      Re: Alignment requirement of basic types glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-04-03 19:02 +0000
    Re: Alignment requirement of basic types Kaz Kylheku <kaz@kylheku.com> - 2015-04-03 18:01 +0000
  Re: Alignment requirement of basic types Richard Damon <Richard@Damon-Family.org> - 2015-04-03 12:05 -0400
    Re: Alignment requirement of basic types glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-04-03 16:48 +0000
  Re: Alignment requirement of basic types Kaz Kylheku <kaz@kylheku.com> - 2015-04-03 16:46 +0000
    Re: Alignment requirement of basic types Keith Thompson <kst-u@mib.org> - 2015-04-03 11:06 -0700
      Re: Alignment requirement of basic types Robert Wessel <robertwessel2@yahoo.com> - 2015-04-05 22:22 -0500
  Re: Alignment requirement of basic types Waldek Hebisch <hebisch@antispam.uni.wroc.pl> - 2015-04-04 23:15 +0000

csiph-web