| ??? 02/14/01 09:54 Read: times |
#9298 - RE: use of multiply in large data arrays |
Patrick,
Take a close look at the MOVC A,@A+DPTR instruction. You can even use a MOVC A,@A+PC command to read the base address from an immedate table (after small adjustment of the pointer to skip a RET instruction). Something like this in assembly language (I didn't bother debugging it). You can fix any sleep-induced bugs (late night here). ;input r1 = member number ;input r0 = member byte call fetch mov dpl,a mov a,r0 movc @a,a+dptr ret fetch: inc r1 ;adjust offset to skip RET mov a,r1 clr c rlc call lookup mov dph,a mov a,r1 inc a lookup: movc @a,a+pc ret dw 2000h dw 200Eh dw etc etc aka j |



