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

How can I #ORG 0x0004?

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



Joined: 22 Sep 2003
Posts: 2
Location: Rosenberg, TX

View user's profile Send private message Visit poster's website

How can I #ORG 0x0004?
PostPosted: Fri Jan 16, 2004 5:10 pm     Reply with quote

I would like to place my own ASM code for the ISR handler.

i.e.

Code:
#ORG  0x0004    // this is the interrupt vector (all interrupts)
void isr_complete()
{
#asm
// store W and Status
  MOVWF W_TEMP
  SWAPF STATUS,W
  CLRF STATUS
  MOVWF STATUS_TEMP

// check that it is EXT
  BTFSS  INTCON,4
  GOTO   ISR_End
  BTFSS  INTCON,1
  GOTO   ISR_End 
.
.
ISR
.
.
ISR_End:
  MOVWF STATUS
  SWAPF W_TEMP,F
  SWAPF W_TEMP,W
  RETFIE
#endasm

}


Does anyone know how I can set the compiler so I do not get an 'out of range' error?

I do not want to do everything that PCM is doing. This is for a 16F876A.

Thanks,

Grant
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

PostPosted: Sat Jan 17, 2004 4:11 am     Reply with quote

Hi

Use the #int_global directive:

#int_global
void isr_complete()
{
...
}

Here, the compiler doesn't generate any code (just a single 'retfie' at the end, I think).

mfg
Felix
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