??? 03/14/07 21:24 Read: times |
#135012 - If I remember correctly ... Responding to: ???'s previous message |
John C Barrett said:
I have a problem in re-vamping a software program written for a 8748 to one for a 80C51. A lot of individual instructions for the 48 are not in the 51 list, at the moment I am having trouble with the instruction MOVP A,@A. What makes it worse is that I am just a dumb hardware Eng, thats left with the problem, Oh to get back to my soldering iron!
Any help would be appreciated. John Here's the description of the instruction from the datasheet. MOVP A, @ A Move Current Page Data to Accumulator (PC 0 – 7) <= (A); (A)<=((PC)); 2 cycles The contents of the Program Memory location addressed by the Accumulator is copied into the Accumulator. Only bits 0 – 7 of the Program Counter are affected. Therefore, the instruction is restricted to the current page. The Program Counter is restored after the operation. Note: If the instruction is located at address 255 of the current page then the next page is addressed with the Accumulator as offset. You might consider CLR A MOVC A,@A+PC Though I doubt this approach will work as well in an 805x, the architecture of which motivates one to use code memory a bit differently. In the 8048, when one wished to access a local-page-resident table, one loaded A with the base of the table, then added to that, the offset into the table, and only then would one retrieve the value. One example comes to mind in which I used this mechanism to convert a binary or BCD value to a 7-segment output, for example, where the subroutine ended with the table of possible 7-segment values. The subroutine was entered with the BCD value in A and ended by moving the 7-segment value to one of the working registers. The working registers contained the A more likely 805x way might be to use MOVC A, @A+DPTR with DPTR pointing to the table base. RE |
Topic | Author | Date |
Converting MCS 48 TO MCS 51 INSTRUCTIONS | 01/01/70 00:00 | |
Try to search in the internet | 01/01/70 00:00 | |
MSC 48 to MSC51 instructions | 01/01/70 00:00 | |
A link? | 01/01/70 00:00 | |
Previously, on 8052.com | 01/01/70 00:00 | |
Context | 01/01/70 00:00 | |
If I remember correctly ... | 01/01/70 00:00 | |
THIS one certainly won't work... | 01/01/70 00:00 | |
Did I forget something? | 01/01/70 00:00 | |
This is what happens... | 01/01/70 00:00 | |
'48 the jumps are never relative![]() | 01/01/70 00:00 |