I was trying to change the value of DDRB by its memory address with the following code:
*(volatile byte*) 0x04 = 0b00100000;
It did not work.
I got the value 0x04 from a post on the Arduino forum, and they claim to have gotten it from the datasheet that looks like this:
It says 0x04 next to it, but my code only started working when I switched to 0x24, the value inside the parentheses. This is the same for PORTB and I assume all the other port related registers.
What does 0x04 point to, how does it relate to DDRB, and why is 0x24 in parenthesis if that is the actual address?