This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Where are R0 and R1 registers in the memory map?

Hi all,

I'm so confused about the location of program counter (R0) and stack pointer(R1) in the memory map.I think they are inside the CPU,so there is not any location inside memory map that shows these registers.But my friend insists that they are located at special function registers(SFR) that is they are located at the bottom of the memory map.Which one is the right answer?

  • R0 to R15 are internal to the processor core and can be accessed without accessing the memory bus.
    R0 is the PC, R1 the stack pointer, R2 the status register and R3 (and any access to R2 except for register mode access) works as constant generator, turning different addressign modes into immediate constants 0,1,2,4,8 or -1
    R4-R15 are general-purpose registers.

    Other than the SFRs, which are normal memory addresses to the CPU and need to be addressed with the absolute or relative address in any isntruction accessign them, the register's index number is part of the instruction word, so no further data fom cod ememory is needed to use them.

**Attention** This is a public forum