Re: how to align instructions?
- From: "Rod Pemberton" <do_not_have@xxxxxxxxxxxxx>
- Date: Wed, 20 Feb 2008 05:01:38 -0500
"Herbert Kleebauer" <klee@xxxxxxxxx> wrote in message
news:47BBF2F0.F58F0A6@xxxxxxxxxxxx
Dirk Wolfgang Glomp wrote:
Alignment is usually done with an assembler directive such as:
ALIGN 8, db 0 ; NASM syntax for mod 8, pad with 0
.p2align 3, 0 ; GAS AT&T syntax for mod 8, pad with 0
org START + ((($-START)/8)*8)+8
I don't think it works if you only change the current location counter
without outputting appropriate bytes to the binary file. And what is
((($-START)/8)*8)+8 supposed to do? Is START >$ or <$ ? For START=$
you get 8?
You meant: "you get START+8?" For C, he'd be computing the next multiple of
8 above the value of START. That assumes the value of START is below $,
that the assembler supports multiple ORG's (MASM only?, not for NASM...),
and /8 is an integer divide or truncates the division. Any other problems?
RP
.
- Follow-Ups:
- Re: how to align instructions?
- From: Herbert Kleebauer
- Re: how to align instructions?
- References:
- how to align instructions?
- From: Tim Frink
- Re: how to align instructions?
- From: Rod Pemberton
- Re: how to align instructions?
- From: Dirk Wolfgang Glomp
- Re: how to align instructions?
- From: Herbert Kleebauer
- how to align instructions?
- Prev by Date: Re: how to align instructions?
- Next by Date: Re: how to align instructions?
- Previous by thread: Re: how to align instructions?
- Next by thread: Re: how to align instructions?
- Index(es):
Relevant Pages
|