??? 06/09/04 15:39 Read: times |
#72194 - RE: Course Notes - Memory expanded Responding to: ???'s previous message |
Oleg,
My original point was this: "But all directly addressable RAM is also indirectly addressable, so it's not a distinct memory space." That is to say that the low half of the indirectly addressable RAM also happens to be accessible by direct addressing - it is not a separate memory space. "MOV B,#1 ; access of SFR MOV 0xF0,#1 ; direct memory access (but does the same :) Now could you explain me the difference between these two lines above? Here: can I not use register B just as a direct memory location?" There is no difference - they assemble to the same opcode. The only difference is in your comments - you got it right on the first line! "If any register is mapped into direct memory area, if it is accessed by direct way, so why do you think that it must be named as separate memory space type? I know that SFRs are for special purposes! But they are mapped into direct memory address range and so in program model they look like direct memory locations when you access them." If I have a register in a peripheral IC mapped into my XDATA space I'm not going to kid myself that it's external RAM even though I use MOVX to access it, just like I'm not going to kid myself that the SFR space is plain old RAM because I use direct addressing to access it. "If we start to divide by such way so we need to define another memory spaces as well: registers R0...R7 (and their banks), bit fields..." No we don't, because this area is plain old RAM. Some of it just happens to be accessible in special ways. "For CODE: - reset vector, interrupt vectors space, program code space, data code space, etc." And that's all code space... |