| ??? 11/23/98 20:13 Read: times |
#66 - RE: Indirect access to SFR |
If you're trying this by indirect adressing, high internal RAM (0x80-0xff) data will be returned. SFR's can only be accessed directly. I suggest to use a jump table, where R7 is an index.
First, you have to calculate jump entry. MOV A,R7 ANL A,#7FH ;80h is index 0 MOV B,#3 ;multiply a*3 MUL AB ADD A,#LOW RTAB MOV DPL,A ADDC A,#HIGH RTAB MOV DPH,A CLR A JMP @A+DPTR RTAB: MOV R7,080H RET MOV R7,081H RET MOV R7,082H RET ... ... MOV R7,0FFH RET Code size is approx. 400 bytes and routine is realy fast. |
| Topic | Author | Date |
| Indirect access to SFR | 01/01/70 00:00 | |
| RE: Indirect access to SFR | 01/01/70 00:00 | |
RE: Indirect access to SFR | 01/01/70 00:00 |



