A.3.3 Defining const constants

To define a const, use the .db directives/.db2/.dhw directives/.db4/.dw directives within the .const, .zconst or .zconst23 section.

-

1-byte values

[label:]        .db value

-

2-byte values

[label:]        .db2 value

-

4-byte values

[label:]        .db4 value

 

Example

Defining const constants

        .cseg   const
        .public _p              --Sets _p as able to be referenced from other files
        .align  4               --Aligns _val0 to 4 bytes
_p:
        .db2    10              --Allocates a 2-byte area for _p, and stores 10 in it