Hello! I have gotten so confused...maybe too much reading during one day :-) AtMega 2560 datasheet says for example: 0x04 (0x24) DDRBm, address of DDRB. if I want to set DDRB so that bits 5-6 are output and the rest are inputs, I can write for example: DDRB = 0b01100000, using port manipulation, and I know this works. But, using assembly, I can also write: ld r18,0b01100000 ld DDRB,r18 What I want to know, is: Are both ways correct, or should I use DDRB-0x20 in assebly version for register addresses 00-3f (hex)? ButActually the question is: What are the "real addresses" for avr registers? The datasheet says: 0x3F (0x5F) SREG 0x3E (0x5E) SPH
-- 0x04 (0x24) DDRB 0x03 (0x23) PINB 0x02 (0x22) PORTA 0x01 (0x21) DDRA 0x00 (0x20) PINA
But how are the Port names defined in avr for those addresses 00-3F / (20-5F), which are the "right" values?