View previous topic :: View next topic |
Author |
Message |
BadBrainBoy
Joined: 28 Apr 2005 Posts: 4
|
How to use fancy 18Fxxxx indexing? |
Posted: Thu Apr 28, 2005 5:21 pm |
|
|
I'm trying to write fast code for the 18F2220. It has three nice auto-incrementing indirect memory pointers, the INDFx and FSRx registers. But when I use constructs like x = *pRead++; I find that the compiler produces dumb code without the autoindexing, and only uses one of the pointer registers. My application has three queues, it would be perfect for using the three pointer registers with autoincrementing. Is there some way to make this happen, short of assembly coding? I have PCH version 3.190.
Thanks! |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Fri Apr 29, 2005 9:03 am |
|
|
If you can update your compiler, do so but it still may not take advantage of the newer addressing modes. I haven't checked.
It may be necessary to in-line the asm code yourself, especially if you can't update your compiler. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Apr 29, 2005 9:24 am |
|
|
You can always address the registers in C without resorting to asm. Now you will have to try the ++,-- operations on the INDF regs to see if CCS optimizes them and uses the 18's instructions. |
|
|
|