Elements:
id is a valid C identifier,
x is a C variable or a constant
Purpose:
If the id is already known as a C variable then this will locate the variable at address x. In this case the variable type does not change from the original definition. If the id is not known a new C variable is created and placed at address x with the type int (8 bit)
Warning: In both cases memory at x is not exclusive to this variable. Other variables may be located at the same location. In fact when x is a variable, then id and x share the same memory location.
#BYTE id = x
Elements:
id is a valid C identifier,
x is a C variable or a constant
Purpose:
If the id is already known as a C variable then this will locate the variable at address x. In this case the variable type does not change from the original definition. If the id is not known a new C variable is created and placed at address x with the type int (8 bit)
Warning: In both cases memory at x is not exclusive to this variable. Other variables may be located at the same location. In fact when x is a variable, then id and x share the same memory location.
Examples:
#byte status = 3
#byte b_port = 6
struct {
short int r_w;
short int c_d;
int unused : 2;
int data : 4 ; } a _port;
#byte a_port = 5
...
a_port.c_d = 1;
一周热门 更多>