Re: how to align instructions?



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?
.



Relevant Pages

  • Re: how to align instructions?
    ... I don't think it works if you only change the current location counter ... without outputting appropriate bytes to the binary file. ... and /8 is an integer divide or truncates the division. ...
    (alt.lang.asm)
  • Re: how to align instructions?
    ... without outputting appropriate bytes to the binary file. ... If I want to round the current location counter to the next multiple of 8, ...
    (alt.lang.asm)
  • Re: how to align instructions?
    ... I don't think it works if you only change the current location counter ... without outputting appropriate bytes to the binary file. ... align a destination for a jmp/call, when the few bytes before those ...
    (alt.lang.asm)