MAC,
Worked perfectly, moving things into zero page with the #pragma worked. Thanks to you all.
Having another crazy problem, the code below is a small project that results in an error C18000
Label not set, however, as you can see the label clearly is set. Am I having another zero page error here?
Thanks, Randall.
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
// memvar declarations
#pragma DATA_SEG __SHORT_SEG MY_ZEROPAGE
char flag1 = 0x01;
char soundop = 0xFF;
char modesave = 0x01;
char modeflag = 0x00;
// function prototype
int restore(void);
void main(void) {
EnableInterrupts; /* enable interrupts */
/* include your code here */
for(;
{
__RESET_WATCHDOG(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}
/* function for Restore sounds in operation */
#pragma DATA_SEG DEFAULT
restore(void){
asm (
brclr 7,flag1,rstor1; //for the special case of interrupting !error C
18000
rts;
rstor1:
lda modesave; //find mode when interrupted
sta modeflag; //restore the flag
lda soundop;
and #$07f; //if these all off, nothing was operating
bne rstor2; //b/ something on, go figure it out
rts
;
rstor2:
return 0;
}