C6805 - Filling Unused ROM

C6805

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) {           }