This is my fist time working with a "bigger" micro controller, ATmega128. So far I've worked with ATmega328, ATmega8 etc.
Reading through the datasheet, I didn't understand couple of points
That AVR instruction set can support a maximum of 64 I/O locations. Why is that? Does the AVR instruction set take in 6 bits for an I/O location?
To accommodate the extended I/O in ATmega128 (160 extra ones), these 160 locations have been mapped to the internal SRAM right after the 64 existing ones. So in effect out of the 4KB SRAM that ATmega128 provides, 160 is taken up by these extended I/O locations. What happens if the ATmega103 compatibility fuse set (programmed by default)? Do I have access to these 160 locations then?
How exactly do I access these extended locations? The datasheet asks to use LD/LDS/LDD and ST/STS/STD. Any examples to this as I've never used assembly before. I am kind of confused how this wold integrate into my C code workflow? Let's say I need to access DDRF and PORTF. Would I need to know their address(in SRAM) in advance or is there some macro in avr-gcc?
Any code samples or links to read and understand above would be great!