I was looking at the header of ATmega2560 registers mapping (iom2560.h) where there are all the definitions of the registers. For example:
#define PINA _SFR_IO8(0X00)
//Macro definition:
#define _SFR_IO8(io_addr) ((io_addr) + 0X20)
So PINA is a hexadecimal value 8-bit corresponding to the address of the 8-bit microcontroller register. When I'm writing code I can change the value inside the register by just by typing the following code:
PINA |= (1 << 3); // Setting the third bit.
Here is the question: Why can I write the register value ("pointed by his address _SFR_IO8(0X00)") by just assign the value to PINA? Isn't it the address to the register that pointed to? How does the compiler works?
Thank you very much in advance