News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Align

Started by AssemblyBeginner, October 12, 2006, 04:59:40 PM

Previous topic - Next topic

AssemblyBeginner

hi,

  what is "Align" or "Alignment"
  i see i many example in forum with different values like
  align 16
  align 8

  how we know where we used wich number like 8 or 16,where it is useful?
  plz guide me with example
  thks in advance

P1

Syntax:   ALIGN [number]

  Description:

     ALIGN aligns the next variable or instruction on an offset address
     that is a multiple of <expression>. The <number> parameter must be
     a power of 2 (1,2,4,8,...) less than or equal to the alignment of
     the current segment. If <number> is omitted, the alignment is
     determined by the align field of the preceding SEGMENT directive.

     In a segment containing no instructions, the assembler pads each

     skipped byte with nulls (00h). In a code segment, the assembler
     inserts a no-operation sequence (not necessarily NOP instructions)
     to fill the gap.

     This directive is useful for optimizing data and instruction
     fetches on processors with 16 or 32 bit data paths.

     EVEN is a synonym for ALIGN 2.
Read this and ask your yourself, if reading the help file would have saved you some time?

AssemblyBeginner,

Welcome Aboard       :U

The forum 'Search' and your favorite search engine will answer many questions before we can and save you time.      :dance:

Regards,  P1  :8)