enums

enums in C have a unique name and a defined value. They are simply generated by the compiler as an EQU directive.

Listing: enum


#pragma CREATE_ASM_LISTING ON 
enum {

  E1=4,

  E2=47,

  E3=-1*7

};

The enum code in the following listing results in the following EQUs:

Listing: Resultant EQUs from enums


E1                      EQU $4
E2                      EQU $2F

E3                      EQU $FFFFFFF9
Note: Negative values are generated as 32-bit hex numbers.