Ax51 User's Guide

EVEN Assembler Statement

Arguments
EVEN
Description

The EVEN statement sets the location counter to the next even address (if the current location counter is odd). This may be used to ensure that the next statement is aligned on a word boundary. The assembler creates a 1-byte gap if necessary. The content of the gap byte is undefined.

Note

  • This directive is available in the AX51 Assembler only.
  • You may use the following code with the A51 Assembler to align to word boundaries in absolute segments only.
    XSEG AT 2000H                     ; segment at xdata
                                      ; address 0x2000.
    .
    .
    .
    ORG      ($+1)  AND 0FFFEH        ; EVEN (WORD) alignment
                                      ; for next variable
    myvar3:         DS 2
    

    The following code must be used in relocatable segments due to the relative nature of the $ symbol.

    ?XD?myseg segment xdata
              rseg    ?XD?myseg
    start:                            ; start label makes
                                      ; ORG expression absolute
    .
    .
    .
    ORG      ($-start+1)  AND 0FFFEH  ; EVEN (WORD) alignment
                                      ; for next variable
    myvar3:  DS 2
    
Example
MYDATA: SEGMENT DATA WORD
        RSEG    MYDATA
var1:   DSB     1
        EVEN
var2:   DSW     1