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 support@ccsinfo.com

Compile+Assembler

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



Joined: 27 Dec 2006
Posts: 8

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

Compile+Assembler
PostPosted: Sun Feb 25, 2007 6:33 am     Reply with quote

I am working to a PLC project that uses a PIC18F6680.

To speed up the code execution that resolve the PLC logical equations i need to write it in machine language.

Then I have written an assembler that run on the PC and constructs the machine code from an electrical schematic.
For obvious reasons of compactness and speed this part of assembled code use the BSR and FSR INDF registers.
This code is inserted at run time (by mean CANBUS) in a FLASH reserved region.
This code is called from main by means of one CALL instruction.

Now I ask a question: is this system safe beacuse the FSR and BSR values vary outside of the compiler control?
SimpleAsPossible



Joined: 19 Jun 2004
Posts: 21

View user's profile Send private message

One thought
PostPosted: Mon Feb 26, 2007 7:41 pm     Reply with quote

You could treat it like an interrupt, and save those values at the beginning of your function, then restore them before you return.
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