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
One thought
Posted: Mon Feb 26, 2007 7:41 pm
You could treat it like an interrupt, and save those values at the beginning of your function, then restore them before you return.
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