- 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 - Setting Multiple MORs
C6805 uses #pragma MOR or #pragma MORI to set a Mask Option Register in ROM. This register controls some 6805 features. Recent C6805 variations have multiple MOR's. To ensure the second MOR is initialized first at run-time, move the line that sets it from main() to a function called __STARTUP().
#pragma option v;
#pragma memory ROMPROG [8192] @ 0x0100;
#pragma memory RAMPAGE0 [176] @ 0x0050;
#pragma vector __RESET @ 0x3ffe;
#define mor1 0x3abc
#define mor1value 29
#pragma mor @ mor1 = mor1value;
#pragma portrw mor1_ @ mor1;
#define xyz 0x54
char q;
#pragma mor @ 0x1234 = xyz;
#pragma mor @ 0x4567 = &q + 5;
#pragma mori @ 0x3fdf = 0x54;
#define mor1 0x3abc
#define mor1value 29
char i;
void main (void)
{
_mor1 = mor1value;
NOP();
i = _mor1 ;
}

eTPU_C:
C6808: