- FAE/Client Login
- product registration
- > Download <
- Our products
- Support
- FAQs
- technical support
- Installation
- Application Notes
- Device List
- Hints and Tips
- C38 - Special Page Access
- C6805 - Filling Unused ROM
- C6805 - Setting Multiple MORs
- C6805 - Working with MMEVS05/MMDS05
- C6808 and Emulators
- COP8C - Executing Initialization Code
- COP8C - S Register Support
- Debugging: Using Macros to Monitor Program Flow
- Declaring SPECIAL Memory
- eTPU - Function Set Support
- LCD Interface
- LOCAL Memory
- Low Cost, Low Speed A/D conversion for Embedded Systems
- MPC - Branch Islands on the PIC16C5x
- MPC - Constant ROM Arrays
- MPC - Named Address Space
- MPC - Setting Configuration Fuses
- Non-linear Data Transformations
- Using the CodeWright(TM) Editor
- Product-specific Notes
- Resources
- CODSupport
- Fixed Point
- Fuzzy Logic
- Publishing
- What's New
- About Us
- more information
C6805 - Filling Unused ROM
It is possible to fill an area of the 6805's ROM with a particular value and set an interrupt vector to point to the initialization at the start of the program which comes before the main() function. This method can easily be extended to use any value or series of values.
/* Assembler instructions to fill ROM from 0200 to 1FFB */
#define ROMSTART 0x0200
#define ROMSIZE 0x1E00
#asm
opt -l ; Turn listing off
org ROMSTART
rept ROMSIZE
swi
endm
opt +l ; Turn listing back on
#endasm
#pragma memory ROMPROG [2] @ 0x1ffc ;
#asm
fdb __MAIN
#endasm
/* Configuration for the rest of the program */
#pragma mori @ 0x1fdf = 00;
#pragma memory ROMPROG [ROMSIZE] @ ROMSTART ;
#pragma memory RAMPAGE0 [176] @ 0x0050 ;
#pragma vector __RESET @ 0x1ffe ;
#pragma vector __SWI @ 0x1ffc ;
#pragma has STOP ;
#pragma has WAIT ;
#pragma has MUL ;
int i = 12;
void main (void) { }

eTPU_C:
C6808: