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

can same memory space use two diff variables ?

Dear Sir,

I m in beginning phase of 8051 with C. i have compiled my c file and i found in .m51 file that one of the SFR and a user defined variable share the same memory space(0080H) .How it's possible.Could you pls explain me.
.M51 lists ....

------- MODULE func1

D:0080H PUBLIC PORT0
I:0080H PUBLIC variabl1

Kindly help with reference to above.

regards,
Arup

Parents
  • what i understand is above 007F in internal data memory if my SFR occupies x no of bytes of memory ,then same memory location(numerical) i can use for user defined variables in different addr space i.e IDATA<p>

    The SFR area contains 128 bytes. What SFRs these 128 bytes contain, and at which address, mostly depends on the type of chip you are using. The chip documentation will provide this information.

    Whether your chip also has 128 of (indirectly addressable) RAM starting at address 0x80 also depends on what chip you are working with. Information about this will also be in the chips documentation.

    If your chip has the 128 bytes of RAM at address 0x80, then they will be usable as part of the IDATA space.

    (IDATA refers to all internal RAM that is indirectly addressable, which means that it ranges from 0x00 to 0xFF. Be aware that the low addresses also contain the register space and the bit-adressable area.

    DATA refers to directly addressable internal RAM, which means 0x00 to 0x7F).

Reply
  • what i understand is above 007F in internal data memory if my SFR occupies x no of bytes of memory ,then same memory location(numerical) i can use for user defined variables in different addr space i.e IDATA<p>

    The SFR area contains 128 bytes. What SFRs these 128 bytes contain, and at which address, mostly depends on the type of chip you are using. The chip documentation will provide this information.

    Whether your chip also has 128 of (indirectly addressable) RAM starting at address 0x80 also depends on what chip you are working with. Information about this will also be in the chips documentation.

    If your chip has the 128 bytes of RAM at address 0x80, then they will be usable as part of the IDATA space.

    (IDATA refers to all internal RAM that is indirectly addressable, which means that it ranges from 0x00 to 0xFF. Be aware that the low addresses also contain the register space and the bit-adressable area.

    DATA refers to directly addressable internal RAM, which means 0x00 to 0x7F).

Children
No data