Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: "David Alan Romig, Jr." Newsgroups: scea.yaroze.programming.codewarrior Subject: Re: NetYaroze vs Profession Developers kit Date: Wed, 10 Nov 1999 00:20:30 -0500 Organization: SCEA News Server Lines: 22 Message-ID: <38290099.A7C8F399@drexel.edu> References: <7v4ug3$9m43@scea> <381DD2C9.F61DB58A@scee.sony.co.uk> Reply-To: drjr@drexel.edu NNTP-Posting-Host: a144.COMCAT.COM Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.7 (Macintosh; I; PPC) X-Accept-Language: en > > The follwing function will fail on the NetYaroze with the this error: > > "Address error on memory Load/Instruction Fetch" > > Make sure all structures are aligned to 4 bytes, it's a MIPS architecture thing. Yeah, that's an address exception. Sometimes they're handled by hardware or software-- obviously, neither occurs in this case. Codewarrior automatically aligns your data for you when you start by type, but it's up to the user to keep alignment in their own dynamic structures. As a rule of thumb: The address of a char must be divisable by 1. The address of a short must be divisable by 2. The address of a long must be divisable by 4. The address of a float must be divisable by 4. The address of a double must be divisable by 8. Even if the exception where to be handled by software, it would be slow. So it's good to keep data aligned on all processors even when it does not cause an error. --Dave Romig, Jr. (drjr@drexel.edu)