---  E:\3.46\pic18-lt\cxx-framework\src\traditional\proc\p18f1220.asm  ---------------------------
   11A    0E00     MOVLW 0
   11C    6EF3     MOVWF 0xff3, ACCESS
   11E    EE00     LFSR 0, 0
   120    F000     NOP
   122    0E01     MOVLW 0x1
   124    D801     RCALL 0x128
   126    0012     RETURN 0
   128    60EA     CPFSLT 0xfea, ACCESS
   12A    D002     BRA 0x130
   12C    6AEE     CLRF 0xfee, ACCESS
   12E    D7FC     BRA 0x128
   130    50F3     MOVF 0xff3, W, ACCESS
   132    60E9     CPFSLT 0xfe9, ACCESS
   134    0012     RETURN 0
   136    6AEE     CLRF 0xfee, ACCESS
   138    D7FC     BRA 0x132
---  E:\3.46\pic18-lt\cxx-framework\src\traditional\startup\c018i.c  -----------------------------
   000    EF9D     GOTO 0x13a
   002    F000     NOP
   004    0012     RETURN 0
   13A    EE10     LFSR 0x1, 0x80
   13C    F080     NOP
   13E    EE20     LFSR 0x2, 0x80
   140    F080     NOP
   142    6AF8     CLRF 0xff8, ACCESS
   144    9C01     BCF 0x1, 0x6, ACCESS
   146    EC07     CALL 0xe, 0
   148    F000     NOP
   14A    ECAB     CALL 0x156, 0
   14C    F000     NOP
   14E    EC56     CALL 0xac, 0
   150    F000     NOP
   152    D7FB     BRA 0x14a
   154    0012     RETURN 0
   00E    0E06     MOVLW 0x6
   010    6EF6     MOVWF 0xff6, ACCESS
   012    0E00     MOVLW 0
   014    6EF7     MOVWF 0xff7, ACCESS
   016    0E00     MOVLW 0
   018    6EF8     MOVWF 0xff8, ACCESS
   01A    0100     MOVLB 0
   01C    0009     TBLRD*+
   01E    50F5     MOVF 0xff5, W, ACCESS
   020    6FC5     MOVWF 0xc5, BANKED
   022    0009     TBLRD*+
   024    50F5     MOVF 0xff5, W, ACCESS
   026    6FC6     MOVWF 0xc6, BANKED
   028    E103     BNZ 0x30
   02A    67C5     TSTFSZ 0xc5, BANKED
   02C    D001     BRA 0x30
   02E    D03D     BRA 0xaa
   030    0009     TBLRD*+
   032    50F5     MOVF 0xff5, W, ACCESS
   034    6FC0     MOVWF 0xc0, BANKED
   036    0009     TBLRD*+
   038    50F5     MOVF 0xff5, W, ACCESS
   03A    6FC1     MOVWF 0xc1, BANKED
   03C    0009     TBLRD*+
   03E    50F5     MOVF 0xff5, W, ACCESS
   040    6FC2     MOVWF 0xc2, BANKED
   042    0009     TBLRD*+
   044    0009     TBLRD*+
   046    50F5     MOVF 0xff5, W, ACCESS
   048    6EE9     MOVWF 0xfe9, ACCESS
   04A    0009     TBLRD*+
   04C    50F5     MOVF 0xff5, W, ACCESS
   04E    6EEA     MOVWF 0xfea, ACCESS
   050    0009     TBLRD*+
   052    0009     TBLRD*+
   054    0009     TBLRD*+
   056    50F5     MOVF 0xff5, W, ACCESS
   058    6FC3     MOVWF 0xc3, BANKED
   05A    0009     TBLRD*+
   05C    50F5     MOVF 0xff5, W, ACCESS
   05E    6FC4     MOVWF 0xc4, BANKED
   060    0009     TBLRD*+
   062    0009     TBLRD*+
   064    CFF6     MOVFF 0xff6, 0xc7
   066    F0C7     NOP
   068    CFF7     MOVFF 0xff7, 0xc8
   06A    F0C8     NOP
   06C    CFF8     MOVFF 0xff8, 0xc9
   06E    F0C9     NOP
   070    C0C0     MOVFF 0xc0, 0xff6
   072    FFF6     NOP
   074    C0C1     MOVFF 0xc1, 0xff7
   076    FFF7     NOP
   078    C0C2     MOVFF 0xc2, 0xff8
   07A    FFF8     NOP
   07C    0100     MOVLB 0
   07E    53C3     MOVF 0xc3, F, BANKED
   080    E102     BNZ 0x86
   082    53C4     MOVF 0xc4, F, BANKED
   084    E007     BZ 0x94
   086    0009     TBLRD*+
   088    50F5     MOVF 0xff5, W, ACCESS
   08A    6EEE     MOVWF 0xfee, ACCESS
   08C    07C3     DECF 0xc3, F, BANKED
   08E    E2F8     BC 0x80
   090    07C4     DECF 0xc4, F, BANKED
   092    D7F9     BRA 0x86
   094    C0C7     MOVFF 0xc7, 0xff6
   096    FFF6     NOP
   098    C0C8     MOVFF 0xc8, 0xff7
   09A    FFF7     NOP
   09C    C0C9     MOVFF 0xc9, 0xff8
   09E    FFF8     NOP
   0A0    0100     MOVLB 0
   0A2    07C5     DECF 0xc5, F, BANKED
   0A4    0E00     MOVLW 0
   0A6    5BC6     SUBWFB 0xc6, F, BANKED
   0A8    D7BF     BRA 0x28
   0AA    0012     RETURN 0
---  E:\3.46\pic18-lt\cxx-framework\src\traditional\stdclib\__init.c  ----------------------------
   156    0012     RETURN 0
---  L:\Microchip\PIC\Projects\Reko\PIC18\main.c  ------------------------------------------------
1:                 //=============================================================================
2:                 // Filename: MAIN.C
3:                 //=============================================================================
4:                 //=============================================================================
5:                 // Compiled using MPLAB-C18 V3.47
6:                 // Include Files: P18F1220.H
7:                 //=============================================================================
8:                 //
9:                 // Example code to generate a TMR0 interrupt and toggle LEDs on pins RB0 and
10:                // RB7. Toggles RB0 in the interrupt routine and sets RB7 to match RB0 in the
11:                // main routine. This demonstrates that code is executing in both routines.
12:                //
13:                //=============================================================================
14:                
15:                //----------------------------------------------------------------------------
16:                
17:                #include <p18cxxx.h>
18:                
19:                #pragma config OSC = HS
20:                
21:                //----------------------------------------------------------------------------
22:                
23:                void main (void);
24:                void doloop (char flag);
25:                void InterruptHandlerHigh (void);
26:                
27:                union
28:                {
29:                  struct
30:                  {
31:                    unsigned Timeout:1;         // flag to indicate a TMR0 timeout
32:                    unsigned None:7;
33:                  } Bit;
34:                  unsigned char Byte;
35:                } Flags;
36:                
37:                //----------------------------------------------------------------------------
38:                // Main routine
39:                
40:                void main ()
41:                {
42:                  Flags.Byte = 0;
   0AC    0100     MOVLB 0
   0AE    6BCA     CLRF 0xca, BANKED
43:                  INTCON = 0x20;                //disable global and enable TMR0 interrupt
   0B0    0E20     MOVLW 0x20
   0B2    6EF2     MOVWF 0xff2, ACCESS
44:                  INTCON2 = 0x84;               //TMR0 high priority
   0B4    0E84     MOVLW 0x84
   0B6    6EF1     MOVWF 0xff1, ACCESS
45:                  RCONbits.IPEN = 1;            //enable priority levels
   0B8    8ED0     BSF 0xfd0, 0x7, ACCESS
46:                  TMR0H = 0;                    //clear timer
   0BA    6AD7     CLRF 0xfd7, ACCESS
47:                  TMR0L = 0;                    //clear timer
   0BC    6AD6     CLRF 0xfd6, ACCESS
48:                  T0CON = 0x82;                 //set up timer0 - prescaler 1:8
   0BE    0E82     MOVLW 0x82
   0C0    6ED5     MOVWF 0xfd5, ACCESS
49:                  INTCONbits.GIEH = 1;          //enable interrupts
   0C2    8EF2     BSF 0xff2, 0x7, ACCESS
50:                  TRISB = 0;
   0C4    6A93     CLRF 0xf93, ACCESS
51:                
52:                  doloop(1);
   0C6    0E01     MOVLW 0x1
   0C8    6EE6     MOVWF 0xfe6, ACCESS
   0CA    D802     RCALL 0xd0
   0CC    52E5     MOVF 0xfe5, F, ACCESS
53:                
54:                }
   0CE    0012     RETURN 0
55:                
56:                void doloop(char loop)
   0D0    CFD9     MOVFF 0xfd9, 0xfe6
   0D2    FFE6     NOP
   0D4    CFE1     MOVFF 0xfe1, 0xfd9
   0D6    FFD9     NOP
57:                {
58:                while (loop)
   0D8    0EFE     MOVLW 0xfe
   0DA    50DB     MOVF 0xfdb, W, ACCESS
   0DC    E00B     BZ 0xf4
   0F2    D7F2     BRA 0xd8
59:                    {
60:                      if (Flags.Bit.Timeout == 1)
   0DE    0100     MOVLB 0
   0E0    A1CA     BTFSS 0xca, 0, BANKED
   0E2    D007     BRA 0xf2
61:                        {                                  //timeout?
62:                          Flags.Bit.Timeout = 0;           //clear timeout indicor
   0E4    91CA     BCF 0xca, 0, BANKED
63:                          LATBbits.LATB7 = LATBbits.LATB0; //copy LED state from RB0 to RB7
   0E6    508A     MOVF 0xf8a, W, ACCESS
   0E8    0B01     ANDLW 0x1
   0EA    E002     BZ 0xf0
   0EC    8E8A     BSF 0xf8a, 0x7, ACCESS
   0EE    D001     BRA 0xf2
   0F0    9E8A     BCF 0xf8a, 0x7, ACCESS
64:                        }
65:                    }
66:                
67:                }
   0F4    52E5     MOVF 0xfe5, F, ACCESS
   0F6    CFE7     MOVFF 0xfe7, 0xfd9
   0F8    FFD9     NOP
   0FA    0012     RETURN 0
68:                
69:                //----------------------------------------------------------------------------
70:                // High priority interrupt vector
71:                
72:                #pragma code InterruptVectorHigh = 0x08
73:                void InterruptVectorHigh (void)
74:                {
75:                  _asm
76:                    goto InterruptHandlerHigh //jump to interrupt routine
   008    EF7E     GOTO 0xfc
   00A    F000     NOP
77:                  _endasm
78:                }
   00C    0012     RETURN 0
79:                
80:                //----------------------------------------------------------------------------
81:                // High priority interrupt routine
82:                
83:                #pragma code
84:                #pragma interrupt InterruptHandlerHigh
85:                
86:                void InterruptHandlerHigh ()
   0FC    CFDA     MOVFF 0xfda, 0xfe4
   0FE    FFE4     NOP
   100    CFE2     MOVFF 0xfe2, 0xfda
   102    FFDA     NOP
   104    52E6     MOVF 0xfe6, F, ACCESS
87:                {
88:                  if (INTCONbits.TMR0IF)
   106    A4F2     BTFSS 0xff2, 0x2, ACCESS
   108    D004     BRA 0x112
89:                    {                                   //check for TMR0 overflow
90:                      INTCONbits.TMR0IF = 0;            //clear interrupt flag
   10A    94F2     BCF 0xff2, 0x2, ACCESS
91:                      Flags.Bit.Timeout = 1;            //indicate timeout
   10C    0100     MOVLB 0
   10E    81CA     BSF 0xca, 0, BANKED
92:                      LATBbits.LATB0 = !LATBbits.LATB0; //toggle LED on RB0
   110    708A     BTG 0xf8a, 0, ACCESS
93:                    }
94:                }
   112    52E5     MOVF 0xfe5, F, ACCESS
   114    CFE5     MOVFF 0xfe5, 0xfda
   116    FFDA     NOP
   118    0011     RETFIE 0x1
