#pragma chip OB36S01A1, core 14, code 1024, ram 0x20 : 0x5F
#pragma stackLevels 4

#define INT_lgen_style
#define INT_rambank  0

/* Predefined:
  char W;
  char INDF, TMR0, PCL, STATUS, FSR, PORTA, PORTB;
  char OPTION, TRISA, TRISB;
  char PCLATH, INTCON;
  bit PS0, PS1, PS2, PSA, T0SE, T0CS, INTEDG, RBPU_;
  bit Carry, DC, Zero_, PD, TO, RP0, RP1, IRP;
  bit RBIF, INTF, T0IF, RBIE, INTE, T0IE, GIE;
  bit PA0, PA1;  // PCLATH
*/


#pragma char TMR0       @ 0x01
#pragma char PORTA      @ 0x05
#pragma char PORTB      @ 0x06
#pragma char ANSELA     @ 0x07
#pragma char ANSELB     @ 0x08
#pragma char T0RD       @ 0x09
#pragma char INTFS      @ 0x0C
#pragma char LVC        @ 0x0D
#pragma char WDTC       @ 0x0E
#pragma char PAM0       @ 0x0F

#pragma char PAM1       @ 0x10
#pragma char PBIM       @ 0x11
#pragma char DACCON     @ 0x12
#pragma char DAC0D      @ 0x13
#pragma char DAC1DL     @ 0x14
#pragma char DAC1DH     @ 0x15
#pragma char BCALC      @ 0x16
#pragma char BCALD      @ 0x17
#pragma char ADCCON     @ 0x18
#pragma char ADCCS      @ 0x19
#pragma char ADCDH      @ 0x1A
#pragma char ADCDL      @ 0x1B
#pragma char ADCSH      @ 0x1C
#pragma char RSTS       @ 0x1D
#pragma char TAKEY      @ 0x1F

#pragma char OPTION     @ 0x81
#pragma char TCON       @ 0x87
#pragma char TCON0      @ 0x87
#pragma char TMR1       @ 0x88
#pragma char T1RD       @ 0x89
#pragma char IOCAE      @ 0x8C
#pragma char IOCAES     @ 0x8D
#pragma char SCON0      @ 0x8E
#pragma char SCON1      @ 0x8F

#pragma char SRELL      @ 0x90
#pragma char SRELH      @ 0x91
#pragma char SBUF       @ 0x92
#pragma char IAPC       @ 0x93
#pragma char IAPAL      @ 0x94
#pragma char IAPAH      @ 0x95
#pragma char IAPDL      @ 0x96
#pragma char IAPDH      @ 0x97
#pragma char SWRES      @ 0x98

//-----------------------------------------------------
//GPIO
#pragma bit PA_0        @ PORTA.0
#pragma bit PA_1        @ PORTA.1
#pragma bit PA_2        @ PORTA.2
#pragma bit PA_3        @ PORTA.3
#pragma bit PA_4        @ PORTA.4
#pragma bit PA_5        @ PORTA.5
#pragma bit PA_6        @ PORTA.6
#pragma bit PA_7        @ PORTA.7

#pragma bit PB_0        @ PORTB.0

//-----------------------------------------------------
//Timer 0, 1
//#pragma bit T0SE      @ OPTION.4  //Compiler is pre-defined that can't be modified
//#pragma bit T0CS      @ OPTION.5  //Compiler is pre-defined that can't be modified
#pragma bit TR0         @ OPTION.7

#pragma bit T1SE        @ TCON.4
#pragma bit T1CS        @ TCON.5
#pragma bit TR1         @ TCON.7

//-----------------------------------------------------
//Interrupt control & Flag

#pragma bit SIE         @ INTCON.0
#pragma bit ADCIE       @ INTCON.1
//#pragma bit T0IF      @ INTCON.2  //Compiler is pre-defined that can't be modified
#pragma bit RAIE        @ INTCON.3
#pragma bit T1IE        @ INTCON.4
//#pragma bit T0IE      @ INTCON.5  //Compiler is pre-defined that can't be modified
#pragma bit WDTIE       @ INTCON.6
//#pragma bit GIE       @ INTCON.7  //Compiler is pre-defined that can't be modified

#pragma bit IOCAF0      @ INTFS.0
#pragma bit IOCAF1      @ INTFS.1
#pragma bit IOCAF2      @ INTFS.2
#pragma bit IOCAF3      @ INTFS.3
#pragma bit T1IF        @ INTFS.4
#pragma bit WDTIF       @ INTFS.5
#pragma bit ADCIF       @ INTFS.6
#pragma bit LVIF        @ INTFS.7

//-----------------------------------------------------
//Reset Flag
#pragma bit PORF        @ RSTS.0
#pragma bit LVRF        @ RSTS.1
#pragma bit WDTRF       @ RSTS.2
#pragma bit SWRF        @ RSTS.3

//-----------------------------------------------------
//UART
#pragma bit RXIF        @ SCON0.0
#pragma bit TXIF        @ SCON0.1
#pragma bit RB8         @ SCON0.2
#pragma bit TB8         @ SCON0.3
#pragma bit SM2         @ SCON0.5
#pragma bit SMOD        @ SCON0.6
#pragma bit SMS         @ SCON0.7

