Assigning Physical values to pointers

I am using C++ to write a program for a u-processor circuit. In trying to control hardware, I have things mapped to specific memory addresses. I know I will have to use pointers to point to these locations, How can I assign specific numbers to pointers to represent these memory locations. If I directly assign a number value to a pointer,

ie
1
2
3
unsigned int * mypointer;

  mypointer = 0x900E0000;


I get compile errors of: (a value of type "unsigned int" cannot be assigned to an entity of type "unsigned int *")

Furthermore, what I really need to do is assign mnemonic constants to the address values for easier readability. something like:

1
2
3
4
const unsigned int Port=0x900E0000;
  unsigned int * mypointer;

  mypointer = Port;


anyway of doing this type of stuff?
What you wan to do there is mypointer = (unsigned int *)0x900E0000;
However, modern OSs crash programs that try to access memory that doesn't belong to them.
Topic archived. No new replies allowed.