🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #1883

Re: function start address allignment

#1883
From: Phil Barrett
Date: Fri, 03 Mar 1989 01:42
14 lines
1287 bytes
In article <687@pcrat.UUCP> rick@pcrat.UUCP (Rick Richardson) writes:
>In article <311@ssp2.idca.tds.philips.nl> pb@idca.tds.PHILIPS.nl (Peter Brouwer) writes:
>>When looking at executables with sdb and dis (unix) I noticed that the
>>start of a function in a c program is always word alligned. If
>
>I think this is due to the Basic-16 ... iAPX286 ... iAPX386 heritage
>of the compiler.  Basic-16 had a mechanism known as transfer vectors


Actually, I believe the reason is performance. The 386 needs to have fetched
the entire instruction before it can begin execution of it.  By aligning
the target of a control transfer, you can minimize the number of DWord fetches
required to start execution of the instruction and thus improve the performance
of your program.
Technical Details
Message-ID: <795@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!microsoft!philba
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!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!microsoft!philba
From: philba@microsoft.UUCP (Phil Barrett)
Newsgroups: comp.sys.intel
Subject: Re: function start address allignment
Keywords: word alignment
Message-ID: <795@microsoft.UUCP>
Date: 3 Mar 89 01:42:26 GMT
References: <311@ssp2.idca.tds.philips.nl> <687@pcrat.UUCP>
Reply-To: philba@microsoft.UUCP (Phil Barrett)
Organization: Microsoft Corp., Redmond WA
Lines: 14