This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cannot read SFR memory space (in asm)

Hello

i have this code to read int.ram and copy to ext.ram

MOV R0,#00H
MOV R1,#0FFH
MOV DPTR,#7C00H
reload: NOP
MOV A,@R0
MOVX @DPTR,A
INC R0
INC DPTR
DJNZ R1,reload

but the memory is only copied to address 0x7F.i cannot copy memory space from 0x80 to 0xFF. MOV a,@r0 does nothing in A is always 0x00 (but in debugger for example at D:0x82 i see DPL value, but i cannot get in to ACC and copy to external RAM). i have this asm code included as asm function in my C project. excuse my poor englist. please help :)

Parents
  • This is an architectural limitation of the 8051. The addressing mode is used to resolve the difference between addressing SFR space and bytes in the upper 128 bytes of internal RAM. You cannot have a pointer to an SFR (or a "bit" variable, for that matter).

                 Direct         Indirect
                addressing     addressing
    80H..0FFH      SFRs          idata
    00H..07FH      data           data
    
    

    See the programmer's reference manual for your part for more details.

Reply
  • This is an architectural limitation of the 8051. The addressing mode is used to resolve the difference between addressing SFR space and bytes in the upper 128 bytes of internal RAM. You cannot have a pointer to an SFR (or a "bit" variable, for that matter).

                 Direct         Indirect
                addressing     addressing
    80H..0FFH      SFRs          idata
    00H..07FH      data           data
    
    

    See the programmer's reference manual for your part for more details.

Children