🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.intel
Article #1887

Re: function start address allignment

#1887
From: Leonard A. Bauer
Date: Sun, 12 Mar 1989 17:05
17 lines
1252 bytes
In article <3018@uvacs.cs.Virginia.EDU> mac@uvacs.cs.Virginia.EDU (Alex Colvin) writes:
>> >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
>
>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.

Rather than using NOP's and performing mental masturbation, use the 'WORD' 
and 'DWORD' compile/assemble directives and let the assembler do the work
for which it is intended.


Len Bauer        lab@ccird2.UUCP
Rochester NY
Technical Details
Message-ID: <27078@cci632.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ccicpg!cci632!lab
References: <311@ssp2.idca.tds.philips.nl> <687@pcrat.UUCP> <3018@uvacs.cs.Virginia.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ccicpg!cci632!lab
From: lab@cci632.UUCP (Leonard A. Bauer)
Newsgroups: comp.sys.intel
Subject: Re: function start address allignment
Keywords: word alignment
Message-ID: <27078@cci632.UUCP>
Date: 12 Mar 89 17:05:42 GMT
References: <311@ssp2.idca.tds.philips.nl> <687@pcrat.UUCP> <3018@uvacs.cs.Virginia.EDU>
Reply-To: lab@op632.UUCP (Leonard A. Bauer)
Organization: CCI, Communications Systems Division, Rochester, NY
Lines: 17