Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!chinet!dag From: dag@chinet.UUCP (Daniel A. Glasser) Newsgroups: comp.lang.c Subject: Re: what C needs -- packed structures Message-ID: <2103@chinet.UUCP> Date: 12 Jan 88 16:05:51 GMT References: <8801071842.AA04669@decwrl.dec.com> <2083@chinet.UUCP> <519@cresswell.quintus.UUCP> Reply-To: dag@chinet.UUCP (Daniel A. Glasser) Organization: Chinet - Public Access Unix Lines: 23 In article <519@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: +In article <2083@chinet.UUCP>, dag@chinet.UUCP (Daniel A. Glasser) writes: ++ struct yerks { char y_foo; int *y_fie; char y_poo; }; ++ struct yerks *w; ++ int i; ++ i = *w->y_fie; +He claims that this assignment would turn into 9 M680x0 instructions. +Wrong. It can be coded in three: + movl _w, a0 + movl 1(a0), a0 + movl (a0), _i [rest of article omitted] I specified M68000. I know that the 68020 relaxes this restriction. I also think that the T-11 (lsi-11 on a single 8085 style chip) relaxes this restriction. There are still lots of 68000 and 68010 chips in use out here. Richard's example causes an address error on the M68000. -- Daniel A. Glasser ...!ihnp4!chinet!dag ...!ihnp4!mwc!dag ...!ihnp4!mwc!gorgon!dag One of those things that goes "BUMP!!! (ouch!)" in the night.