I learning to program the ATmega328p microcontroller in C and Assembler:
Can someone explain this difference in addresses (does that because the definition of the general purpose registers r0..r31, 0x00 .. 0x1F) ??
This is because the I/O address space is also mapped in the memory address space. It allows C to access them without using special instructions like OUT
and IN
.
You can use the 0x24 in assembly too - using the load and store instructions
It is not related to the language you use.
I strongly advise you to read the AVR documentation.