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

upper 128byte of 89S52

How to use upper 128byte of AT89S52.
i.e.
SFRs(80H to FFH)
Address indirectly with KEIL C51 for general purpose which are not in use.
They are directly addressable only as SFR.

according to datasheet:
1. The lower 128 bytes of RAM (00H to 7FH) are directly and indirectly addressable.
2. The higher 128 bytes of RAM (80H to FFH) are indirectly addressable.
3. The special function registers (80H to FFH) are directly addressable only.

Please help me thanks!

Parents
  • And I haven't rejected the idata part.

    In this case I'm not talking about a beginner stepping one step too long in their loops resulting in an ifinite loop.

    But for a beginner of 8051, it is quite common/reasonable to use int all the time just because it represents the most efficient variable type on 99% of all processors in existence, and is the recommended/preferred data type in the C language.

    So what I noted is that when using one of the most 16-bit unfriendly processors in existence (excluding 4-bit processors) loop constructs should when possible be written so that they do not need an int.

    As you can see yourself, the loop in question could have been trivially rewritten in a way where an 8-bit variable had been ok. It doesn't matter if you know this. This thread will be read by a lot of people. It is still significant to remember the cost of 16-bit manipulation in the 8051 world.

Reply
  • And I haven't rejected the idata part.

    In this case I'm not talking about a beginner stepping one step too long in their loops resulting in an ifinite loop.

    But for a beginner of 8051, it is quite common/reasonable to use int all the time just because it represents the most efficient variable type on 99% of all processors in existence, and is the recommended/preferred data type in the C language.

    So what I noted is that when using one of the most 16-bit unfriendly processors in existence (excluding 4-bit processors) loop constructs should when possible be written so that they do not need an int.

    As you can see yourself, the loop in question could have been trivially rewritten in a way where an 8-bit variable had been ok. It doesn't matter if you know this. This thread will be read by a lot of people. It is still significant to remember the cost of 16-bit manipulation in the 8051 world.

Children