#line 1 "INT.C" #line 1 "int.h" #line 1 "C:\C166\INC\REG167.H" sfr ADCIC = 0xFF98; sfr ADCON = 0xFFA0; sfr ADDAT = 0xFEA0; sfr ADEIC = 0xFF9A; sfr ADDAT2 = 0xF0A0; sbit ADST = ADCON^7; sbit ADBSY = ADCON^8; sbit ADWR = ADCON^9; sbit ADCIN = ADCON^10; sbit ADCRQ = ADCON^11; sbit ADCIE = ADCIC^6; sbit ADCIR = ADCIC^7; sbit ADEIE = ADEIC^6; sbit ADEIR = ADEIC^7; sfr CC0 = 0xFE80; sfr CC0IC = 0xFF78; sfr CC1 = 0xFE82; sfr CC1IC = 0xFF7A; sfr CC2 = 0xFE84; sfr CC2IC = 0xFF7C; sfr CC3 = 0xFE86; sfr CC3IC = 0xFF7E; sfr CC4 = 0xFE88; sfr CC4IC = 0xFF80; sfr CC5 = 0xFE8A; sfr CC5IC = 0xFF82; sfr CC6 = 0xFE8C; sfr CC6IC = 0xFF84; sfr CC7 = 0xFE8E; sfr CC7IC = 0xFF86; sfr CC8 = 0xFE90; sfr CC8IC = 0xFF88; sfr CC9 = 0xFE92; sfr CC9IC = 0xFF8A; sfr CC10 = 0xFE94; sfr CC10IC = 0xFF8C; sfr CC11 = 0xFE96; sfr CC11IC = 0xFF8E; sfr CC12 = 0xFE98; sfr CC12IC = 0xFF90; sfr CC13 = 0xFE9A; sfr CC13IC = 0xFF92; sfr CC14 = 0xFE9C; sfr CC14IC = 0xFF94; sfr CC15 = 0xFE9E; sfr CC15IC = 0xFF96; sfr CC16 = 0xFE60; sfr CC16IC = 0xF160; sfr CC17 = 0xFE62; sfr CC17IC = 0xF162; sfr CC18 = 0xFE64; sfr CC18IC = 0xF164; sfr CC19 = 0xFE66; sfr CC19IC = 0xF166; sfr CC20 = 0xFE68; sfr CC20IC = 0xF168; sfr CC21 = 0xFE6A; sfr CC21IC = 0xF16A; sfr CC22 = 0xFE6C; sfr CC22IC = 0xF16C; sfr CC23 = 0xFE6E; sfr CC23IC = 0xF16E; sfr CC24 = 0xFE70; sfr CC24IC = 0xF170; sfr CC25 = 0xFE72; sfr CC25IC = 0xF172; sfr CC26 = 0xFE74; sfr CC26IC = 0xF174; sfr CC27 = 0xFE76; sfr CC27IC = 0xF176; sfr CC28 = 0xFE78; sfr CC28IC = 0xF178; sfr CC29 = 0xFE7A; sfr CC29IC = 0xF184; sfr CC30 = 0xFE7C; sfr CC30IC = 0xF18C; sfr CC31 = 0xFE7E; sfr CC31IC = 0xF194; sfr CCM0 = 0xFF52; sfr CCM1 = 0xFF54; sfr CCM2 = 0xFF56; sfr CCM3 = 0xFF58; sfr CCM4 = 0xFF22; sfr CCM5 = 0xFF24; sfr CCM6 = 0xFF26; sfr CCM7 = 0xFF28; sfr T0 = 0xFE50; sfr T01CON = 0xFF50; sfr T0IC = 0xFF9C; sfr T0REL = 0xFE54; sfr T1 = 0xFE52; sfr T1IC = 0xFF9E; sfr T1REL = 0xFE56; sfr T7 = 0xF050; sfr T78CON = 0xFF20; sfr T7IC = 0xF17A; sfr T7REL = 0xF054; sfr T8 = 0xF052; sfr T8IC = 0xF17C; sfr T8REL = 0xF056; sbit CC0IR = CC0IC^7; sbit CC0IE = CC0IC^6; sbit CC1IR = CC1IC^7; sbit CC1IE = CC1IC^6; sbit CC2IR = CC2IC^7; sbit CC2IE = CC2IC^6; sbit CC3IR = CC3IC^7; sbit CC3IE = CC3IC^6; sbit CC4IR = CC4IC^7; sbit CC4IE = CC4IC^6; sbit CC5IR = CC5IC^7; sbit CC5IE = CC5IC^6; sbit CC6IR = CC6IC^7; sbit CC6IE = CC6IC^6; sbit CC7IR = CC7IC^7; sbit CC7IE = CC7IC^6; sbit CC8IR = CC8IC^7; sbit CC8IE = CC8IC^6; sbit CC9IR = CC9IC^7; sbit CC9IE = CC9IC^6; sbit CC10IR = CC10IC^7; sbit CC10IE = CC10IC^6; sbit CC11IR = CC11IC^7; sbit CC11IE = CC11IC^6; sbit CC12IR = CC12IC^7; sbit CC12IE = CC12IC^6; sbit CC13IR = CC13IC^7; sbit CC13IE = CC13IC^6; sbit CC14IR = CC14IC^7; sbit CC14IE = CC14IC^6; sbit CC15IR = CC15IC^7; sbit CC15IE = CC15IC^6; sbit CC16IR = CC16IC^7; sbit CC16IE = CC16IC^6; sbit CC17IR = CC17IC^7; sbit CC17IE = CC17IC^6; sbit CC18IR = CC18IC^7; sbit CC18IE = CC18IC^6; sbit CC19IR = CC19IC^7; sbit CC19IE = CC19IC^6; sbit CC20IR = CC20IC^7; sbit CC20IE = CC20IC^6; sbit CC21IR = CC21IC^7; sbit CC21IE = CC21IC^6; sbit CC22IR = CC22IC^7; sbit CC22IE = CC22IC^6; sbit CC23IR = CC23IC^7; sbit CC23IE = CC23IC^6; sbit CC24IR = CC24IC^7; sbit CC24IE = CC24IC^6; sbit CC25IR = CC25IC^7; sbit CC25IE = CC25IC^6; sbit CC26IR = CC26IC^7; sbit CC26IE = CC26IC^6; sbit CC27IR = CC27IC^7; sbit CC27IE = CC27IC^6; sbit CC28IR = CC28IC^7; sbit CC28IE = CC28IC^6; sbit CC29IR = CC29IC^7; sbit CC29IE = CC29IC^6; sbit CC30IR = CC30IC^7; sbit CC30IE = CC30IC^6; sbit CC31IR = CC31IC^7; sbit CC31IE = CC31IC^6; sbit ACC0 = CCM0^3; sbit ACC1 = CCM0^7; sbit ACC2 = CCM0^11; sbit ACC3 = CCM0^15; sbit ACC4 = CCM1^3; sbit ACC5 = CCM1^7; sbit ACC6 = CCM1^11; sbit ACC7 = CCM1^15; sbit ACC8 = CCM2^3; sbit ACC9 = CCM2^7; sbit ACC10 = CCM2^11; sbit ACC11 = CCM2^15; sbit ACC12 = CCM3^3; sbit ACC13 = CCM3^7; sbit ACC14 = CCM3^11; sbit ACC15 = CCM3^15; sbit ACC16 = CCM4^3; sbit ACC17 = CCM4^7; sbit ACC18 = CCM4^11; sbit ACC19 = CCM4^15; sbit ACC20 = CCM5^3; sbit ACC21 = CCM5^7; sbit ACC22 = CCM5^11; sbit ACC23 = CCM5^15; sbit ACC24 = CCM6^3; sbit ACC25 = CCM6^7; sbit ACC26 = CCM6^11; sbit ACC27 = CCM6^15; sbit ACC28 = CCM7^3; sbit ACC29 = CCM7^7; sbit ACC30 = CCM7^11; sbit ACC31 = CCM7^15; sbit T0IE = T0IC^6; sbit T0IR = T0IC^7; sbit T0M = T01CON^3; sbit T0R = T01CON^6; sbit T1IE = T1IC^6; sbit T1IR = T1IC^7; sbit T1M = T01CON^11; sbit T1R = T01CON^14; sbit T7IE = T7IC^6; sbit T7IR = T7IC^7; sbit T7M = T78CON^3; sbit T7R = T78CON^6; sbit T8IE = T8IC^6; sbit T8IR = T8IC^7; sbit T8M = T78CON^11; sbit T8R = T78CON^14; sfr CP = 0xFE10; sfr CSP = 0xFE08; sfr DPP0 = 0xFE00; sfr DPP1 = 0xFE02; sfr DPP2 = 0xFE04; sfr DPP3 = 0xFE06; sfr MDC = 0xFF0E; sfr MDH = 0xFE0C; sfr MDL = 0xFE0E; sfr ONES = 0xFF1E; sfr PSW = 0xFF10; sfr SP = 0xFE12; sfr STKOV = 0xFE14; sfr STKUN = 0xFE16; sfr SYSCON = 0xFF12; sfr TFR = 0xFFAC; sfr ZEROS = 0xFF1C; sfr BUSCON0 = 0xFF0C; sfr BUSCON1 = 0xFF14; sfr BUSCON2 = 0xFF16; sfr BUSCON3 = 0xFF18; sfr BUSCON4 = 0xFF1A; sfr ADDRSEL1 = 0xFE18; sfr ADDRSEL2 = 0xFE1A; sfr ADDRSEL3 = 0xFE1C; sfr ADDRSEL4 = 0xFE1E; sbit WRCFG = SYSCON^7; sbit CLKEN = SYSCON^8; sbit BYTDIS = SYSCON^9; sbit ROMEN = SYSCON^10; sbit SGTEN = SYSCON^11; sbit ROMS1 = SYSCON^12; sbit MDRIU = MDC^4; sbit N = PSW^0; sbit C = PSW^1; sbit V = PSW^2; sbit Z = PSW^3; sbit E = PSW^4; sbit MULIP = PSW^5; sbit USR0 = PSW^6; sbit HLDEN = PSW^10; sbit IEN = PSW^11; sbit RWDC0 = BUSCON0^4; sbit MTTC0 = BUSCON0^5; sbit ALECTL0 = BUSCON0^9; sbit BUSACT0 = BUSCON0^10; sbit RDYEN0 = BUSCON0^12; sbit RWDC1 = BUSCON1^4; sbit MTTC1 = BUSCON1^5; sbit ALECTL1 = BUSCON1^9; sbit BUSACT1 = BUSCON1^10; sbit RDYEN1 = BUSCON1^12; sbit CSREN1 = BUSCON1^14; sbit CSWEN1 = BUSCON1^15; sbit RWDC2 = BUSCON2^4; sbit MTTC2 = BUSCON2^5; sbit ALECTL2 = BUSCON2^9; sbit BUSACT2 = BUSCON2^10; sbit RDYEN2 = BUSCON2^12; sbit CSREN2 = BUSCON2^14; sbit CSWEN2 = BUSCON2^15; sbit RWDC3 = BUSCON3^4; sbit MTTC3 = BUSCON3^5; sbit ALECTL3 = BUSCON3^9; sbit BUSACT3 = BUSCON3^10; sbit RDYEN3 = BUSCON3^12; sbit CSREN3 = BUSCON3^14; sbit CSWEN3 = BUSCON3^15; sbit RWDC4 = BUSCON4^4; sbit MTTC4 = BUSCON4^5; sbit ALECTL4 = BUSCON4^9; sbit BUSACT4 = BUSCON4^10; sbit RDYEN4 = BUSCON4^12; sbit CSREN4 = BUSCON4^14; sbit CSWEN4 = BUSCON4^15; sbit ILLBUS = TFR^0; sbit ILLINA = TFR^1; sbit ILLOPA = TFR^2; sbit PRTFLT = TFR^3; sbit UNDOPC = TFR^7; sbit STKUF = TFR^13; sbit STKOF = TFR^14; sbit NMI = TFR^15; sfr EXICON = 0xF1C0; sfr ISNC = 0xF1DE; sbit RTCIE = ISNC^0; sbit RTCIR = ISNC^1; sbit PLLIE = ISNC^2; sbit PLLIR = ISNC^3; sfr PECC0 = 0xFEC0; sfr PECC1 = 0xFEC2; sfr PECC2 = 0xFEC4; sfr PECC3 = 0xFEC6; sfr PECC4 = 0xFEC8; sfr PECC5 = 0xFECA; sfr PECC6 = 0xFECC; sfr PECC7 = 0xFECE; sfr DP0L = 0xF100; sfr DP0H = 0xF102; sfr DP1L = 0xF104; sfr DP1H = 0xF106; sfr DP2 = 0xFFC2; sfr DP3 = 0xFFC6; sfr DP4 = 0xFFCA; sfr DP6 = 0xFFCE; sfr DP7 = 0xFFD2; sfr DP8 = 0xFFD6; sfr P0L = 0xFF00; sfr P0H = 0xFF02; sfr P1L = 0xFF04; sfr P1H = 0xFF06; sfr P2 = 0xFFC0; sfr P3 = 0xFFC4; sfr P4 = 0xFFC8; sfr P5 = 0xFFA2; sfr P6 = 0xFFCC; sfr P7 = 0xFFD0; sfr P8 = 0xFFD4; sfr ODP2 = 0xF1C2; sfr ODP3 = 0xF1C6; sfr ODP6 = 0xF1CE; sfr ODP7 = 0xF1D2; sfr ODP8 = 0xF1D6; sfr RP0H = 0xF108; sfr S0BG = 0xFEB4; sfr S0CON = 0xFFB0; sfr S0EIC = 0xFF70; sfr S0RBUF = 0xFEB2; sfr S0RIC = 0xFF6E; sfr S0TBUF = 0xFEB0; sfr S0TIC = 0xFF6C; sfr S0TBIC = 0xF19C; sbit S0STP = S0CON^3; sbit S0REN = S0CON^4; sbit S0PEN = S0CON^5; sbit S0FEN = S0CON^6; sbit S0OEN = S0CON^7; sbit S0PE = S0CON^8; sbit S0FE = S0CON^9; sbit S0OE = S0CON^10; sbit S0ODD = S0CON^12; sbit S0BRS = S0CON^13; sbit S0LB = S0CON^14; sbit S0R = S0CON^15; sbit S0TIE = S0TIC^6; sbit S0TIR = S0TIC^7; sbit S0TBIE = S0TBIC^6; sbit S0TBIR = S0TBIC^7; sbit S0RIE = S0RIC^6; sbit S0RIR = S0RIC^7; sbit S0EIE = S0EIC^6; sbit S0EIR = S0EIC^7; sfr SSCTIC = 0xFF72; sfr SSCRIC = 0xFF74; sfr SSCEIC = 0xFF76; sfr SSCTB = 0xF0B0; sfr SSCRB = 0xF0B2; sfr SSCBR = 0xF0B4; sfr SSCCON = 0xFFB2; sbit SSCHB = SSCCON^4; sbit SSCPH = SSCCON^5; sbit SSCPO = SSCCON^6; sbit SSCTE = SSCCON^8; sbit SSCTEN = SSCCON^8; sbit SSCRE = SSCCON^9; sbit SSCREN = SSCCON^9; sbit SSCPE = SSCCON^10; sbit SSCPEN = SSCCON^10; sbit SSCBE = SSCCON^11; sbit SSCBEN = SSCCON^11; sbit SSCBSY = SSCCON^12; sbit SSCMS = SSCCON^14; sbit SSCEN = SSCCON^15; sbit SSCTIR = SSCTIC^7; sbit SSCTIE = SSCTIC^6; sbit SSCRIR = SSCRIC^7; sbit SSCRIE = SSCRIC^6; sbit SSCEIR = SSCEIC^7; sbit SSCEIE = SSCEIC^6; sfr CAPREL = 0xFE4A; sfr CRIC = 0xFF6A; sfr T2 = 0xFE40; sfr T2CON = 0xFF40; sfr T2IC = 0xFF60; sfr T3 = 0xFE42; sfr T3CON = 0xFF42; sfr T3IC = 0xFF62; sfr T4 = 0xFE44; sfr T4CON = 0xFF44; sfr T4IC = 0xFF64; sfr T5 = 0xFE46; sfr T5CON = 0xFF46; sfr T5IC = 0xFF66; sfr T6 = 0xFE48; sfr T6CON = 0xFF48; sfr T6IC = 0xFF68; sfr WDT = 0xFEAE; sfr WDTCON = 0xFFAE; sbit CRIE = CRIC^6; sbit CRIR = CRIC^7; sbit T2R = T2CON^6; sbit T2UD = T2CON^7; sbit T2UDE = T2CON^8; sbit T2IE = T2IC^6; sbit T2IR = T2IC^7; sbit T3R = T3CON^6; sbit T3UD = T3CON^7; sbit T3UDE = T3CON^8; sbit T3OE = T3CON^9; sbit T3OTL = T3CON^10; sbit T3IE = T3IC^6; sbit T3IR = T3IC^7; sbit T4R = T4CON^6; sbit T4UD = T4CON^7; sbit T4UDE = T4CON^8; sbit T4IE = T4IC^6; sbit T4IR = T4IC^7; sbit T5R = T5CON^6; sbit T5UD = T5CON^7; sbit T5UDE = T5CON^8; sbit T5CLR = T5CON^14; sbit T5SC = T5CON^15; sbit T5IE = T5IC^6; sbit T5IR = T5IC^7; sbit T6R = T6CON^6; sbit T6UD = T6CON^7; sbit T6UDE = T6CON^8; sbit T6OE = T6CON^9; sbit T6OTL = T6CON^10; sbit T6SR = T6CON^15; sbit T6IE = T6IC^6; sbit T6IR = T6IC^7; sbit T0IN = P3^0; sbit T2IN = P3^7; sbit T3IN = P3^6; sbit T4IN = P3^5; sbit T5IN = P5^13; sbit T6IN = P5^12; sbit T2EUD = P5^15; sbit T3EUD = P3^4; sbit T4EUD = P5^14; sbit T5EUD = P5^11; sbit T6EUD = P5^10; sbit T3OUT = P3^3; sbit CAPIN = P3^2; sbit T6OUT = P3^1; sbit WDTIN = WDTCON^0; sbit WDTR = WDTCON^1; sfr PWMCON0 = 0xFF30; sfr PWMCON1 = 0xFF32; sfr PW0 = 0xFE30; sfr PW1 = 0xFE32; sfr PW2 = 0xFE34; sfr PW3 = 0xFE36; sfr PWMIC = 0xF17E; sfr PT0 = 0xF030; sfr PT1 = 0xF032; sfr PT2 = 0xF034; sfr PT3 = 0xF036; sfr PP0 = 0xF038; sfr PP1 = 0xF03A; sfr PP2 = 0xF03C; sfr PP3 = 0xF03E; sbit PTR0 = PWMCON0^0; sbit PTR1 = PWMCON0^1; sbit PTR2 = PWMCON0^2; sbit PTR3 = PWMCON0^3; sbit PTI0 = PWMCON0^4; sbit PTI1 = PWMCON0^5; sbit PTI2 = PWMCON0^6; sbit PTI3 = PWMCON0^7; sbit PIE0 = PWMCON0^8; sbit PIE1 = PWMCON0^9; sbit PIE2 = PWMCON0^10; sbit PIE3 = PWMCON0^11; sbit PIR0 = PWMCON0^12; sbit PIR1 = PWMCON0^13; sbit PIR2 = PWMCON0^14; sbit PIR3 = PWMCON0^15; sbit PEN0 = PWMCON1^0; sbit PEN1 = PWMCON1^1; sbit PEN2 = PWMCON1^2; sbit PEN3 = PWMCON1^3; sbit PM0 = PWMCON1^4; sbit PM1 = PWMCON1^5; sbit PM2 = PWMCON1^6; sbit PM3 = PWMCON1^7; sbit PB01 = PWMCON1^12; sbit PS2 = PWMCON1^14; sbit PS3 = PWMCON1^15; sbit PWMIR = PWMIC^7; sbit PWMIE = PWMIC^6; sfr XP0IC = 0xF186; sfr XP1IC = 0xF18E; sfr XP2IC = 0xF196; sfr XP3IC = 0xF19E; sbit XP0IR = XP0IC^7; sbit XP0IE = XP0IC^6; sbit XP1IR = XP1IC^7; sbit XP1IE = XP1IC^6; sbit XP2IR = XP2IC^7; sbit XP2IE = XP2IC^6; sbit XP3IR = XP3IC^7; sbit XP3IE = XP3IC^6; #line 6 "int.h" #line 1 "C:\C166\INC\ABSACC.H" #line 10 "C:\C166\INC\ABSACC.H" #line 13 "C:\C166\INC\ABSACC.H" #line 7 "int.h" #line 1 "C:\C166\INC\STDARG.H" typedef char *va_list; #line 8 "int.h" #line 1 "C:\C166\INC\STDLIB.H" #line 10 "C:\C166\INC\STDLIB.H" #line 12 "C:\C166\INC\STDLIB.H" typedef unsigned int size_t; typedef char wchar_t; extern int abs (int val); extern long labs (long val); extern double atof (void *s1); extern long atol (void *s1); extern int atoi (void *s1); extern int rand (void); extern void srand (unsigned int); #line 38 "C:\C166\INC\STDLIB.H" #line 44 "C:\C166\INC\STDLIB.H" extern void far *malloc (size_t size); extern void free (void far *p); extern void init_mempool (void far *p, size_t size); extern void far *realloc (void far *p, size_t size); extern void far *calloc (size_t size, size_t len); extern void xhuge *xmalloc (unsigned long size); extern void xhuge *xcalloc (unsigned long size, unsigned long len); extern void xhuge *xrealloc (void xhuge *p, unsigned long size); extern void xinit_mempool (void xhuge *p, unsigned long size); extern void xfree (void xhuge *p); #line 9 "int.h" #line 1 "C:\C166\INC\STDIO.H" #line 18 "C:\C166\INC\STDIO.H" #line 20 "C:\C166\INC\STDIO.H" extern char _getkey (void); extern char getchar (void); extern char ungetchar (char); extern char putchar (char); extern int printf (const char *, ...); extern int sprintf (char *, const char *, ...); extern int vprintf (const char *, char *); extern int vsprintf (char *, const char *, char *); extern char *gets (char *, unsigned int n); extern int scanf (const char *, ...); extern int sscanf (char *, const char *, ...); extern int puts (const char *); #line 10 "int.h" #line 1 "C:\C166\INC\STRING.H" #line 10 "C:\C166\INC\STRING.H" #line 13 "C:\C166\INC\STRING.H" #line 15 "C:\C166\INC\STRING.H" #line 17 "C:\C166\INC\STRING.H" extern char *strcat (char *s1, char *s2); extern char *strncat (char *s1, char *s2, unsigned int n); extern int strcmp (char *s1, char *s2); extern int strncmp (char *s1, char *s2, unsigned int n); extern char *strcpy (char *s1, char *s2); extern char *strncpy (char *s1, char *s2, unsigned int n); extern size_t strlen (char *); extern char *strchr (char *s, char c); extern int strpos (char *s, char c); extern char *strrchr (char *s, char c); extern int strrpos (char *s, char c); extern int strspn (char *s, char *set); extern int strcspn (char *s, char *set); extern char *strpbrk (char *s, char *set); extern char *strrpbrk(char *s, char *set); extern int memcmp (void *s1, void *s2, unsigned int n); extern void *memcpy (void *s1, void *s2, unsigned int n); extern void *memchr (void *s, char val, unsigned int n); extern void *memccpy (void *s1, void *s2, char val, unsigned int n); extern void *memmove (void *s1, void *s2, unsigned int n); extern void *memset (void *s, char val, unsigned int n); extern char far *fstrcat (char far *s1, char far *s2); extern char far *fstrncat (char far *s1, char far *s2, unsigned int n); extern int fstrcmp (char far *s1, char far *s2); extern int fstrncmp (char far *s1, char far *s2, unsigned int n); extern char *fstrcpy (char far *s1, char far *s2); extern char *fstrncpy (char far *s1, char far *s2, unsigned int n); extern size_t fstrlen (char far *); extern char far *fstrchr (const char far *s, char c); extern char far *fstrrchr (const char far *s, char c); extern int fstrpos (const char far *s, char c); extern int fstrrpos (const char far *s, char c); extern int fstrspn (char far *s, char far *set); extern int fstrcspn (char far *s, char far *set); extern char *fstrpbrk (char far *s, char far *set); extern char *fstrrpbrk (char far *s, char far *set); extern int fmemcmp (void far *s1, void far *s2, unsigned int n); extern void far *fmemcpy (void far *s1, void far *s2, unsigned int n); extern void far *fmemchr (void far *s, char val, unsigned int n); extern void far *fmemccpy (void far *s1, void far *s2, char val, unsigned int n); extern void far *fmemmove (void far *s1, void far *s2, unsigned int n); extern void far *fmemset (void far *s, char val, unsigned int n); extern int xmemcmp (void xhuge *s1, void xhuge *s2, unsigned long n); extern void xhuge *xmemcpy (void xhuge *s1, void xhuge *s2, unsigned long n); extern void xhuge *xmemchr (void xhuge *s, char val, unsigned long n); extern void xhuge *xmemccpy (void xhuge *s1, void xhuge *s2, char val, unsigned long n); extern void xhuge *xmemmove (void xhuge *s1, void xhuge *s2, unsigned long n); extern void xhuge *xmemset (void xhuge *s, char val, unsigned long n); #line 11 "int.h" #line 1 "C:\C166\INC\MATH.H" extern int abs (int val); extern long labs (long val); extern double fabs (double val); extern double sqrt (double val); extern double exp (double val); extern double log (double val); extern double log10 (double val); extern double sin (double val); extern double cos (double val); extern double tan (double val); extern double asin (double val); extern double acos (double val); extern double atan (double val); extern double sinh (double val); extern double cosh (double val); extern double tanh (double val); extern double atan2 (double y, double x); extern double ceil (double val); extern double floor (double val); extern double modf (double val, double *n); extern double pow (double x, double y); extern unsigned int _chkfloat_ (float x); extern unsigned int _chkdouble_ (double x); #line 12 "int.h" #line 1 "global.h" sbit DP2_8 = DP2^8; sbit DP2_9 = DP2^9; sbit DP2_10 = DP2^10; sbit DP2_11 = DP2^11; sbit DP7_0 = DP7^0; sbit DP7_1 = DP7^1; sbit DP7_2 = DP7^2; sbit DP7_3 = DP7^3; sbit DP7_4 = DP7^4; sbit DP7_5 = DP7^5; sbit DP7_6 = DP7^6; sbit DP7_7 = DP7^7; sbit DP8_0 = DP8^0; sbit DP8_1 = DP8^1; sbit DP8_2 = DP8^2; sbit DP8_3 = DP8^3; sbit DP8_4 = DP8^4; sbit P2_8 = P2^8; sbit P2_9 = P2^9; sbit P2_10 = P2^10; sbit P2_11 = P2^11; sbit MOTORSWITCH = P8^4; #line 13 "int.h" #line 1 "util.h" #line 1 "C:\C166\INC\STDIO.H" #line 10 "C:\C166\INC\STDIO.H" #line 5 "util.h" #line 5 "util.h" #line 1 "C:\C166\INC\ABSACC.H" #line 10 "C:\C166\INC\ABSACC.H" #line 13 "C:\C166\INC\ABSACC.H" #line 6 "util.h" #line 1 "C:\C166\INC\INTRINS.H" void _nop_ (void); void _idle_ (void); void _srvwdt_ (void); void _pwrdn_ (void); void _diswdt_ (void); void _einit_ (void); void _bfld_ (unsigned int sfr_, unsigned mask1, unsigned mask2); void _trap_ (int intno); void _atomic_ (int n_instr); void _endatomic_ (void); unsigned int _sof_ (void huge *); #line 22 "C:\C166\INC\INTRINS.H" #line 24 "C:\C166\INC\INTRINS.H" bit _testclear_ (bit); bit _testset_ (bit); extern unsigned char _crol_ (unsigned char, int); extern unsigned int _irol_ (unsigned int, int); extern unsigned long _lrol_ (unsigned long, int); extern unsigned char _cror_ (unsigned char, int); extern unsigned int _iror_ (unsigned int, int); extern unsigned long _lror_ (unsigned long, int); #line 7 "util.h" #line 1 "C:\C166\INC\REG167.H" sfr ADCIC = 0xFF98; sfr ADCON = 0xFFA0; sfr ADDAT = 0xFEA0; sfr ADEIC = 0xFF9A; sfr ADDAT2 = 0xF0A0; sbit ADST = ADCON^7; sbit ADBSY = ADCON^8; sbit ADWR = ADCON^9; sbit ADCIN = ADCON^10; sbit ADCRQ = ADCON^11; sbit ADCIE = ADCIC^6; sbit ADCIR = ADCIC^7; sbit ADEIE = ADEIC^6; sbit ADEIR = ADEIC^7; sfr CC0 = 0xFE80; sfr CC0IC = 0xFF78; sfr CC1 = 0xFE82; sfr CC1IC = 0xFF7A; sfr CC2 = 0xFE84; sfr CC2IC = 0xFF7C; sfr CC3 = 0xFE86; sfr CC3IC = 0xFF7E; sfr CC4 = 0xFE88; sfr CC4IC = 0xFF80; sfr CC5 = 0xFE8A; sfr CC5IC = 0xFF82; sfr CC6 = 0xFE8C; sfr CC6IC = 0xFF84; sfr CC7 = 0xFE8E; sfr CC7IC = 0xFF86; sfr CC8 = 0xFE90; sfr CC8IC = 0xFF88; sfr CC9 = 0xFE92; sfr CC9IC = 0xFF8A; sfr CC10 = 0xFE94; sfr CC10IC = 0xFF8C; sfr CC11 = 0xFE96; sfr CC11IC = 0xFF8E; sfr CC12 = 0xFE98; sfr CC12IC = 0xFF90; sfr CC13 = 0xFE9A; sfr CC13IC = 0xFF92; sfr CC14 = 0xFE9C; sfr CC14IC = 0xFF94; sfr CC15 = 0xFE9E; sfr CC15IC = 0xFF96; sfr CC16 = 0xFE60; sfr CC16IC = 0xF160; sfr CC17 = 0xFE62; sfr CC17IC = 0xF162; sfr CC18 = 0xFE64; sfr CC18IC = 0xF164; sfr CC19 = 0xFE66; sfr CC19IC = 0xF166; sfr CC20 = 0xFE68; sfr CC20IC = 0xF168; sfr CC21 = 0xFE6A; sfr CC21IC = 0xF16A; sfr CC22 = 0xFE6C; sfr CC22IC = 0xF16C; sfr CC23 = 0xFE6E; sfr CC23IC = 0xF16E; sfr CC24 = 0xFE70; sfr CC24IC = 0xF170; sfr CC25 = 0xFE72; sfr CC25IC = 0xF172; sfr CC26 = 0xFE74; sfr CC26IC = 0xF174; sfr CC27 = 0xFE76; sfr CC27IC = 0xF176; sfr CC28 = 0xFE78; sfr CC28IC = 0xF178; sfr CC29 = 0xFE7A; sfr CC29IC = 0xF184; sfr CC30 = 0xFE7C; sfr CC30IC = 0xF18C; sfr CC31 = 0xFE7E; sfr CC31IC = 0xF194; sfr CCM0 = 0xFF52; sfr CCM1 = 0xFF54; sfr CCM2 = 0xFF56; sfr CCM3 = 0xFF58; sfr CCM4 = 0xFF22; sfr CCM5 = 0xFF24; sfr CCM6 = 0xFF26; sfr CCM7 = 0xFF28; sfr T0 = 0xFE50; sfr T01CON = 0xFF50; sfr T0IC = 0xFF9C; sfr T0REL = 0xFE54; sfr T1 = 0xFE52; sfr T1IC = 0xFF9E; sfr T1REL = 0xFE56; sfr T7 = 0xF050; sfr T78CON = 0xFF20; sfr T7IC = 0xF17A; sfr T7REL = 0xF054; sfr T8 = 0xF052; sfr T8IC = 0xF17C; sfr T8REL = 0xF056; sbit CC0IR = CC0IC^7; sbit CC0IE = CC0IC^6; sbit CC1IR = CC1IC^7; sbit CC1IE = CC1IC^6; sbit CC2IR = CC2IC^7; sbit CC2IE = CC2IC^6; sbit CC3IR = CC3IC^7; sbit CC3IE = CC3IC^6; sbit CC4IR = CC4IC^7; sbit CC4IE = CC4IC^6; sbit CC5IR = CC5IC^7; sbit CC5IE = CC5IC^6; sbit CC6IR = CC6IC^7; sbit CC6IE = CC6IC^6; sbit CC7IR = CC7IC^7; sbit CC7IE = CC7IC^6; sbit CC8IR = CC8IC^7; sbit CC8IE = CC8IC^6; sbit CC9IR = CC9IC^7; sbit CC9IE = CC9IC^6; sbit CC10IR = CC10IC^7; sbit CC10IE = CC10IC^6; sbit CC11IR = CC11IC^7; sbit CC11IE = CC11IC^6; sbit CC12IR = CC12IC^7; sbit CC12IE = CC12IC^6; sbit CC13IR = CC13IC^7; sbit CC13IE = CC13IC^6; sbit CC14IR = CC14IC^7; sbit CC14IE = CC14IC^6; sbit CC15IR = CC15IC^7; sbit CC15IE = CC15IC^6; sbit CC16IR = CC16IC^7; sbit CC16IE = CC16IC^6; sbit CC17IR = CC17IC^7; sbit CC17IE = CC17IC^6; sbit CC18IR = CC18IC^7; sbit CC18IE = CC18IC^6; sbit CC19IR = CC19IC^7; sbit CC19IE = CC19IC^6; sbit CC20IR = CC20IC^7; sbit CC20IE = CC20IC^6; sbit CC21IR = CC21IC^7; sbit CC21IE = CC21IC^6; sbit CC22IR = CC22IC^7; sbit CC22IE = CC22IC^6; sbit CC23IR = CC23IC^7; sbit CC23IE = CC23IC^6; sbit CC24IR = CC24IC^7; sbit CC24IE = CC24IC^6; sbit CC25IR = CC25IC^7; sbit CC25IE = CC25IC^6; sbit CC26IR = CC26IC^7; sbit CC26IE = CC26IC^6; sbit CC27IR = CC27IC^7; sbit CC27IE = CC27IC^6; sbit CC28IR = CC28IC^7; sbit CC28IE = CC28IC^6; sbit CC29IR = CC29IC^7; sbit CC29IE = CC29IC^6; sbit CC30IR = CC30IC^7; sbit CC30IE = CC30IC^6; sbit CC31IR = CC31IC^7; sbit CC31IE = CC31IC^6; sbit ACC0 = CCM0^3; sbit ACC1 = CCM0^7; sbit ACC2 = CCM0^11; sbit ACC3 = CCM0^15; sbit ACC4 = CCM1^3; sbit ACC5 = CCM1^7; sbit ACC6 = CCM1^11; sbit ACC7 = CCM1^15; sbit ACC8 = CCM2^3; sbit ACC9 = CCM2^7; sbit ACC10 = CCM2^11; sbit ACC11 = CCM2^15; sbit ACC12 = CCM3^3; sbit ACC13 = CCM3^7; sbit ACC14 = CCM3^11; sbit ACC15 = CCM3^15; sbit ACC16 = CCM4^3; sbit ACC17 = CCM4^7; sbit ACC18 = CCM4^11; sbit ACC19 = CCM4^15; sbit ACC20 = CCM5^3; sbit ACC21 = CCM5^7; sbit ACC22 = CCM5^11; sbit ACC23 = CCM5^15; sbit ACC24 = CCM6^3; sbit ACC25 = CCM6^7; sbit ACC26 = CCM6^11; sbit ACC27 = CCM6^15; sbit ACC28 = CCM7^3; sbit ACC29 = CCM7^7; sbit ACC30 = CCM7^11; sbit ACC31 = CCM7^15; sbit T0IE = T0IC^6; sbit T0IR = T0IC^7; sbit T0M = T01CON^3; sbit T0R = T01CON^6; sbit T1IE = T1IC^6; sbit T1IR = T1IC^7; sbit T1M = T01CON^11; sbit T1R = T01CON^14; sbit T7IE = T7IC^6; sbit T7IR = T7IC^7; sbit T7M = T78CON^3; sbit T7R = T78CON^6; sbit T8IE = T8IC^6; sbit T8IR = T8IC^7; sbit T8M = T78CON^11; sbit T8R = T78CON^14; sfr CP = 0xFE10; sfr CSP = 0xFE08; sfr DPP0 = 0xFE00; sfr DPP1 = 0xFE02; sfr DPP2 = 0xFE04; sfr DPP3 = 0xFE06; sfr MDC = 0xFF0E; sfr MDH = 0xFE0C; sfr MDL = 0xFE0E; sfr ONES = 0xFF1E; sfr PSW = 0xFF10; sfr SP = 0xFE12; sfr STKOV = 0xFE14; sfr STKUN = 0xFE16; sfr SYSCON = 0xFF12; sfr TFR = 0xFFAC; sfr ZEROS = 0xFF1C; sfr BUSCON0 = 0xFF0C; sfr BUSCON1 = 0xFF14; sfr BUSCON2 = 0xFF16; sfr BUSCON3 = 0xFF18; sfr BUSCON4 = 0xFF1A; sfr ADDRSEL1 = 0xFE18; sfr ADDRSEL2 = 0xFE1A; sfr ADDRSEL3 = 0xFE1C; sfr ADDRSEL4 = 0xFE1E; sbit WRCFG = SYSCON^7; sbit CLKEN = SYSCON^8; sbit BYTDIS = SYSCON^9; sbit ROMEN = SYSCON^10; sbit SGTEN = SYSCON^11; sbit ROMS1 = SYSCON^12; sbit MDRIU = MDC^4; sbit N = PSW^0; sbit C = PSW^1; sbit V = PSW^2; sbit Z = PSW^3; sbit E = PSW^4; sbit MULIP = PSW^5; sbit USR0 = PSW^6; sbit HLDEN = PSW^10; sbit IEN = PSW^11; sbit RWDC0 = BUSCON0^4; sbit MTTC0 = BUSCON0^5; sbit ALECTL0 = BUSCON0^9; sbit BUSACT0 = BUSCON0^10; sbit RDYEN0 = BUSCON0^12; sbit RWDC1 = BUSCON1^4; sbit MTTC1 = BUSCON1^5; sbit ALECTL1 = BUSCON1^9; sbit BUSACT1 = BUSCON1^10; sbit RDYEN1 = BUSCON1^12; sbit CSREN1 = BUSCON1^14; sbit CSWEN1 = BUSCON1^15; sbit RWDC2 = BUSCON2^4; sbit MTTC2 = BUSCON2^5; sbit ALECTL2 = BUSCON2^9; sbit BUSACT2 = BUSCON2^10; sbit RDYEN2 = BUSCON2^12; sbit CSREN2 = BUSCON2^14; sbit CSWEN2 = BUSCON2^15; sbit RWDC3 = BUSCON3^4; sbit MTTC3 = BUSCON3^5; sbit ALECTL3 = BUSCON3^9; sbit BUSACT3 = BUSCON3^10; sbit RDYEN3 = BUSCON3^12; sbit CSREN3 = BUSCON3^14; sbit CSWEN3 = BUSCON3^15; sbit RWDC4 = BUSCON4^4; sbit MTTC4 = BUSCON4^5; sbit ALECTL4 = BUSCON4^9; sbit BUSACT4 = BUSCON4^10; sbit RDYEN4 = BUSCON4^12; sbit CSREN4 = BUSCON4^14; sbit CSWEN4 = BUSCON4^15; sbit ILLBUS = TFR^0; sbit ILLINA = TFR^1; sbit ILLOPA = TFR^2; sbit PRTFLT = TFR^3; sbit UNDOPC = TFR^7; sbit STKUF = TFR^13; sbit STKOF = TFR^14; sbit NMI = TFR^15; sfr EXICON = 0xF1C0; sfr ISNC = 0xF1DE; sbit RTCIE = ISNC^0; sbit RTCIR = ISNC^1; sbit PLLIE = ISNC^2; sbit PLLIR = ISNC^3; sfr PECC0 = 0xFEC0; sfr PECC1 = 0xFEC2; sfr PECC2 = 0xFEC4; sfr PECC3 = 0xFEC6; sfr PECC4 = 0xFEC8; sfr PECC5 = 0xFECA; sfr PECC6 = 0xFECC; sfr PECC7 = 0xFECE; sfr DP0L = 0xF100; sfr DP0H = 0xF102; sfr DP1L = 0xF104; sfr DP1H = 0xF106; sfr DP2 = 0xFFC2; sfr DP3 = 0xFFC6; sfr DP4 = 0xFFCA; sfr DP6 = 0xFFCE; sfr DP7 = 0xFFD2; sfr DP8 = 0xFFD6; sfr P0L = 0xFF00; sfr P0H = 0xFF02; sfr P1L = 0xFF04; sfr P1H = 0xFF06; sfr P2 = 0xFFC0; sfr P3 = 0xFFC4; sfr P4 = 0xFFC8; sfr P5 = 0xFFA2; sfr P6 = 0xFFCC; sfr P7 = 0xFFD0; sfr P8 = 0xFFD4; sfr ODP2 = 0xF1C2; sfr ODP3 = 0xF1C6; sfr ODP6 = 0xF1CE; sfr ODP7 = 0xF1D2; sfr ODP8 = 0xF1D6; sfr RP0H = 0xF108; sfr S0BG = 0xFEB4; sfr S0CON = 0xFFB0; sfr S0EIC = 0xFF70; sfr S0RBUF = 0xFEB2; sfr S0RIC = 0xFF6E; sfr S0TBUF = 0xFEB0; sfr S0TIC = 0xFF6C; sfr S0TBIC = 0xF19C; sbit S0STP = S0CON^3; sbit S0REN = S0CON^4; sbit S0PEN = S0CON^5; sbit S0FEN = S0CON^6; sbit S0OEN = S0CON^7; sbit S0PE = S0CON^8; sbit S0FE = S0CON^9; sbit S0OE = S0CON^10; sbit S0ODD = S0CON^12; sbit S0BRS = S0CON^13; sbit S0LB = S0CON^14; sbit S0R = S0CON^15; sbit S0TIE = S0TIC^6; sbit S0TIR = S0TIC^7; sbit S0TBIE = S0TBIC^6; sbit S0TBIR = S0TBIC^7; sbit S0RIE = S0RIC^6; sbit S0RIR = S0RIC^7; sbit S0EIE = S0EIC^6; sbit S0EIR = S0EIC^7; sfr SSCTIC = 0xFF72; sfr SSCRIC = 0xFF74; sfr SSCEIC = 0xFF76; sfr SSCTB = 0xF0B0; sfr SSCRB = 0xF0B2; sfr SSCBR = 0xF0B4; sfr SSCCON = 0xFFB2; sbit SSCHB = SSCCON^4; sbit SSCPH = SSCCON^5; sbit SSCPO = SSCCON^6; sbit SSCTE = SSCCON^8; sbit SSCTEN = SSCCON^8; sbit SSCRE = SSCCON^9; sbit SSCREN = SSCCON^9; sbit SSCPE = SSCCON^10; sbit SSCPEN = SSCCON^10; sbit SSCBE = SSCCON^11; sbit SSCBEN = SSCCON^11; sbit SSCBSY = SSCCON^12; sbit SSCMS = SSCCON^14; sbit SSCEN = SSCCON^15; sbit SSCTIR = SSCTIC^7; sbit SSCTIE = SSCTIC^6; sbit SSCRIR = SSCRIC^7; sbit SSCRIE = SSCRIC^6; sbit SSCEIR = SSCEIC^7; sbit SSCEIE = SSCEIC^6; sfr CAPREL = 0xFE4A; sfr CRIC = 0xFF6A; sfr T2 = 0xFE40; sfr T2CON = 0xFF40; sfr T2IC = 0xFF60; sfr T3 = 0xFE42; sfr T3CON = 0xFF42; sfr T3IC = 0xFF62; sfr T4 = 0xFE44; sfr T4CON = 0xFF44; sfr T4IC = 0xFF64; sfr T5 = 0xFE46; sfr T5CON = 0xFF46; sfr T5IC = 0xFF66; sfr T6 = 0xFE48; sfr T6CON = 0xFF48; sfr T6IC = 0xFF68; sfr WDT = 0xFEAE; sfr WDTCON = 0xFFAE; sbit CRIE = CRIC^6; sbit CRIR = CRIC^7; sbit T2R = T2CON^6; sbit T2UD = T2CON^7; sbit T2UDE = T2CON^8; sbit T2IE = T2IC^6; sbit T2IR = T2IC^7; sbit T3R = T3CON^6; sbit T3UD = T3CON^7; sbit T3UDE = T3CON^8; sbit T3OE = T3CON^9; sbit T3OTL = T3CON^10; sbit T3IE = T3IC^6; sbit T3IR = T3IC^7; sbit T4R = T4CON^6; sbit T4UD = T4CON^7; sbit T4UDE = T4CON^8; sbit T4IE = T4IC^6; sbit T4IR = T4IC^7; sbit T5R = T5CON^6; sbit T5UD = T5CON^7; sbit T5UDE = T5CON^8; sbit T5CLR = T5CON^14; sbit T5SC = T5CON^15; sbit T5IE = T5IC^6; sbit T5IR = T5IC^7; sbit T6R = T6CON^6; sbit T6UD = T6CON^7; sbit T6UDE = T6CON^8; sbit T6OE = T6CON^9; sbit T6OTL = T6CON^10; sbit T6SR = T6CON^15; sbit T6IE = T6IC^6; sbit T6IR = T6IC^7; sbit T0IN = P3^0; sbit T2IN = P3^7; sbit T3IN = P3^6; sbit T4IN = P3^5; sbit T5IN = P5^13; sbit T6IN = P5^12; sbit T2EUD = P5^15; sbit T3EUD = P3^4; sbit T4EUD = P5^14; sbit T5EUD = P5^11; sbit T6EUD = P5^10; sbit T3OUT = P3^3; sbit CAPIN = P3^2; sbit T6OUT = P3^1; sbit WDTIN = WDTCON^0; sbit WDTR = WDTCON^1; sfr PWMCON0 = 0xFF30; sfr PWMCON1 = 0xFF32; sfr PW0 = 0xFE30; sfr PW1 = 0xFE32; sfr PW2 = 0xFE34; sfr PW3 = 0xFE36; sfr PWMIC = 0xF17E; sfr PT0 = 0xF030; sfr PT1 = 0xF032; sfr PT2 = 0xF034; sfr PT3 = 0xF036; sfr PP0 = 0xF038; sfr PP1 = 0xF03A; sfr PP2 = 0xF03C; sfr PP3 = 0xF03E; sbit PTR0 = PWMCON0^0; sbit PTR1 = PWMCON0^1; sbit PTR2 = PWMCON0^2; sbit PTR3 = PWMCON0^3; sbit PTI0 = PWMCON0^4; sbit PTI1 = PWMCON0^5; sbit PTI2 = PWMCON0^6; sbit PTI3 = PWMCON0^7; sbit PIE0 = PWMCON0^8; sbit PIE1 = PWMCON0^9; sbit PIE2 = PWMCON0^10; sbit PIE3 = PWMCON0^11; sbit PIR0 = PWMCON0^12; sbit PIR1 = PWMCON0^13; sbit PIR2 = PWMCON0^14; sbit PIR3 = PWMCON0^15; sbit PEN0 = PWMCON1^0; sbit PEN1 = PWMCON1^1; sbit PEN2 = PWMCON1^2; sbit PEN3 = PWMCON1^3; sbit PM0 = PWMCON1^4; sbit PM1 = PWMCON1^5; sbit PM2 = PWMCON1^6; sbit PM3 = PWMCON1^7; sbit PB01 = PWMCON1^12; sbit PS2 = PWMCON1^14; sbit PS3 = PWMCON1^15; sbit PWMIR = PWMIC^7; sbit PWMIE = PWMIC^6; sfr XP0IC = 0xF186; sfr XP1IC = 0xF18E; sfr XP2IC = 0xF196; sfr XP3IC = 0xF19E; sbit XP0IR = XP0IC^7; sbit XP0IE = XP0IC^6; sbit XP1IR = XP1IC^7; sbit XP1IE = XP1IC^6; sbit XP2IR = XP2IC^7; sbit XP2IE = XP2IC^6; sbit XP3IR = XP3IC^7; sbit XP3IE = XP3IC^6; #line 8 "util.h" sbit TxD = P3^10; sbit DTxD = DP3^10; sbit DRxD = DP3^11; extern void init_serial( unsigned int baud ); extern void wait_100mues(unsigned char Multiplikator); extern void wait_10ms(unsigned char Multiplikator); extern void init_lcd(void); extern void lcd_off(void); extern void lcd_on(unsigned char n); extern void lcd_clear(void); extern void lcd_setcursor(unsigned char z, unsigned char s); extern void lcd_putchar(unsigned char zeichen); extern void lcd_puts(unsigned char z, unsigned char s, char *a); extern unsigned char testkey( void ); extern unsigned char readkey( void ); extern void setDaysOfMonth( int month, int year ); #line 14 "int.h" #line 1 "astro.h" #line 1 "C:\C166\INC\REG167.H" sfr ADCIC = 0xFF98; sfr ADCON = 0xFFA0; sfr ADDAT = 0xFEA0; sfr ADEIC = 0xFF9A; sfr ADDAT2 = 0xF0A0; sbit ADST = ADCON^7; sbit ADBSY = ADCON^8; sbit ADWR = ADCON^9; sbit ADCIN = ADCON^10; sbit ADCRQ = ADCON^11; sbit ADCIE = ADCIC^6; sbit ADCIR = ADCIC^7; sbit ADEIE = ADEIC^6; sbit ADEIR = ADEIC^7; sfr CC0 = 0xFE80; sfr CC0IC = 0xFF78; sfr CC1 = 0xFE82; sfr CC1IC = 0xFF7A; sfr CC2 = 0xFE84; sfr CC2IC = 0xFF7C; sfr CC3 = 0xFE86; sfr CC3IC = 0xFF7E; sfr CC4 = 0xFE88; sfr CC4IC = 0xFF80; sfr CC5 = 0xFE8A; sfr CC5IC = 0xFF82; sfr CC6 = 0xFE8C; sfr CC6IC = 0xFF84; sfr CC7 = 0xFE8E; sfr CC7IC = 0xFF86; sfr CC8 = 0xFE90; sfr CC8IC = 0xFF88; sfr CC9 = 0xFE92; sfr CC9IC = 0xFF8A; sfr CC10 = 0xFE94; sfr CC10IC = 0xFF8C; sfr CC11 = 0xFE96; sfr CC11IC = 0xFF8E; sfr CC12 = 0xFE98; sfr CC12IC = 0xFF90; sfr CC13 = 0xFE9A; sfr CC13IC = 0xFF92; sfr CC14 = 0xFE9C; sfr CC14IC = 0xFF94; sfr CC15 = 0xFE9E; sfr CC15IC = 0xFF96; sfr CC16 = 0xFE60; sfr CC16IC = 0xF160; sfr CC17 = 0xFE62; sfr CC17IC = 0xF162; sfr CC18 = 0xFE64; sfr CC18IC = 0xF164; sfr CC19 = 0xFE66; sfr CC19IC = 0xF166; sfr CC20 = 0xFE68; sfr CC20IC = 0xF168; sfr CC21 = 0xFE6A; sfr CC21IC = 0xF16A; sfr CC22 = 0xFE6C; sfr CC22IC = 0xF16C; sfr CC23 = 0xFE6E; sfr CC23IC = 0xF16E; sfr CC24 = 0xFE70; sfr CC24IC = 0xF170; sfr CC25 = 0xFE72; sfr CC25IC = 0xF172; sfr CC26 = 0xFE74; sfr CC26IC = 0xF174; sfr CC27 = 0xFE76; sfr CC27IC = 0xF176; sfr CC28 = 0xFE78; sfr CC28IC = 0xF178; sfr CC29 = 0xFE7A; sfr CC29IC = 0xF184; sfr CC30 = 0xFE7C; sfr CC30IC = 0xF18C; sfr CC31 = 0xFE7E; sfr CC31IC = 0xF194; sfr CCM0 = 0xFF52; sfr CCM1 = 0xFF54; sfr CCM2 = 0xFF56; sfr CCM3 = 0xFF58; sfr CCM4 = 0xFF22; sfr CCM5 = 0xFF24; sfr CCM6 = 0xFF26; sfr CCM7 = 0xFF28; sfr T0 = 0xFE50; sfr T01CON = 0xFF50; sfr T0IC = 0xFF9C; sfr T0REL = 0xFE54; sfr T1 = 0xFE52; sfr T1IC = 0xFF9E; sfr T1REL = 0xFE56; sfr T7 = 0xF050; sfr T78CON = 0xFF20; sfr T7IC = 0xF17A; sfr T7REL = 0xF054; sfr T8 = 0xF052; sfr T8IC = 0xF17C; sfr T8REL = 0xF056; sbit CC0IR = CC0IC^7; sbit CC0IE = CC0IC^6; sbit CC1IR = CC1IC^7; sbit CC1IE = CC1IC^6; sbit CC2IR = CC2IC^7; sbit CC2IE = CC2IC^6; sbit CC3IR = CC3IC^7; sbit CC3IE = CC3IC^6; sbit CC4IR = CC4IC^7; sbit CC4IE = CC4IC^6; sbit CC5IR = CC5IC^7; sbit CC5IE = CC5IC^6; sbit CC6IR = CC6IC^7; sbit CC6IE = CC6IC^6; sbit CC7IR = CC7IC^7; sbit CC7IE = CC7IC^6; sbit CC8IR = CC8IC^7; sbit CC8IE = CC8IC^6; sbit CC9IR = CC9IC^7; sbit CC9IE = CC9IC^6; sbit CC10IR = CC10IC^7; sbit CC10IE = CC10IC^6; sbit CC11IR = CC11IC^7; sbit CC11IE = CC11IC^6; sbit CC12IR = CC12IC^7; sbit CC12IE = CC12IC^6; sbit CC13IR = CC13IC^7; sbit CC13IE = CC13IC^6; sbit CC14IR = CC14IC^7; sbit CC14IE = CC14IC^6; sbit CC15IR = CC15IC^7; sbit CC15IE = CC15IC^6; sbit CC16IR = CC16IC^7; sbit CC16IE = CC16IC^6; sbit CC17IR = CC17IC^7; sbit CC17IE = CC17IC^6; sbit CC18IR = CC18IC^7; sbit CC18IE = CC18IC^6; sbit CC19IR = CC19IC^7; sbit CC19IE = CC19IC^6; sbit CC20IR = CC20IC^7; sbit CC20IE = CC20IC^6; sbit CC21IR = CC21IC^7; sbit CC21IE = CC21IC^6; sbit CC22IR = CC22IC^7; sbit CC22IE = CC22IC^6; sbit CC23IR = CC23IC^7; sbit CC23IE = CC23IC^6; sbit CC24IR = CC24IC^7; sbit CC24IE = CC24IC^6; sbit CC25IR = CC25IC^7; sbit CC25IE = CC25IC^6; sbit CC26IR = CC26IC^7; sbit CC26IE = CC26IC^6; sbit CC27IR = CC27IC^7; sbit CC27IE = CC27IC^6; sbit CC28IR = CC28IC^7; sbit CC28IE = CC28IC^6; sbit CC29IR = CC29IC^7; sbit CC29IE = CC29IC^6; sbit CC30IR = CC30IC^7; sbit CC30IE = CC30IC^6; sbit CC31IR = CC31IC^7; sbit CC31IE = CC31IC^6; sbit ACC0 = CCM0^3; sbit ACC1 = CCM0^7; sbit ACC2 = CCM0^11; sbit ACC3 = CCM0^15; sbit ACC4 = CCM1^3; sbit ACC5 = CCM1^7; sbit ACC6 = CCM1^11; sbit ACC7 = CCM1^15; sbit ACC8 = CCM2^3; sbit ACC9 = CCM2^7; sbit ACC10 = CCM2^11; sbit ACC11 = CCM2^15; sbit ACC12 = CCM3^3; sbit ACC13 = CCM3^7; sbit ACC14 = CCM3^11; sbit ACC15 = CCM3^15; sbit ACC16 = CCM4^3; sbit ACC17 = CCM4^7; sbit ACC18 = CCM4^11; sbit ACC19 = CCM4^15; sbit ACC20 = CCM5^3; sbit ACC21 = CCM5^7; sbit ACC22 = CCM5^11; sbit ACC23 = CCM5^15; sbit ACC24 = CCM6^3; sbit ACC25 = CCM6^7; sbit ACC26 = CCM6^11; sbit ACC27 = CCM6^15; sbit ACC28 = CCM7^3; sbit ACC29 = CCM7^7; sbit ACC30 = CCM7^11; sbit ACC31 = CCM7^15; sbit T0IE = T0IC^6; sbit T0IR = T0IC^7; sbit T0M = T01CON^3; sbit T0R = T01CON^6; sbit T1IE = T1IC^6; sbit T1IR = T1IC^7; sbit T1M = T01CON^11; sbit T1R = T01CON^14; sbit T7IE = T7IC^6; sbit T7IR = T7IC^7; sbit T7M = T78CON^3; sbit T7R = T78CON^6; sbit T8IE = T8IC^6; sbit T8IR = T8IC^7; sbit T8M = T78CON^11; sbit T8R = T78CON^14; sfr CP = 0xFE10; sfr CSP = 0xFE08; sfr DPP0 = 0xFE00; sfr DPP1 = 0xFE02; sfr DPP2 = 0xFE04; sfr DPP3 = 0xFE06; sfr MDC = 0xFF0E; sfr MDH = 0xFE0C; sfr MDL = 0xFE0E; sfr ONES = 0xFF1E; sfr PSW = 0xFF10; sfr SP = 0xFE12; sfr STKOV = 0xFE14; sfr STKUN = 0xFE16; sfr SYSCON = 0xFF12; sfr TFR = 0xFFAC; sfr ZEROS = 0xFF1C; sfr BUSCON0 = 0xFF0C; sfr BUSCON1 = 0xFF14; sfr BUSCON2 = 0xFF16; sfr BUSCON3 = 0xFF18; sfr BUSCON4 = 0xFF1A; sfr ADDRSEL1 = 0xFE18; sfr ADDRSEL2 = 0xFE1A; sfr ADDRSEL3 = 0xFE1C; sfr ADDRSEL4 = 0xFE1E; sbit WRCFG = SYSCON^7; sbit CLKEN = SYSCON^8; sbit BYTDIS = SYSCON^9; sbit ROMEN = SYSCON^10; sbit SGTEN = SYSCON^11; sbit ROMS1 = SYSCON^12; sbit MDRIU = MDC^4; sbit N = PSW^0; sbit C = PSW^1; sbit V = PSW^2; sbit Z = PSW^3; sbit E = PSW^4; sbit MULIP = PSW^5; sbit USR0 = PSW^6; sbit HLDEN = PSW^10; sbit IEN = PSW^11; sbit RWDC0 = BUSCON0^4; sbit MTTC0 = BUSCON0^5; sbit ALECTL0 = BUSCON0^9; sbit BUSACT0 = BUSCON0^10; sbit RDYEN0 = BUSCON0^12; sbit RWDC1 = BUSCON1^4; sbit MTTC1 = BUSCON1^5; sbit ALECTL1 = BUSCON1^9; sbit BUSACT1 = BUSCON1^10; sbit RDYEN1 = BUSCON1^12; sbit CSREN1 = BUSCON1^14; sbit CSWEN1 = BUSCON1^15; sbit RWDC2 = BUSCON2^4; sbit MTTC2 = BUSCON2^5; sbit ALECTL2 = BUSCON2^9; sbit BUSACT2 = BUSCON2^10; sbit RDYEN2 = BUSCON2^12; sbit CSREN2 = BUSCON2^14; sbit CSWEN2 = BUSCON2^15; sbit RWDC3 = BUSCON3^4; sbit MTTC3 = BUSCON3^5; sbit ALECTL3 = BUSCON3^9; sbit BUSACT3 = BUSCON3^10; sbit RDYEN3 = BUSCON3^12; sbit CSREN3 = BUSCON3^14; sbit CSWEN3 = BUSCON3^15; sbit RWDC4 = BUSCON4^4; sbit MTTC4 = BUSCON4^5; sbit ALECTL4 = BUSCON4^9; sbit BUSACT4 = BUSCON4^10; sbit RDYEN4 = BUSCON4^12; sbit CSREN4 = BUSCON4^14; sbit CSWEN4 = BUSCON4^15; sbit ILLBUS = TFR^0; sbit ILLINA = TFR^1; sbit ILLOPA = TFR^2; sbit PRTFLT = TFR^3; sbit UNDOPC = TFR^7; sbit STKUF = TFR^13; sbit STKOF = TFR^14; sbit NMI = TFR^15; sfr EXICON = 0xF1C0; sfr ISNC = 0xF1DE; sbit RTCIE = ISNC^0; sbit RTCIR = ISNC^1; sbit PLLIE = ISNC^2; sbit PLLIR = ISNC^3; sfr PECC0 = 0xFEC0; sfr PECC1 = 0xFEC2; sfr PECC2 = 0xFEC4; sfr PECC3 = 0xFEC6; sfr PECC4 = 0xFEC8; sfr PECC5 = 0xFECA; sfr PECC6 = 0xFECC; sfr PECC7 = 0xFECE; sfr DP0L = 0xF100; sfr DP0H = 0xF102; sfr DP1L = 0xF104; sfr DP1H = 0xF106; sfr DP2 = 0xFFC2; sfr DP3 = 0xFFC6; sfr DP4 = 0xFFCA; sfr DP6 = 0xFFCE; sfr DP7 = 0xFFD2; sfr DP8 = 0xFFD6; sfr P0L = 0xFF00; sfr P0H = 0xFF02; sfr P1L = 0xFF04; sfr P1H = 0xFF06; sfr P2 = 0xFFC0; sfr P3 = 0xFFC4; sfr P4 = 0xFFC8; sfr P5 = 0xFFA2; sfr P6 = 0xFFCC; sfr P7 = 0xFFD0; sfr P8 = 0xFFD4; sfr ODP2 = 0xF1C2; sfr ODP3 = 0xF1C6; sfr ODP6 = 0xF1CE; sfr ODP7 = 0xF1D2; sfr ODP8 = 0xF1D6; sfr RP0H = 0xF108; sfr S0BG = 0xFEB4; sfr S0CON = 0xFFB0; sfr S0EIC = 0xFF70; sfr S0RBUF = 0xFEB2; sfr S0RIC = 0xFF6E; sfr S0TBUF = 0xFEB0; sfr S0TIC = 0xFF6C; sfr S0TBIC = 0xF19C; sbit S0STP = S0CON^3; sbit S0REN = S0CON^4; sbit S0PEN = S0CON^5; sbit S0FEN = S0CON^6; sbit S0OEN = S0CON^7; sbit S0PE = S0CON^8; sbit S0FE = S0CON^9; sbit S0OE = S0CON^10; sbit S0ODD = S0CON^12; sbit S0BRS = S0CON^13; sbit S0LB = S0CON^14; sbit S0R = S0CON^15; sbit S0TIE = S0TIC^6; sbit S0TIR = S0TIC^7; sbit S0TBIE = S0TBIC^6; sbit S0TBIR = S0TBIC^7; sbit S0RIE = S0RIC^6; sbit S0RIR = S0RIC^7; sbit S0EIE = S0EIC^6; sbit S0EIR = S0EIC^7; sfr SSCTIC = 0xFF72; sfr SSCRIC = 0xFF74; sfr SSCEIC = 0xFF76; sfr SSCTB = 0xF0B0; sfr SSCRB = 0xF0B2; sfr SSCBR = 0xF0B4; sfr SSCCON = 0xFFB2; sbit SSCHB = SSCCON^4; sbit SSCPH = SSCCON^5; sbit SSCPO = SSCCON^6; sbit SSCTE = SSCCON^8; sbit SSCTEN = SSCCON^8; sbit SSCRE = SSCCON^9; sbit SSCREN = SSCCON^9; sbit SSCPE = SSCCON^10; sbit SSCPEN = SSCCON^10; sbit SSCBE = SSCCON^11; sbit SSCBEN = SSCCON^11; sbit SSCBSY = SSCCON^12; sbit SSCMS = SSCCON^14; sbit SSCEN = SSCCON^15; sbit SSCTIR = SSCTIC^7; sbit SSCTIE = SSCTIC^6; sbit SSCRIR = SSCRIC^7; sbit SSCRIE = SSCRIC^6; sbit SSCEIR = SSCEIC^7; sbit SSCEIE = SSCEIC^6; sfr CAPREL = 0xFE4A; sfr CRIC = 0xFF6A; sfr T2 = 0xFE40; sfr T2CON = 0xFF40; sfr T2IC = 0xFF60; sfr T3 = 0xFE42; sfr T3CON = 0xFF42; sfr T3IC = 0xFF62; sfr T4 = 0xFE44; sfr T4CON = 0xFF44; sfr T4IC = 0xFF64; sfr T5 = 0xFE46; sfr T5CON = 0xFF46; sfr T5IC = 0xFF66; sfr T6 = 0xFE48; sfr T6CON = 0xFF48; sfr T6IC = 0xFF68; sfr WDT = 0xFEAE; sfr WDTCON = 0xFFAE; sbit CRIE = CRIC^6; sbit CRIR = CRIC^7; sbit T2R = T2CON^6; sbit T2UD = T2CON^7; sbit T2UDE = T2CON^8; sbit T2IE = T2IC^6; sbit T2IR = T2IC^7; sbit T3R = T3CON^6; sbit T3UD = T3CON^7; sbit T3UDE = T3CON^8; sbit T3OE = T3CON^9; sbit T3OTL = T3CON^10; sbit T3IE = T3IC^6; sbit T3IR = T3IC^7; sbit T4R = T4CON^6; sbit T4UD = T4CON^7; sbit T4UDE = T4CON^8; sbit T4IE = T4IC^6; sbit T4IR = T4IC^7; sbit T5R = T5CON^6; sbit T5UD = T5CON^7; sbit T5UDE = T5CON^8; sbit T5CLR = T5CON^14; sbit T5SC = T5CON^15; sbit T5IE = T5IC^6; sbit T5IR = T5IC^7; sbit T6R = T6CON^6; sbit T6UD = T6CON^7; sbit T6UDE = T6CON^8; sbit T6OE = T6CON^9; sbit T6OTL = T6CON^10; sbit T6SR = T6CON^15; sbit T6IE = T6IC^6; sbit T6IR = T6IC^7; sbit T0IN = P3^0; sbit T2IN = P3^7; sbit T3IN = P3^6; sbit T4IN = P3^5; sbit T5IN = P5^13; sbit T6IN = P5^12; sbit T2EUD = P5^15; sbit T3EUD = P3^4; sbit T4EUD = P5^14; sbit T5EUD = P5^11; sbit T6EUD = P5^10; sbit T3OUT = P3^3; sbit CAPIN = P3^2; sbit T6OUT = P3^1; sbit WDTIN = WDTCON^0; sbit WDTR = WDTCON^1; sfr PWMCON0 = 0xFF30; sfr PWMCON1 = 0xFF32; sfr PW0 = 0xFE30; sfr PW1 = 0xFE32; sfr PW2 = 0xFE34; sfr PW3 = 0xFE36; sfr PWMIC = 0xF17E; sfr PT0 = 0xF030; sfr PT1 = 0xF032; sfr PT2 = 0xF034; sfr PT3 = 0xF036; sfr PP0 = 0xF038; sfr PP1 = 0xF03A; sfr PP2 = 0xF03C; sfr PP3 = 0xF03E; sbit PTR0 = PWMCON0^0; sbit PTR1 = PWMCON0^1; sbit PTR2 = PWMCON0^2; sbit PTR3 = PWMCON0^3; sbit PTI0 = PWMCON0^4; sbit PTI1 = PWMCON0^5; sbit PTI2 = PWMCON0^6; sbit PTI3 = PWMCON0^7; sbit PIE0 = PWMCON0^8; sbit PIE1 = PWMCON0^9; sbit PIE2 = PWMCON0^10; sbit PIE3 = PWMCON0^11; sbit PIR0 = PWMCON0^12; sbit PIR1 = PWMCON0^13; sbit PIR2 = PWMCON0^14; sbit PIR3 = PWMCON0^15; sbit PEN0 = PWMCON1^0; sbit PEN1 = PWMCON1^1; sbit PEN2 = PWMCON1^2; sbit PEN3 = PWMCON1^3; sbit PM0 = PWMCON1^4; sbit PM1 = PWMCON1^5; sbit PM2 = PWMCON1^6; sbit PM3 = PWMCON1^7; sbit PB01 = PWMCON1^12; sbit PS2 = PWMCON1^14; sbit PS3 = PWMCON1^15; sbit PWMIR = PWMIC^7; sbit PWMIE = PWMIC^6; sfr XP0IC = 0xF186; sfr XP1IC = 0xF18E; sfr XP2IC = 0xF196; sfr XP3IC = 0xF19E; sbit XP0IR = XP0IC^7; sbit XP0IE = XP0IC^6; sbit XP1IR = XP1IC^7; sbit XP1IE = XP1IC^6; sbit XP2IR = XP2IC^7; sbit XP2IE = XP2IC^6; sbit XP3IR = XP3IC^7; sbit XP3IE = XP3IC^6; #line 5 "astro.h" #line 1 "C:\C166\INC\STDARG.H" #line 10 "C:\C166\INC\STDARG.H" #line 6 "astro.h" #line 6 "astro.h" #line 1 "C:\C166\INC\STDLIB.H" #line 10 "C:\C166\INC\STDLIB.H" #line 12 "C:\C166\INC\STDLIB.H" #line 14 "C:\C166\INC\STDLIB.H" #line 17 "C:\C166\INC\STDLIB.H" #line 19 "C:\C166\INC\STDLIB.H" #line 22 "C:\C166\INC\STDLIB.H" #line 24 "C:\C166\INC\STDLIB.H" #line 26 "C:\C166\INC\STDLIB.H" extern int abs (int val); extern long labs (long val); extern double atof (void *s1); extern long atol (void *s1); extern int atoi (void *s1); extern int rand (void); extern void srand (unsigned int); #line 38 "C:\C166\INC\STDLIB.H" #line 44 "C:\C166\INC\STDLIB.H" extern void far *malloc (size_t size); extern void free (void far *p); extern void init_mempool (void far *p, size_t size); extern void far *realloc (void far *p, size_t size); extern void far *calloc (size_t size, size_t len); extern void xhuge *xmalloc (unsigned long size); extern void xhuge *xcalloc (unsigned long size, unsigned long len); extern void xhuge *xrealloc (void xhuge *p, unsigned long size); extern void xinit_mempool (void xhuge *p, unsigned long size); extern void xfree (void xhuge *p); #line 7 "astro.h" #line 1 "C:\C166\INC\STDIO.H" #line 10 "C:\C166\INC\STDIO.H" #line 8 "astro.h" #line 8 "astro.h" #line 1 "C:\C166\INC\STRING.H" #line 10 "C:\C166\INC\STRING.H" #line 13 "C:\C166\INC\STRING.H" #line 15 "C:\C166\INC\STRING.H" #line 17 "C:\C166\INC\STRING.H" extern char *strcat (char *s1, char *s2); extern char *strncat (char *s1, char *s2, unsigned int n); extern int strcmp (char *s1, char *s2); extern int strncmp (char *s1, char *s2, unsigned int n); extern char *strcpy (char *s1, char *s2); extern char *strncpy (char *s1, char *s2, unsigned int n); extern size_t strlen (char *); extern char *strchr (char *s, char c); extern int strpos (char *s, char c); extern char *strrchr (char *s, char c); extern int strrpos (char *s, char c); extern int strspn (char *s, char *set); extern int strcspn (char *s, char *set); extern char *strpbrk (char *s, char *set); extern char *strrpbrk(char *s, char *set); extern int memcmp (void *s1, void *s2, unsigned int n); extern void *memcpy (void *s1, void *s2, unsigned int n); extern void *memchr (void *s, char val, unsigned int n); extern void *memccpy (void *s1, void *s2, char val, unsigned int n); extern void *memmove (void *s1, void *s2, unsigned int n); extern void *memset (void *s, char val, unsigned int n); extern char far *fstrcat (char far *s1, char far *s2); extern char far *fstrncat (char far *s1, char far *s2, unsigned int n); extern int fstrcmp (char far *s1, char far *s2); extern int fstrncmp (char far *s1, char far *s2, unsigned int n); extern char *fstrcpy (char far *s1, char far *s2); extern char *fstrncpy (char far *s1, char far *s2, unsigned int n); extern size_t fstrlen (char far *); extern char far *fstrchr (const char far *s, char c); extern char far *fstrrchr (const char far *s, char c); extern int fstrpos (const char far *s, char c); extern int fstrrpos (const char far *s, char c); extern int fstrspn (char far *s, char far *set); extern int fstrcspn (char far *s, char far *set); extern char *fstrpbrk (char far *s, char far *set); extern char *fstrrpbrk (char far *s, char far *set); extern int fmemcmp (void far *s1, void far *s2, unsigned int n); extern void far *fmemcpy (void far *s1, void far *s2, unsigned int n); extern void far *fmemchr (void far *s, char val, unsigned int n); extern void far *fmemccpy (void far *s1, void far *s2, char val, unsigned int n); extern void far *fmemmove (void far *s1, void far *s2, unsigned int n); extern void far *fmemset (void far *s, char val, unsigned int n); extern int xmemcmp (void xhuge *s1, void xhuge *s2, unsigned long n); extern void xhuge *xmemcpy (void xhuge *s1, void xhuge *s2, unsigned long n); extern void xhuge *xmemchr (void xhuge *s, char val, unsigned long n); extern void xhuge *xmemccpy (void xhuge *s1, void xhuge *s2, char val, unsigned long n); extern void xhuge *xmemmove (void xhuge *s1, void xhuge *s2, unsigned long n); extern void xhuge *xmemset (void xhuge *s, char val, unsigned long n); #line 9 "astro.h" #line 1 "C:\C166\INC\MATH.H" extern int abs (int val); extern long labs (long val); extern double fabs (double val); extern double sqrt (double val); extern double exp (double val); extern double log (double val); extern double log10 (double val); extern double sin (double val); extern double cos (double val); extern double tan (double val); extern double asin (double val); extern double acos (double val); extern double atan (double val); extern double sinh (double val); extern double cosh (double val); extern double tanh (double val); extern double atan2 (double y, double x); extern double ceil (double val); extern double floor (double val); extern double modf (double val, double *n); extern double pow (double x, double y); extern unsigned int _chkfloat_ (float x); extern unsigned int _chkdouble_ (double x); #line 10 "astro.h" #line 1 "global.h" #line 5 "global.h" #line 204 "global.h" #line 11 "astro.h" extern void cCurrentStarTime( void ); extern void cAzAlt( void ); extern void cRaDec( void ); extern long dHourslArc10( double val ); extern long dDegreeslArc10( double val ); extern double lArc10dHours( long val ); extern double lArc10dDegrees( long val ); extern int arc10Sector( long val ); extern int degreesSector( double val ); #line 15 "int.h" extern void initTimerInt( void ); extern void startTimerInt( void ); extern void stopTimerInt( void ); extern void initEncoderInts( void ); extern void startEncoderIntsHo( void ); extern void startEncoderIntsVe( void ); extern void stopEncoderInts( void ); extern unsigned char bdata ENC_FLAGS; extern bit ENCHO_USE; extern bit ENCVE_USE; extern bit ENCHO_COR; extern bit ENCVE_COR; extern bit ENCHO_DIR; extern bit ENCVE_DIR; extern bit ENCHO_CORUSE; extern bit ENCVE_CORUSE; extern unsigned char bdata MOT_FLAGS; extern bit MOTHO_RUN; extern bit MOTVE_RUN; extern bit MOTFR_USE; extern bit MOTHO_DIR; extern bit MOTVE_DIR; extern bit MOTFR_DIR; extern bit MOT_GOTO; extern bit MOT_CORRECTION; extern volatile int idata YEAR; extern volatile int idata MONTH; extern volatile int idata DAY; extern volatile int idata HOUR; extern volatile int idata MINUTE; extern volatile int idata SECOND; extern volatile int idata MSECOND; extern volatile int idata TIMER10; extern volatile int idata THISMDAYS; extern volatile int idata CFG_ENC_HO; extern volatile int idata CFG_ENC_VE; extern volatile int idata ARC10PERENCHO; extern volatile int idata ARC10PERENCVE; extern volatile long idata ENC_ARC10_HO; extern volatile long idata ENC_ARC10_VE; extern volatile long idata HSTEPSHO090; extern volatile long idata HSTEPSHO180; extern volatile long idata HSTEPSHO270; extern volatile long idata HSTEPSHO359; extern volatile long idata CUR_HSTEPS_HO; extern volatile long idata CUR_HSTEPS_VE; extern volatile long idata TRG_HSTEPS_HO; extern volatile long idata TRG_HSTEPS_VE; extern volatile long idata CUR_ARC10_HO; extern volatile long idata CUR_ARC10_VE; extern volatile int idata SPEED_HO; extern volatile int idata SPEED_VE; extern volatile int idata SPEED_FR; extern volatile int idata SPEED_HO_CT; extern volatile int idata SPEED_VE_CT; extern volatile int idata SPEED_FR_CT; extern volatile unsigned char idata hsteps[8]; extern volatile int idata HSTEP_HO; extern volatile int idata HSTEP_VE; extern volatile int idata HSTEP_FR; extern volatile double idata CFG_HSTS_HO; extern volatile double idata CFG_HSTS_VE; extern volatile double idata CFG_HSTS_FR; #line 5 "INT.C" #pragma SRC unsigned char bdata ENC_FLAGS; sbit ENCHO_USE = ENC_FLAGS^0; sbit ENCVE_USE = ENC_FLAGS^1; sbit ENCHO_COR = ENC_FLAGS^2; sbit ENCVE_COR = ENC_FLAGS^3; sbit ENCHO_DIR = ENC_FLAGS^4; sbit ENCVE_DIR = ENC_FLAGS^5; sbit ENCHO_CORUSE = ENC_FLAGS^6; sbit ENCVE_CORUSE = ENC_FLAGS^7; unsigned char bdata MOT_FLAGS; sbit MOTHO_RUN = MOT_FLAGS^0; sbit MOTVE_RUN = MOT_FLAGS^1; sbit MOTFR_USE = MOT_FLAGS^2; sbit MOTHO_DIR = MOT_FLAGS^3; sbit MOTVE_DIR = MOT_FLAGS^4; sbit MOTFR_DIR = MOT_FLAGS^5; sbit MOT_GOTO = MOT_FLAGS^6; sbit MOT_CORRECTION = MOT_FLAGS^7; volatile int idata YEAR; volatile int idata MONTH; volatile int idata DAY; volatile int idata HOUR; volatile int idata MINUTE; volatile int idata SECOND; volatile int idata MSECOND; volatile int idata TIMER10; volatile int idata THISMDAYS; volatile int idata CFG_ENC_HO; volatile int idata CFG_ENC_VE; volatile int idata ARC10PERENCHO; volatile int idata ARC10PERENCVE; volatile long idata ENC_ARC10_HO; volatile long idata ENC_ARC10_VE; volatile long idata HSTEPSHO090; volatile long idata HSTEPSHO180; volatile long idata HSTEPSHO270; volatile long idata HSTEPSHO359; volatile long idata CUR_HSTEPS_HO; volatile long idata CUR_HSTEPS_VE; volatile long idata TRG_HSTEPS_HO; volatile long idata TRG_HSTEPS_VE; volatile long idata CUR_ARC10_HO; volatile long idata CUR_ARC10_VE; volatile int idata SPEED_HO; volatile int idata SPEED_VE; volatile int idata SPEED_FR; volatile int idata SPEED_HO_CT; volatile int idata SPEED_VE_CT; volatile int idata SPEED_FR_CT; volatile unsigned char idata hsteps[8] = { 238, 170, 187, 153, 221, 85, 119, 102 }; volatile int idata HSTEP_HO; volatile int idata HSTEP_VE; volatile int idata HSTEP_FR; volatile double idata CFG_HSTS_HO; volatile double idata CFG_HSTS_VE; volatile double idata CFG_HSTS_FR; volatile double idata DITMP1; volatile double idata DITMP2; void initTimerInt( void ) { T3IC = 167; T3CON = 1025; T4CON = 39; T4 = 65411; T3 = 65411; } void startTimerInt( void ) { TIMER10 = 0; T3 = 65411; T4 = 65411; T3CON = 1089; T3IC = 231; } void stopTimerInt( void ) { T3IC = 167; T3CON = 1025; } __asm { ;P2 DEFR 0FFC0H P7 DEFR 0FFD0H P8 DEFR 0FFD4H } void timer_int (void) interrupt TIMER_INT = 0x23 using TIMER_BANK { TIMER10++; if( TIMER10 >= 10 ){ TIMER10 = 0; MSECOND++; if( MSECOND >= 1000 ){ MSECOND = 0; SECOND++; if( SECOND >= 60 ){ SECOND = 0; MINUTE++; if( MINUTE >= 60 ){ MINUTE = 0; HOUR++; if( HOUR >= 24 ){ HOUR = 0; DAY++; if( DAY > THISMDAYS ) { DAY = 1; MONTH++; if( MONTH > 12 ){ MONTH = 1; YEAR++; } } } } } } } if( ENCHO_COR == 1 ) { if( ENCHO_CORUSE == 1 ) { DITMP1 = (double)ENC_ARC10_HO / (double)10; DITMP1 = (double)DITMP1 / (double)CFG_HSTS_HO; modf( DITMP1, &DITMP2); CUR_HSTEPS_HO = ( long )DITMP2; } ENCHO_COR = 0; } if( ENCVE_COR == 1 ) { if( ENCVE_CORUSE == 1 ) { DITMP1 = (double)ENC_ARC10_VE / (double)10; DITMP1 = (double)DITMP1 / (double)CFG_HSTS_VE; modf( DITMP1, &DITMP2); CUR_HSTEPS_VE = ( long )DITMP2; } ENCVE_COR = 0; } if( MOT_GOTO == 1 ) { if( MOTHO_RUN == 1 ) { if( (long)CUR_HSTEPS_HO == (long)TRG_HSTEPS_HO ){ MOTHO_RUN = 0; } } if( MOTVE_RUN == 1 ) { if( (long)CUR_HSTEPS_VE == (long)TRG_HSTEPS_VE ){ MOTVE_RUN = 0; } } } if( ( MOT_GOTO == 1 ) || ( MOT_CORRECTION == 1 ) ) { if( MOTHO_RUN == 1 ) { SPEED_HO_CT++; if( SPEED_HO_CT >= SPEED_HO ){ SPEED_HO_CT = 0; if( MOTHO_DIR == 1 ) { HSTEP_HO--; if( HSTEP_HO < 0 ){ HSTEP_HO = 7; } CUR_HSTEPS_HO = (long)CUR_HSTEPS_HO - (long)1; if( CUR_HSTEPS_HO < (long)0 ){ CUR_HSTEPS_HO = (long)HSTEPSHO359; } } else { HSTEP_HO++; if( HSTEP_HO > 7 ){ HSTEP_HO = 0; } CUR_HSTEPS_HO = (long)CUR_HSTEPS_HO + (long)1; if( CUR_HSTEPS_HO > (long)HSTEPSHO359 ){ CUR_HSTEPS_HO = (long)0; } } __asm { MOV R7,#hsteps ADD R7,HSTEP_HO MOVB RL6,[R7] ANDB RL6,#15 MOVB RL5,P7 ANDB RL5,#240 ORB RL6,RL5 MOVB P7,RL6 } } } if( MOTVE_RUN == 1 ) { SPEED_VE_CT++; if( SPEED_VE_CT >= SPEED_VE ){ SPEED_VE_CT = 0; if( MOTVE_DIR == 1 ) { HSTEP_VE--; if( HSTEP_VE < 0 ){ HSTEP_VE = 7; } CUR_HSTEPS_VE = (long)CUR_HSTEPS_VE - (long)1; } else { HSTEP_VE++; if( HSTEP_VE > 7 ){ HSTEP_VE = 0; } CUR_HSTEPS_VE = (long)CUR_HSTEPS_VE + (long)1; } __asm { MOV R7,#hsteps ADD R7,HSTEP_VE MOVB RL6,[R7] ANDB RL6,#240 MOVB RL5,P7 ANDB RL5,#15 ORB RL6,RL5 MOVB P7,RL6 } } } if( ( MOTFR_USE == 1 ) && ( MOT_GOTO == 1 ) ){ SPEED_FR_CT++; if( SPEED_FR_CT >= SPEED_FR ){ SPEED_FR_CT = 0; if( MOTFR_DIR == 1 ) { HSTEP_FR--; if( HSTEP_FR < 0 ){ HSTEP_FR = 7; } } else { HSTEP_FR++; if( HSTEP_FR > 7 ){ HSTEP_FR = 0; } } __asm { MOV R7,#hsteps ADD R7,HSTEP_FR MOVB RL6,[R7] ANDB RL6,#15 MOVB RL5,P8 ANDB RL5,#240 ORB RL6,RL5 MOVB P8,RL6 } } } } } void initEncoderInts(void) { DP2_8 = 0; DP2_9 = 0; DP2_10 = 0; DP2_11 = 0; CC8IC = 183; CC9IC = 179; CC10IC = 175; CC11IC = 171; EXICON = 0x00ff; } void startEncoderIntsHo(void) { ENCHO_COR = 0; ENCHO_DIR = 0; CC8IC = 247; CC9IC = 243; } void startEncoderIntsVe(void) { ENCVE_COR = 0; ENCVE_DIR = 0; CC10IC = 239; CC11IC = 235; } void stopEncoderInts(void) { CC8IC = 183; CC9IC = 179; CC10IC = 175; CC11IC = 171; ENCHO_COR = 0; ENCVE_COR = 0; } void encoder1_0_int (void) interrupt ENCODER1_0_INT = 0x18 using ENCODER10_BANK { __asm { jb P2.8,LENC10HIGH jnb P2.9,LENC10RIGHT JMPR cc_UC,LENC10LEFT LENC10HIGH: jb P2.9,LENC10RIGHT LENC10LEFT: BSET ENC_FLAGS.4 } ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)ARC10PERENCHO; if( ENC_ARC10_HO < (long)0){ ENC_ARC10_HO = (long)12960000 + (long)ENC_ARC10_HO; } __asm { jmpr cc_UC,LENC10END LENC10RIGHT: BCLR ENC_FLAGS.4 } ENC_ARC10_HO = (long)ENC_ARC10_HO + (long)ARC10PERENCHO; if( ENC_ARC10_HO > (long)12959999 ){ ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)12960000; } __asm { LENC10END: BSET ENC_FLAGS.2 } } void encoder1_1_int (void) interrupt ENCODER1_1_INT = 0x19 using ENCODER11_BANK { __asm { jb P2.9,LENC11HIGH jb P2.8,LENC11RIGHT JMPR cc_UC,LENC11LEFT LENC11HIGH: jnb P2.8,LENC11RIGHT LENC11LEFT: BSET ENC_FLAGS.4 } ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)ARC10PERENCHO; if( ENC_ARC10_HO < (long)0){ ENC_ARC10_HO = (long)12960000 + (long)ENC_ARC10_HO; } __asm { jmpr cc_UC,LENC11END LENC11RIGHT: BCLR ENC_FLAGS.4 } ENC_ARC10_HO = (long)ENC_ARC10_HO + (long)ARC10PERENCHO; if( ENC_ARC10_HO > (long)12959999 ){ ENC_ARC10_HO = (long)ENC_ARC10_HO - (long)12960000; } __asm { LENC11END: BSET ENC_FLAGS.2 } } void encoder2_0_int (void) interrupt ENCODER2_0_INT = 0x1A using ENCODER20_BANK { __asm { jb P2.10,LENC20HIGH jb P2.11,LENC20RIGHT JMPR cc_UC,LENC20LEFT LENC20HIGH: jnb P2.11,LENC20RIGHT LENC20LEFT: BSET ENC_FLAGS.5 } ENC_ARC10_VE = (long)ENC_ARC10_VE - (long)ARC10PERENCVE; __asm { jmpr cc_UC,LENC20END LENC20RIGHT: BCLR ENC_FLAGS.5 } ENC_ARC10_VE = (long)ENC_ARC10_VE + (long)ARC10PERENCVE; __asm { LENC20END: BSET ENC_FLAGS.3 } } void encoder2_1_int (void) interrupt ENCODER2_1_INT = 0x1B using ENCODER21_BANK { __asm { jb P2.11,LENC21HIGH jnb P2.10,LENC21RIGHT JMPR cc_UC,LENC21LEFT LENC21HIGH: jb P2.10,LENC21RIGHT LENC21LEFT: BSET ENC_FLAGS.5 } ENC_ARC10_VE = (long)ENC_ARC10_VE - (long)ARC10PERENCVE; __asm { jmpr cc_UC,LENC21END LENC21RIGHT: BCLR ENC_FLAGS.5 } ENC_ARC10_VE = (long)ENC_ARC10_VE + (long)ARC10PERENCVE; __asm { LENC21END: BSET ENC_FLAGS.3 } }