ALIGN Directive
ALIGN numberThe could be 1, 2, or 4. If it equals 1, the next variable or byte is aligned on a 1-byte boundary. If is 2, the next variable is aligned on an even-numbered address, and if is 4, the next address is a multiple of 4.
| ALIGN 1 | ALIGN 2 | ALIGN 4 |
INCLUDE Irvine32.inc .data X BYTE 0FFh ALIGN 1 Y DWORD 12345678h .code main PROC mov eax, 0 mov ebx, OFFSET X mov ax, [ebx + 2] call WriteHex exit main ENDP END main |
INCLUDE Irvine32.inc .data X BYTE 0FFh ALIGN 2 Y DWORD 12345678h .code main PROC mov eax, 0 mov ebx, OFFSET X mov ax, [ebx + 2] call WriteHex exit main ENDP END main |
INCLUDE Irvine32.inc .data X BYTE 0FFh ALIGN 4 Y DWORD 12345678h .code main PROC mov eax, 0 mov ebx, OFFSET X mov ax, [ebx + 2] call WriteHex exit main ENDP END main |
| Output | Output | Output |
XCHG AX, AX
NOP — No Operation
|
||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||