CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How to use fancy 18Fxxxx indexing?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BadBrainBoy



Joined: 28 Apr 2005
Posts: 4

View user's profile Send private message

How to use fancy 18Fxxxx indexing?
PostPosted: Thu Apr 28, 2005 5:21 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Apr 29, 2005 9:03 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Fri Apr 29, 2005 9:24 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group