Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ames!ucbcad!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU.UUCP Newsgroups: comp.sys.amiga Subject: Re: 68k word-alignment penalty? Message-ID: <8703242106.AA05032@cory.Berkeley.EDU> Date: Tue, 24-Mar-87 16:06:36 EST Article-I.D.: cory.8703242106.AA05032 Posted: Tue Mar 24 16:06:36 1987 Date-Received: Thu, 26-Mar-87 07:36:00 EST Sender: daemon@ucbvax.BERKELEY.EDU Lines: 42 >In article <2820@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: >> Some system software designers, in their shorsightedness, fail to >>provide even this basic exception handler in the OS. Thus, the execution >>time for an odd-address word fetch on such a system increases by several >>orders of magnitude; from tens of seconds to almost forever. > >The $64 question, then, is "does AmigaDOS do the right thing?" > The 64-cent answer is, yes. AmigaDOS properly doesn't do a #@$% thing, And frankly, there is no reason why AmigaDOS should. In fact, if it did, it might inspire sloppiness in the programmer. I have never heard of a 68000 OS which allows byte bounded word or long operations by installing an exception handler. Can Anybody site any by name? >>I think he phrased the question improperly. I suspect the question he >>really wanted to ask was whether or not the 68K optimized longword fetches >>on longword boundaries (the 68K doesn't, I don't know about the others). > >No, I phrased the question correctly. Being primarily a C hacker, and only >having programmed the Vax-11, 6809, and Z80 in assembly, I had no idea what >to expect, but I didn't expect exception handling. Pointed in the right >direction, I have been able to find the part of the manual that explains this. >I assume, since instruction and word data alignment are so critical, that the >assembler does the right thing for you when you define constant word data. Since the 68000 has a 16 bit data bus, longword fetches take the same amount of time whether they are on a word boundry or a longword boundry. A 68020, however, with its 32 bit data bus, can obviously make a longword fetch faster on a longword boundry then on a word boundry. Instruction alignment on a 68K machine is very critical... instructions must be aligned on word boundries and are always some multiple of words in length. Same goes with data fetches... word and long fetches must be on a word boundry or you get an address error. A Vax 780, on the otherhand, doesn't care at all whether instructions or fetches are on byte boundries. However, it is much more efficient when they are, and all compilers I know of keep their data on word/longword boundries. -Matt