Hi Basil,

the LDF instruction can use absolute addressing "LDF A,$123456" or
indirect addressing "LDF A,[0x0123]". Indirect addressing reads a long
pointer (e.g. 0x12345) from 3 consecutive bytes at the indicated memory
location (e.g.  0x123). Both modes have an X or Y indexed variant.

If you need to read less than 64K from the upper 96K Flash ROM then
using a fixed absolute address with a 16bit index, e.g. "LDF
A,(0x123456,X)", might be a solution.

That's also a bit faster than indirect addressing.

Kind regards,

Thomas



On 04.03.20 19:04, Basil Hussain wrote:

Hi,

The easiest is probably to use ldf. It can only read a byte at a time,
so it is somewhat slow, and it needs the pointer at a fixed location in
memory (i.e. like a static or global variable) so it makes your function
non-reentrant.
Thanks for the advice, and for the comments you wrote in the far pointer
feature request (which I do believe is a worthy feature to include where
possible).



_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to