| ??? 02/05/04 12:37 Read: times |
#64061 - RE: Decreamenting DPTR. Responding to: ???'s previous message |
Long ago I used to think that the absence of a DEC DPTR instruction was a major shortcoming of the 8051 instruction set. But these days after having quite a bit of experince with working with the instruction set I have found that there is very little need for the DEC operation for several reasons.
First off if you are using DPTR for any kind of extensive series of accesses into external memory space you will notice the register gets reloaded all the time anyway. Secondly if the DPTR is being used to scan through data it is almost always possible to organize the dataset design to permit forward (incrementing) scanning. Third, there are the MOVX A, @Rn type of instructions that can be used with the external memory space in paged mode and then the register indexes can be manipulated easily in many ways including INC and DEC. Fourth if the DPTR is being used as a loop counter in some type of looping scheme it could just as well be loaded with the negative of the loop count and then the INC DPTR instruction does the trick. However any efficiency thus gained quickly is lost when checking the loop ending condition. Thus DPTR makes a bad loop counter. Michael Karas |
| Topic | Author | Date |
| Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
| RE: Decreamenting DPTR. | 01/01/70 00:00 | |
RE: Decreamenting DPTR. | 01/01/70 00:00 |



