Standard C doesn't actually allow this, or rather the only ways to
attempt it are technically Undefined Behaviour according to the C
Standard
struct Port
{
unsigned char control;
unsigned char data;
}
Port *my_channel = (struct Port*)0x10000;
my_channel->data = oxEE;
this "casts" the address into a pointer to a Port structure.
You might look up the "volatile" keyword as well
Technically, that conversion doesn't directly have undefined behavior.
What the standard says about it is: "An integer may be converted to any
pointer type. Except as previously specified, the result is
implementation-defined, might not be correctly aligned, might not point
to an entity of the referenced type, and might be a trap
representation." 6.3.2.3p5. However, if any of the mentioned
possibilities actually occur, it's virtually certain that there's
undefined behavior somewhere else in the program, probably during the
initialization of my_channel.
In practice, you can reasonably expect that on any implementation where
the specific address you're using is documented as having a special
fixed meaning, the "undefined behavior" will take the form of your code
actually working as intended. However, the code won't be portable to any
implementation where it is not so documented.