Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!uvaarpa!virginia!uvacs!mac From: mac@uvacs.cs.Virginia.EDU (Alex Colvin) Newsgroups: comp.sys.intel Subject: Re: function start address allignment Summary: faster memory interface Keywords: word alignment Message-ID: <3018@uvacs.cs.Virginia.EDU> Date: 9 Mar 89 02:57:57 GMT References: <311@ssp2.idca.tds.philips.nl> <687@pcrat.UUCP> Organization: University of Virginia Lines: 16 > >start of a function in a c program is always word alligned. If > >My question is: Is this general for compilers/assemblers in unix environment This should be general, not just for UN*X. It doesn't have to do with any vector stunts. One the higher-end 8*86s the memory interface is 16 or 32 bits wide. If you align the start of a subroutine you get the first two bytes in a single fetch. Otherwise it'll take two. For the same reason, it's often a good practice to use a NOP where necessary to word align any jump target. Similarly, words should be word aligned. If you've got a 32-bit memory interface (and the high-end UN*X 382s may), you may want dword alignment, so you pick up the first 4 bytes in one fetch. On a historical note, intel got burned on the iAPX432, which dbit aligned instructions, making jumps and calls kind'a slow.