🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #1885

Re: function start address allignment

#1885
From: Alex Colvin
Date: Thu, 09 Mar 1989 02:57
16 lines
1323 bytes
> >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.
Technical Details
Message-ID: <3018@uvacs.cs.Virginia.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!uvaarpa!virginia!uvacs!mac
References: <311@ssp2.idca.tds.philips.nl> <687@pcrat.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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