here http://www.firewing.info/forum/viewtopic.php?f=12&t=200&p=1140&hilit=tablat#p1140 I've already put the problem that the PIC24 has worked, now for the core &H0020 the routine does not work and think I miss something.
- Code: Select all
private Function ROMReadByte(cAddr As ushort, idx as ushort) As Byte
#if _core = &H0018
dim addr as uinteger = cAddr + idx
asm
mov.w addr, w13
mov.w addr + 2, W0
mov.w WREG, _TBLPAG
tblrdl.b [w13++], w0
mov.b WREG, ROMReadByte
end asm
#elseif _core = &H0012
save(TABLEPTR)
TABLEPTR = cAddr + idx
asm
TBLRD *+
movff TABLAT, ROMReadByte
end asm
restore
#else
addr1 = cAddr + index
ReadByte = *(baddr1)
#endif
End Function
Can anyone give me a hand?