| ??? 01/06/03 03:34 Read: times |
#35736 - RE: 4 -> 16 ASM Michael @A+PC / Rob |
Rob:
"And the first instruction after movc a,@A+PC ,has to be RET," There is nothing that says that this type of instruction needs to be followed by a RET instruction. This instruction loads A as anticipated and merrily runs on to the next instruction. Only requirement is that there are obvious limits on the distance to the table and the length of the table that can be indexed!! You can see that I had used the labels to permit automatic assembly time calculation of the offset to apply to ACC to adjust to the beginning of the table. This technique is not so "new". I used to see it in code all the time way back when the 8051 was "new". Code memories were very small and it permitted very efficient lookup algorithms to be coded for small tables. Intel made this "weird" instruction specifically for use like this, among others. Michael Karas |



