|
|
View previous topic :: View next topic |
Author |
Message |
GMP
Joined: 22 Sep 2003 Posts: 2 Location: Rosenberg, TX
|
How can I #ORG 0x0004? |
Posted: Fri Jan 16, 2004 5:10 pm |
|
|
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
|
|
Posted: Sat Jan 17, 2004 4:11 am |
|
|
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 |
|
|
|
|
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
|