Keil Logo

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 can 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 varies for different sections and is:
  • undefined in data.
  • 0 in const.
  • NOP in code.

The segment needs to be declared at least with WORD alignment.

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
    
See Also

ALIGN, SEGMENT

Example
MYDATA: SEGMENT DATA WORD
        RSEG    MYDATA
var1:   DSB     1
        EVEN
var2:   DSW     1
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.