RDFAST/WRFAST - is there a current pointer we can access
Peter Jakacki
Posts: 10,193
Chip, I was looking at using RDFAST (and rfword/rflong etc)in my doNext loop but I need to be able to read the current position and save it so that I can change the address and then later restore it as well as when I need to read inline literals etc. Is there a register that we can access or can you make that register visible?
Comments
Seairth is going to have quiet words with me too ...
There's only a block counter that counts 16-long chunks on the other side of the FIFO.
I'll make a note to add this.
RDFAST and WRFAST establish hub FIFO modes for sequential reading and writing via RFxxxx/WFxxxx.
RDxxxx and WRxxxx are random access reads and writes and they use slots that the FIFO doesn't need.
Everyone else is distracting him from the smart pins, so you may as well also.
I'm super eager to see how those end up myself.
Could you even make a RDFAST that's only skipping a few bytes not even reload the FIFO?
Okay, the key info I hadn't seen, alongside the obvious not even knowing about RF/WF instructions, is that RFLONG, for example, unlike RDLONG, has no S operand - No specified HubRAM address. So, it clearly just takes whatever the FIFO is feeding it. Question answered.
Change FBLOCK into two instructions, one for read, RDFASTX (from http://forums.parallax.com/discussion/comment/1352094/#Comment_1352094), and one for write, WRFASTX, with the intent to allow a smooth regular transition back and forth between reading a block from HubRAM then writing another block back to HubRAM.
PS: This probably should be in Seairth's FDS topic.
No, it shouldn't. :P
It would save needing to do some kind of register increment for every RFxxxx/WFxxxx, but the only time I can see tracking being needed is when you don't know how much data you'll be reading or writing, like in the case of strings, maybe.
I can add this tracking counter, but to make it handle block wraps will require a lot more hardware than if it just increments by 1/2/4 on RFxxxx/WFxxxx.
How important is having a readable pointer?
So, not having to do discrete ADD's to keep track of RFxxxx's would, indeed, save you a lot of code/time?
GETPTR D - read the fast pointer into D
Relationship to RF... / WF... would be more clear, and length would be still under 8 chars to go well with tab stops in source.
Okay.
But GETFPTR looks more like {R,W}F{BYTE,WORD,LONG}. Since it's part of the FIFO, it should use FIFO naming conventions.
Recycling this old thread from before I joined ...
As I understand it, GETPTR returns hub address of the last RFxxxx/WFxxxx. I'm more interested in knowing the hub address of the next RFxxxx/WFxxxx, without any fiddling about, therefore I think it would be good to have a single instruction that could do this in the future.
Can GETPTR handle block wraps as it is now?
Just tried this code to see.
Docs need this to be included for sure.
I think it would be clearer if spreadsheet description of GETPTR were changed from to
Other spreadsheet/doc suggestions:
1. Add that _RET_ takes 0 extra cycles for XBYTE ($1FF on top of stack).
2. Amend $001F8..$001FF to $001FF in doc DEBUG INTERRUPT section.
Hi,
when I studied RFWORD these days, and wondered if it could be used to gain speed in a wordcode machine as a variant of TAQOZ, google found this thread. So Peter (are you perhaps reading this?) thought about it in 2015. But he did NOT use it in TAQOZ. Instead
rdword x,PTRA++
is used.
As far as I understand, there would be 2 advantages, if RFWORD would be used: PTRA would be freed and some speed gain should be possible. Is it much?
So, why didn't he do it?
Perhaps there are some thoughts about this?
Christof