参考设计AN3730
附方法:
/**
Copyright (c) 2008 Freescale Semiconductor
\file main.c
\brief Code example for allocating functions in local and in banked memory in S08 devices
\author Freescale Semiconductor
\author Rick Li
\author Technical Information Center
\version 1.0
\date 01/May/2008
\warning
*/
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
#pragma CODE_SEG NON_BANKED
void __near NearFunction(void);
#pragma CODE_SEG DEFAULT
#pragma CODE_SEG PAGED_ROM
void __far FarFunction(void);
#pragma CODE_SEG DEFAULT
void main(void) {
EnableInterrupts; /* enable interrupts */
/* include your code here */
NearFunction();
FarFunction();
for(;;) {
__RESET_WATCHDOG(); /* feeds the dog */
} /* loop forever */
/* please make sure that you never leave main */
}
#pragma CODE_SEG NON_BANKED
void __near NearFunction(void){
}
#pragma CODE_SEG DEFAULT
#pragma CODE_SEG PAGED_ROM
void __far FarFunction(void){
}
#pragma CODE_SEG DEFAULT |