Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!isis!nyx!jgriffit From: jgriffit@nyx.UUCP (Jonathan C. Griffitts) Newsgroups: comp.arch Subject: Re: RISC hard to program? (was: Moto's data predicts...) Message-ID: <1620@nyx.UUCP> Date: 19 Jul 90 04:57:59 GMT References: <40088@mips.mips.COM> <2162@opus.cs.mcgill.ca> <1990Jul13.071511.22250@Neon.Stanford.EDU> wsd@cs.brown.edu (Wm. Scott `Spot' Draves) writes: > >> Data misalignment problems are independent of how well a program is written, >> especially if the program was written for another target architecture. > >no way. A correctly written program will have no problems with >alignment on any architecture. Can you give an example of correct >code that will fail? (I am assuming that well written programs are >correct :) > How about a case I have personal experience with: a language interpreter that executes precompiled binary code sequences. The program originally ran on PCs that make no requirement for int and long alignments, so the code sequences were packed together in the obvious way (making use of sizeof() operators to determine how far to advance the execution pointer). When this program was ported to a 68000, the alignment requirement caused a lot of changes. It's not a hard problem to solve in any particular case, but we had to make sure that every case was found. Not trivial. This was written in C, by the way. Something to keep in mind when writing code that might need to be portable! --Jonathan Griffitts AnyWare Engineering (303) 442-0556