CCS PCW C Compiler, Version 3.084, 13881 Filename: c:\slavko\usb\usb_led.LST ROM used: 624 (8%) Largest free fragment is 2048 RAM used: 21 (12%) at main() level 22 (13%) worst case Stack: 1 locations * 0000: MOVLW 00 0001: MOVWF 0A 0002: GOTO 133 0003: NOP .................... .................... .................... #include <16f877.H> .................... //////// Standard Header file for the PIC16F877 device //////////////// .................... #device PIC16F877 .................... #list .................... .................... .................... #device ADC=10 .................... #use delay(clock=20000000) * 00D4: MOVLW 30 00D5: MOVWF 04 00D6: MOVF 00,W 00D7: BTFSC 03.2 00D8: GOTO 0E6 00D9: MOVLW 06 00DA: MOVWF 78 00DB: CLRF 77 00DC: DECFSZ 77,F 00DD: GOTO 0DC 00DE: DECFSZ 78,F 00DF: GOTO 0DB 00E0: MOVLW 7B 00E1: MOVWF 77 00E2: DECFSZ 77,F 00E3: GOTO 0E2 00E4: DECFSZ 00,F 00E5: GOTO 0D9 00E6: RETLW 00 .................... #fuses HS,NOWDT,PUT,BROWNOUT,NOPROTECT,NOLVP,NOWRT .................... #zero_ram .................... #include .................... //// (C) Copyright 1996,1997 Custom Computer Services //// .................... //// This source code may only be used by licensed users of the CCS C //// .................... //// compiler. This source code may only be distributed to other //// .................... //// licensed users of the CCS C compiler. No other use, reproduction //// .................... //// or distribution is permitted without written permission. //// .................... //// Derivative programs created using this software in object code //// .................... //// form are not restricted in any way. //// .................... //////////////////////////////////////////////////////////////////////////// .................... .................... #ifndef _STDLIB .................... #define _STDLIB .................... .................... //--------------------------------------------------------------------------- .................... // Definitions and types .................... //--------------------------------------------------------------------------- .................... .................... #ifndef RAND_MAX .................... #define RAND_MAX 32767 // The value of which is the maximum value .................... // ... returned by the rand function .................... #endif .................... .................... typedef struct { .................... signed int quot; .................... signed int rem; .................... } div_t; .................... .................... typedef struct { .................... signed long quot; .................... signed long rem; .................... } ldiv_t; .................... .................... #include .................... //// (C) Copyright 1996,2001 Custom Computer Services //// .................... //// This source code may only be used by licensed users of the CCS C //// .................... //// compiler. This source code may only be distributed to other //// .................... //// licensed users of the CCS C compiler. No other use, reproduction //// .................... //// or distribution is permitted without written permission. //// .................... //// Derivative programs created using this software in object code //// .................... //// form are not restricted in any way. //// .................... //////////////////////////////////////////////////////////////////////////// .................... .................... #ifndef _STDDEF .................... .................... #define _STDDEF .................... .................... #if sizeof(int *)==1 .................... #define ptrdiff_t int .................... #else .................... #define ptrdiff_t long .................... #endif .................... .................... #define size_t int .................... #define wchar_t char .................... #define NULL 0 .................... .................... #define offsetof(s,f) (offsetofbit(s,f)/8) .................... .................... #endif .................... .................... .................... //--------------------------------------------------------------------------- .................... // String conversion functions .................... //--------------------------------------------------------------------------- .................... .................... /* Standard template: float atof(char * s) .................... * converts the initial portion of the string s to a float. .................... * returns the converted value if any, 0 otherwise .................... */ .................... float atof(char * s); .................... .................... /* Standard template: signed int atoi(char * s) .................... * converts the initial portion of the string s to a signed int .................... * returns the converted value if any, 0 otherwise .................... */ .................... signed int atoi(char *s); .................... .................... /* Syntax: signed int32 atoi32(char * s) .................... converts the initial portion of the string s to a signed int32 .................... returns the converted value if any, 0 otherwise*/ .................... signed int32 atoi32(char *s); .................... .................... /* Standard template: signed long atol(char * s) .................... * converts the initial portion of the string s to a signed long .................... * returns the converted value if any, 0 otherwise .................... */ .................... signed long atol(char *s); .................... .................... /* Standard template: float strtol(char * s,char *endptr) .................... * converts the initial portion of the string s to a float .................... * returns the converted value if any, 0 otherwise .................... * the final string is returned in the endptr, if endptr is not null .................... */ .................... float strtod(char *s,char *endptr); .................... .................... /* Standard template: long strtoul(char * s,char *endptr,signed int base) .................... * converts the initial portion of the string s, represented as an .................... * integral value of radix base to a signed long. .................... * Returns the converted value if any, 0 otherwise .................... * the final string is returned in the endptr, if endptr is not null .................... */ .................... signed long strtol(char *s,char *endptr,signed int base); .................... .................... /* Standard template: long strtoul(char * s,char *endptr,signed int base) .................... * converts the initial portion of the string s, represented as an .................... * integral value of radix base to a unsigned long. .................... * returns the converted value if any, 0 otherwise .................... * the final string is returned in the endptr, if endptr is not null .................... */ .................... long strtoul(char *s,char *endptr,signed int base); .................... .................... //--------------------------------------------------------------------------- .................... // Pseudo-random sequence generation functions .................... //--------------------------------------------------------------------------- .................... .................... /* The rand function computes a sequence of pseudo-random integers in .................... * the range 0 to RAND_MAX .................... * .................... * Parameters: .................... * (none) .................... * .................... * Returns: .................... * The pseudo-random integer .................... */ .................... int32 rand(void); .................... .................... /* The srand function uses the argument as a seed for a new sequence of .................... * pseudo-random numbers to be returned by subsequent calls to rand. .................... * .................... * Parameters: .................... * [in] seed: The seed value to start from. You might need to pass .................... * .................... * Returns: .................... * (none) .................... * .................... * Remarks .................... * The srand function sets the starting point for generating .................... * a series of pseudorandom integers. To reinitialize the .................... * generator, use 1 as the seed argument. Any other value for .................... * seed sets the generator to a random starting point. rand .................... * retrieves the pseudorandom numbers that are generated. .................... * Calling rand before any call to srand generates the same .................... * sequence as calling srand with seed passed as 1. .................... * Usually, you need to pass a time here from outer source .................... * so that the numbers will be different every time you run. .................... */ .................... void srand(unsigned int32 seed); .................... .................... //--------------------------------------------------------------------------- .................... // Memory management functions .................... //--------------------------------------------------------------------------- .................... .................... // Comming soon .................... .................... //--------------------------------------------------------------------------- .................... // Communication with the environment .................... //--------------------------------------------------------------------------- .................... .................... /* The function returns 0 always .................... */ .................... signed int system(char *string); .................... .................... //--------------------------------------------------------------------------- .................... // Searching and sorting utilities .................... //--------------------------------------------------------------------------- .................... .................... /* Performs a binary search of a sorted array.. .................... * .................... * Parameters: .................... * [in] key: Object to search for .................... * [in] base: Pointer to base of search data .................... * [in] num: Number of elements .................... * [in] width: Width of elements .................... * [in] compare: Function that compares two elements .................... * .................... * Returns: .................... * bsearch returns a pointer to an occurrence of key in the array pointed .................... * to by base. If key is not found, the function returns NULL. If the .................... * array is not in order or contains duplicate records with identical keys, .................... * the result is unpredictable. .................... */ .................... //void *bsearch(const void *key, const void *base, size_t num, size_t width, .................... // int (*compare)(const void *, const void *)); .................... .................... /* Performs the shell-metzner sort (not the quick sort algorithm). The contents .................... * of the array are sorted into ascending order according to a comparison .................... * function pointed to by compar. .................... * .................... * Parameters: .................... * [in] base: Pointer to base of search data .................... * [in] num: Number of elements .................... * [in] width: Width of elements .................... * [in] compare: Function that compares two elements .................... * .................... * Returns: .................... * (none) .................... */ .................... //void *qsort(const void *base, size_t num, size_t width, .................... // int (*compare)(const void *, const void *)); .................... .................... //--------------------------------------------------------------------------- .................... // Integer arithmetic functions .................... //--------------------------------------------------------------------------- .................... .................... #define labs abs .................... .................... div_t div(signed int numer,signed int denom); .................... ldiv_t ldiv(signed long numer,signed long denom); .................... .................... //--------------------------------------------------------------------------- .................... // Multibyte character functions .................... //--------------------------------------------------------------------------- .................... .................... // Not supported .................... .................... //--------------------------------------------------------------------------- .................... // Multibyte string functions .................... //--------------------------------------------------------------------------- .................... .................... // Not supported .................... .................... .................... //--------------------------------------------------------------------------- .................... // Internal implementation .................... //--------------------------------------------------------------------------- .................... .................... #include .................... //// (C) Copyright 1996,2001 Custom Computer Services //// .................... //// This source code may only be used by licensed users of the CCS C //// .................... //// compiler. This source code may only be distributed to other //// .................... //// licensed users of the CCS C compiler. No other use, reproduction //// .................... //// or distribution is permitted without written permission. //// .................... //// Derivative programs created using this software in object code //// .................... //// form are not restricted in any way. //// .................... //////////////////////////////////////////////////////////////////////////// .................... .................... #ifndef _STDDEF .................... .................... #define _STDDEF .................... .................... #if sizeof(int *)==1 .................... #define ptrdiff_t int .................... #else .................... #define ptrdiff_t long .................... #endif .................... .................... #define size_t int .................... #define wchar_t char .................... #define NULL 0 .................... .................... #define offsetof(s,f) (offsetofbit(s,f)/8) .................... .................... #endif .................... .................... #include .................... //////////////////////////////////////////////////////////////////////////// .................... //// (C) Copyright 1996,1997 Custom Computer Services //// .................... //// This source code may only be used by licensed users of the CCS C //// .................... //// compiler. This source code may only be distributed to other //// .................... //// licensed users of the CCS C compiler. No other use, reproduction //// .................... //// or distribution is permitted without written permission. //// .................... //// Derivative programs created using this software in object code //// .................... //// form are not restricted in any way. //// .................... //////////////////////////////////////////////////////////////////////////// .................... #ifndef _STRING .................... #define _STRING .................... #include .................... //// (C) Copyright 1996,2001 Custom Computer Services //// .................... //// This source code may only be used by licensed users of the CCS C //// .................... //// compiler. This source code may only be distributed to other //// .................... //// licensed users of the CCS C compiler. No other use, reproduction //// .................... //// or distribution is permitted without written permission. //// .................... //// Derivative programs created using this software in object code //// .................... //// form are not restricted in any way. //// .................... //////////////////////////////////////////////////////////////////////////// .................... .................... #ifndef _STDDEF .................... .................... #define _STDDEF .................... .................... #if sizeof(int *)==1 .................... #define ptrdiff_t int .................... #else .................... #define ptrdiff_t long .................... #endif .................... .................... #define size_t int .................... #define wchar_t char .................... #define NULL 0 .................... .................... #define offsetof(s,f) (offsetofbit(s,f)/8) .................... .................... #endif .................... .................... #include .................... //// (C) Copyright 1996,1997 Custom Computer Services //// .................... //// This source code may only be used by licensed users of the CCS C //// .................... //// compiler. This source code may only be distributed to other //// .................... //// licensed users of the CCS C compiler. No other use, reproduction //// .................... //// or distribution is permitted without written permission. //// .................... //// Derivative programs created using this software in object code //// .................... //// form are not restricted in any way. //// .................... //////////////////////////////////////////////////////////////////////////// .................... .................... #ifndef _CTYPE .................... #define _CTYPE .................... .................... #define islower(x) isamoung(x,"abcdefghijklmnopqrstuvwxyz") .................... #define isupper(x) isamoung(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ") .................... #define isalnum(x) isamoung(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") .................... #define isalpha(x) isamoung(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") .................... #define isdigit(x) isamoung(x,"0123456789") .................... #define isspace(x) (x==' ') .................... #define isxdigit(x) isamoung(x,"0123456789ABCDEFabcdef") .................... #define iscntrl(x) (x<' ') .................... #define isprint(x) (x>=' ') .................... #define isgraph(x) (x>' ') .................... #define ispunct(x) ((x>' ')&&!isalnum(x)) .................... .................... #endif .................... .................... #list .................... .................... .................... /*Copying functions*/ .................... /* standard template: .................... void *memmove(void *s1, void *s2, size_t n). .................... Copies max of n characters safely (not following ending '\0') .................... from s2 in s1; if s2 has less than n characters, appends 0 */ .................... .................... char *memmove(void *s1,char *s2,size_t n) .................... { .................... char *sc1; .................... char *sc2; .................... sc1=s1; .................... sc2=s2; .................... if(sc2 0 && *s2 != '\0'; n--) .................... *s++ = *s2++; .................... for (; n > 0; n--) .................... *s++ = '\0'; .................... .................... return(s1); .................... } .................... /***********************************************************/ .................... .................... /*concatenation functions*/ .................... /* standard template: char *strcat(char *s1, const char *s2) .................... appends s2 to s1*/ .................... .................... char strcat(char *s1, char *s2) .................... { .................... char *s; .................... .................... for (s = s1; *s != '\0'; s++); .................... while ((*s = *s2) != '\0') .................... { .................... s++; .................... s2++; .................... } .................... return(s1); .................... } .................... /* standard template: char *strncat(char *s1, char *s2,size_t n) .................... appends not more than n characters from s2 to s1*/ .................... .................... char strncat(char *s1, char *s2, size_t n) .................... { .................... char *s; .................... .................... for (s = s1; *s != '\0'; s++); .................... while ((*s = *s2) != '\0' && 0< n) .................... { .................... s++; .................... s2++; .................... --n; .................... } .................... *s='\0'; .................... return(s1); .................... } .................... .................... /***********************************************************/ .................... .................... /*comparison functions*/ .................... /* standard template: signed int memcmp(void *s1, void *s2). .................... Compares s1 & s2; returns -1 if s1s2 */ .................... .................... signed int memcmp(void * s1,char *s2,size_t n) .................... { .................... char *su1,su2; .................... for(su1=s1,su2=s2;0s2 */ .................... .................... signed int strcmp(char *s1, char *s2) .................... { .................... for (; *s1 == *s2; s1++, s2++) .................... if (*s1 == '\0') .................... return(0); .................... return((*s1 < *s2) ??-1: 1); .................... } .................... /* standard template: int strcoll(const char *s1, const char *s2). .................... Compares s1 & s2; returns -1 if s1s2 */ .................... .................... signed int strcoll(char *s1, char *s2) .................... { .................... for (; *s1 == *s2; s1++, s2++) .................... if (*s1 == '\0') .................... return(0); .................... return((*s1 < *s2) ??-1: 1); .................... } .................... .................... /* standard template: .................... int strncmp(const char *s1, const char *s2, size_t n). .................... Compares max of n characters (not following 0) from s1 to s2; .................... returns same as strcmp */ .................... .................... signed int strncmp(char *s1, char *s2, size_t n) .................... { .................... for (; n > 0; s1++, s2++, n--) .................... if (*s1 != *s2) .................... return((*s1 <*s2) ??-1: 1); .................... else if (*s1 == '\0') .................... return(0); .................... return(0); .................... } .................... /* standard template: .................... int strxfrm(const char *s1, const char *s2, size_t n). .................... transforms maximum of n characters from s2 and places them into s1*/ .................... size_t strxfrm(char *s1, char *s2, size_t n) .................... { .................... char *s; .................... int n1; .................... n1=n; .................... for (s = s1; n > 0 && *s2 != '\0'; n--) .................... *s++ = *s2++; .................... for (; n > 0; n--) .................... *s++ = '\0'; .................... .................... return(n1); .................... } .................... .................... .................... .................... .................... .................... /***********************************************************/ .................... /*Search functions*/ .................... /* standard template: void *memchr(const char *s, int c). .................... Finds first occurrence of c in n characters of s */ .................... .................... char *memchr(void *s,int c,size_t n) .................... { .................... char uc; .................... char *su; .................... uc=c; .................... for(su=s;0= 'A' && *p <='Z') .................... *p += 'a' - 'A'; .................... return(s); .................... } .................... .................... .................... .................... .................... /************************************************************/ .................... .................... .................... .................... .................... .................... .................... .................... #endif .................... .................... .................... div_t div(signed int numer,signed int denom) .................... { .................... div_t val; .................... val.quot = numer / denom; .................... val.rem = numer - (denom * val.quot); .................... return (val); .................... } .................... .................... ldiv_t ldiv(signed long numer,signed long denom) .................... { .................... ldiv_t val; .................... val.quot = numer / denom; .................... val.rem = numer - (denom * val.quot); .................... return (val); .................... } .................... .................... float atof(char * s) .................... { .................... float pow10 = 1.0; .................... float result = 0.0; .................... int sign = 0, point = 0; .................... char c; .................... int ptr = 0; .................... .................... if(s) .................... { .................... c = s[ptr++]; .................... } .................... .................... while ((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { .................... if(c == '-') { .................... sign = 1; .................... c = s[ptr++]; .................... } .................... .................... while((c >= '0' && c <= '9') && point == 0) { .................... result = 10*result + c - '0'; .................... c = s[ptr++]; .................... } .................... .................... if (c == '.') { .................... point = 1; .................... c = s[ptr++]; .................... } .................... .................... while((c >= '0' && c <= '9') && point == 1) { .................... pow10 = pow10*10; .................... result += (c - '0')/pow10; .................... c = s[ptr++]; .................... } .................... } .................... .................... if (sign == 1) .................... result = -1*result; .................... return(result); .................... } .................... .................... signed int atoi(char *s) .................... { .................... signed int result; .................... int sign, base, index; .................... char c; .................... .................... index = 0; .................... sign = 0; .................... base = 10; .................... result = 0; .................... .................... // Omit all preceeding alpha characters .................... if(s) .................... c = s[index++]; .................... .................... // increase index if either positive or negative sign is detected .................... if (c == '-') .................... { .................... sign = 1; // Set the sign to negative .................... c = s[index++]; .................... } .................... else if (c == '+') .................... { .................... c = s[index++]; .................... } .................... .................... if (c >= '0' && c <= '9') .................... { .................... .................... // Check for hexa number .................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) .................... { .................... base = 16; .................... index++; .................... c = s[index++]; .................... } .................... .................... // The number is a decimal number .................... if (base == 10) .................... { .................... while (c >= '0' && c <= '9') .................... { .................... result = 10*result + (c - '0'); .................... c = s[index++]; .................... } .................... } .................... else if (base == 16) // The number is a hexa number .................... { .................... while (c = TOUPPER(c), (c >= '0' && c <= '9') || (c >= 'A' && c<='F')) .................... { .................... if (c >= '0' && c <= '9') .................... result = (result << 4) + (c - '0'); .................... else .................... result = (result << 4) + (c - 'A' + 10); .................... .................... c = s[index++]; .................... } .................... } .................... } .................... .................... if (sign == 1 && base == 10) .................... result = -result; .................... .................... return(result); .................... } .................... .................... signed long atol(char *s) .................... { .................... signed long result; .................... int sign, base, index; .................... char c; .................... .................... index = 0; .................... sign = 0; .................... base = 10; .................... result = 0; .................... .................... if(s) .................... c = s[index++]; .................... .................... // increase index if either positive or negative sign is detected .................... if (c == '-') .................... { .................... sign = 1; // Set the sign to negative .................... c = s[index++]; .................... } .................... else if (c == '+') .................... { .................... c = s[index++]; .................... } .................... .................... if (c >= '0' && c <= '9') .................... { .................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) .................... { .................... base = 16; .................... index++; .................... c = s[index++]; .................... } .................... .................... // The number is a decimal number .................... if (base == 10) .................... { .................... while (c >= '0' && c <= '9') .................... { .................... result = 10*result + (c - '0'); .................... c = s[index++]; .................... } .................... } .................... else if (base == 16) // The number is a hexa number .................... { .................... while (c = TOUPPER(c), (c >= '0' && c <= '9') || (c >= 'A' && c <='F')) .................... { .................... if (c >= '0' && c <= '9') .................... result = (result << 4) + (c - '0'); .................... else .................... result = (result << 4) + (c - 'A' + 10); .................... .................... c = s[index++]; .................... } .................... } .................... } .................... .................... if (base == 10 && sign == 1) .................... result = -result; .................... .................... return(result); .................... } .................... .................... /* A fast routine to multiply by 10 .................... */ .................... signed int32 mult_with10(int32 num) .................... { .................... return ( (num << 1) + (num << 3) ); .................... } .................... .................... signed int32 atoi32(char *s) .................... { .................... signed int32 result; .................... int sign, base, index; .................... char c; .................... .................... index = 0; .................... sign = 0; .................... base = 10; .................... result = 0; .................... .................... if(s) .................... c = s[index++]; .................... .................... // increase index if either positive or negative sign is detected .................... if (c == '-') .................... { .................... sign = 1; // Set the sign to negative .................... c = s[index++]; .................... } .................... else if (c == '+') .................... { .................... c = s[index++]; .................... } .................... .................... if (c >= '0' && c <= '9') .................... { .................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) .................... { .................... base = 16; .................... index++; .................... c = s[index++]; .................... } .................... .................... // The number is a decimal number .................... if (base == 10) .................... { .................... while (c >= '0' && c <= '9') { .................... result = (result << 1) + (result << 3); // result *= 10; .................... result += (c - '0'); .................... c = s[index++]; .................... } .................... } .................... else if (base == 16) // The number is a hexa number .................... { .................... while (c = TOUPPER(c), (c >= '0' && c <= '9') || (c >= 'A' && c <='F')) .................... { .................... if (c >= '0' && c <= '9') .................... result = (result << 4) + (c - '0'); .................... else .................... result = (result << 4) + (c - 'A' + 10); .................... .................... c = s[index++]; .................... } .................... } .................... } .................... .................... if (base == 10 && sign == 1) .................... result = -result; .................... .................... return(result); .................... } .................... .................... float strtod(char *s,char *endptr) { .................... float pow10 = 1.0; .................... float result = 0.0; .................... int sign = 0, point = 0; .................... char c; .................... int ptr = 0; .................... .................... if(s) .................... { .................... c=s[ptr++]; .................... } .................... .................... while((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { .................... if(c == '-') { .................... sign = 1; .................... c = s[ptr++]; .................... } .................... .................... while((c >= '0' && c <= '9') && point == 0) { .................... result = 10*result + c - '0'; .................... c = s[ptr++]; .................... } .................... .................... if (c == '.') { .................... point = 1; .................... c = s[ptr++]; .................... } .................... .................... while((c >= '0' && c <= '9') && point == 1) { .................... pow10 = pow10*10; .................... result += (c - '0')/pow10; .................... c = s[ptr++]; .................... } .................... } .................... .................... if (sign == 1) .................... result = -1*result; .................... if(endptr) .................... { .................... if (ptr) { .................... ptr--; .................... *((char *)endptr)=s+ptr; .................... } .................... else .................... *((char *)endptr)=s; .................... } .................... .................... return(result); .................... } .................... .................... long strtoul(char *s,char *endptr,signed int base) .................... { .................... char *sc,*s1,*s2,*sd; .................... unsigned long x=0; .................... char sign; .................... char digits[]="0123456789abcdefghijklmnopqstuvwxyz"; .................... for(sc=s;isspace(*sc);++sc); .................... sign=*sc=='-'||*sc=='+'??sc++:'+'; .................... if(sign=='-') .................... { .................... if (endptr) .................... { .................... *((char *)endptr)=s; .................... } .................... return 0; .................... } .................... .................... if (base <0 || base ==1|| base >36) // invalid base .................... { .................... if (endptr) .................... { .................... *((char *)endptr)=s; .................... } .................... return 0; .................... } .................... else if (base) .................... { .................... if(base==16 && *sc =='0'&&(sc[1]=='x' || sc[1]=='X')) .................... sc+=2; .................... if(base==8 && *sc =='0') .................... sc+=1; .................... if(base==2 && *sc =='0'&&sc[1]=='b') .................... sc+=2; .................... .................... } .................... else if(*sc!='0') // base is 0, find base .................... base=10; .................... else if (sc[1]=='x' || sc[1]=='X') .................... base =16,sc+=2; .................... else if(sc[1]=='b') .................... base=2,sc+=2; .................... else .................... base=8; .................... for (s1=sc;*sc=='0';++sc);// skip leading zeroes .................... for(s2=sc;(sd=memchr(digits,tolower(*sc),base))!=0;++sc) .................... { .................... x=x*base+(sd-digits); .................... } .................... if(s1==sc) .................... { .................... if (endptr) .................... { .................... *((char *)endptr)=s; .................... } .................... return 0; .................... } .................... if (endptr) .................... *((char *)endptr)=sc; .................... return x; .................... } .................... .................... signed long strtol(char *s,char *endptr,signed int base) .................... { .................... char *sc,*s1,*s2,*sd; .................... signed long x=0; .................... char sign; .................... char digits[]="0123456789abcdefghijklmnopqstuvwxyz"; .................... for(sc=s;isspace(*sc);++sc); .................... sign=*sc=='-'||*sc=='+'??sc++:'+'; .................... if (base <0 || base ==1|| base >36) // invalid base .................... { .................... if (endptr) .................... { .................... *((char *)endptr)=s; .................... } .................... return 0; .................... } .................... else if (base) .................... { .................... if(base==16 && *sc =='0'&&(sc[1]=='x' || sc[1]=='X')) .................... sc+=2; .................... if(base==8 && *sc =='0') .................... sc+=1; .................... if(base==2 && *sc =='0'&&sc[1]=='b') .................... sc+=2; .................... .................... } .................... else if(*sc!='0') // base is 0, find base .................... base=10; .................... else if (sc[1]=='x' || sc[1]=='X') .................... base =16,sc+=2; .................... else if(sc[1]=='b') .................... base=2,sc+=2; .................... else .................... base=8; .................... for (s1=sc;*sc=='0';++sc);// skip leading zeroes .................... for(s2=sc;(sd=memchr(digits,tolower(*sc),base))!=0;++sc) .................... { .................... x=x*base+(sd-digits); .................... } .................... if(s1==sc) .................... { .................... if (endptr) .................... { .................... *((char *)endptr)=s; .................... } .................... return 0; .................... } .................... if(sign=='-') .................... x =-x; .................... if (endptr) .................... *((char *)endptr)=sc; .................... return x; .................... } .................... .................... signed int system(char *string) .................... { .................... return 0; .................... } .................... .................... int mblen(char *s,size_t n) .................... { .................... return strlen(s); .................... } .................... .................... int mbtowc(wchar_t *pwc,char *s,size_t n) .................... { .................... *pwc=*s; .................... return 1; .................... } .................... .................... int wctomb(char *s,wchar_t wchar) .................... { .................... *s=wchar; .................... return 1; .................... } .................... .................... size_t mbstowcs(wchar_t *pwcs,char *s,size_t n) .................... { .................... strncpy(pwcs,s,n); .................... return strlen(pwcs); .................... } .................... .................... size_t wcstombs(char *s,wchar_t *pwcs,size_t n) .................... { .................... strncpy(s,pwcs,n); .................... return strlen(s); .................... } .................... .................... //--------------------------------------------------------------------------- .................... // The random number implementation .................... //--------------------------------------------------------------------------- .................... .................... unsigned int32 _Randseed = 1; .................... .................... long rand(void) .................... { .................... _Randseed = _Randseed * 1103515245 + 12345; .................... return ((unsigned long)(_Randseed >> 16) % RAND_MAX); .................... } .................... .................... void srand(unsigned int32 seed) .................... { .................... _RandSeed = seed; .................... } .................... .................... //--------------------------------------------------------------------------- .................... // Searching and sorting utilities implementation .................... //--------------------------------------------------------------------------- .................... /* .................... void *bsearch(const void *key, const void *base, size_t num, size_t width, .................... int (*compare)(const void *, const void *)) .................... { .................... char *p, *q; .................... size_t n; .................... size_t pivot; .................... int val; .................... .................... p = base; .................... n = num; .................... .................... while (n > 0) .................... { .................... pivot = n >> 1; .................... q = p + size * pivot; .................... .................... val = compare(key, q); .................... .................... if (val < 0) .................... n = pivot; .................... else if (val == 0) .................... return ((void *)q); .................... else { .................... p = q + size; .................... n -= pivot + 1; .................... } .................... } .................... .................... return NULL; // There's no match .................... } .................... .................... void *qsort(const void *base, size_t num, size_t width, .................... int (*compare)(const void *, const void *)) .................... { .................... char *p, *q, *pend, tmp; .................... size_t pivot, i; .................... short bDone; .................... int val; .................... .................... pend = base + num * width ; .................... pivot = num; .................... .................... while (pivot > 1) { .................... pivot >>= 1; .................... .................... do { .................... bDone = 1; .................... p = base; .................... q = p + width * pivot; .................... while (q < pend) { .................... val = compare(p, q); .................... .................... if (val > 0) { .................... // swap *q and *p .................... for (i = 0; i < width; i++) { .................... tmp = *p; .................... *p = *q; .................... *q = tmp' .................... .................... p++; q++; .................... } .................... .................... bDone = 0; .................... } .................... .................... if (bDone) { .................... p += width; .................... q += width; .................... } .................... } .................... } while (!bDone); .................... } .................... } .................... */ .................... .................... #endif .................... .................... .................... .................... .................... int i; .................... int stopinje_cilj; .................... .................... .................... main(void) { /* začetek programa */ .................... .................... long stevec; .................... .................... long pavza; .................... char komanda; .................... int stevilo; .................... int x; .................... char c; .................... .................... #define LED1 PIN_A3 .................... #define LED2 PIN_A4 .................... #define LED3 PIN_A5 .................... #define LED4 PIN_E0 .................... #define LED5 PIN_E1 .................... #define LED6 PIN_E2 .................... .................... .................... #define RS232_RX PIN_B2 .................... #define RS232_TX PIN_B1 * 0133: MOVLW 57 0134: MOVWF 77 0135: MOVLW 20 0136: MOVWF 04 0137: CLRF 00 0138: INCF 04,F 0139: DECFSZ 77,F 013A: GOTO 137 013B: CLRF 78 013C: CLRF 79 013D: CLRF 7A 013E: CLRF 7B 013F: CLRF 7C 0140: CLRF 7D 0141: CLRF 7E 0142: MOVLW 50 0143: MOVWF 77 0144: MOVLW A0 0145: MOVWF 04 0146: CLRF 00 0147: INCF 04,F 0148: DECFSZ 77,F 0149: GOTO 146 014A: CLRF 20 014B: CLRF 04 014C: MOVLW 1F 014D: ANDWF 03,F 014E: BSF 03.5 014F: CLRF 1F 0150: BCF 03.5 0151: CLRF 20 0152: MOVLW 01 0153: MOVWF 21 0154: CLRF 22 0155: CLRF 23 0156: CLRF 24 0157: BSF 03.5 0158: BCF 06.1 0159: BCF 03.5 015A: BCF 06.1 .................... .................... //izklopi releje .................... pavza=1000; 015B: MOVLW 03 015C: MOVWF 2A 015D: MOVLW E8 015E: MOVWF 29 .................... .................... .................... set_tris_a(0b11000111); 015F: MOVLW C7 0160: BSF 03.5 0161: MOVWF 05 .................... .................... set_tris_b(0b1110101); 0162: MOVLW 75 0163: MOVWF 06 .................... .................... .................... //PORT E .................... set_tris_e(0b11111000); 0164: MOVLW 00 0165: MOVWF 09 .................... .................... #use rs232(baud=9600, xmit=RS232_TX, rcv=RS232_RX,RESTART_WDT,INVERT) * 00E7: BSF 03.5 00E8: BCF 06.1 00E9: BCF 03.5 00EA: BSF 06.1 00EB: MOVLW 08 00EC: MOVWF 78 00ED: NOP 00EE: NOP 00EF: NOP 00F0: BSF 78.7 00F1: GOTO 102 00F2: BCF 78.7 00F3: RRF 30,F 00F4: BTFSC 03.0 00F5: BCF 06.1 00F6: BTFSS 03.0 00F7: BSF 06.1 00F8: BSF 78.6 00F9: GOTO 102 00FA: BCF 78.6 00FB: DECFSZ 78,F 00FC: GOTO 0F3 00FD: NOP 00FE: NOP 00FF: NOP 0100: BCF 06.1 0101: GOTO 102 0102: MOVLW A7 0103: MOVWF 04 0104: DECFSZ 04,F 0105: GOTO 104 0106: NOP 0107: CLRWDT 0108: BTFSC 78.7 0109: GOTO 0F2 010A: BTFSC 78.6 010B: GOTO 0FA 010C: RETLW 00 010D: MOVLW 08 010E: MOVWF 77 010F: BSF 03.5 0110: BSF 06.2 0111: BCF 03.5 0112: CLRWDT 0113: BTFSS 06.2 0114: GOTO 112 0115: CLRF 2F 0116: BSF 77.7 0117: GOTO 126 0118: BCF 77.7 0119: GOTO 126 011A: BCF 03.0 011B: BTFSS 06.2 011C: BSF 03.0 011D: RRF 2F,F 011E: BSF 77.6 011F: GOTO 126 0120: BCF 77.6 0121: DECFSZ 77,F 0122: GOTO 11A 0123: MOVF 2F,W 0124: MOVWF 78 0125: GOTO 132 0126: MOVLW A7 0127: BTFSC 77.7 0128: MOVLW 2D 0129: MOVWF 78 012A: DECFSZ 78,F 012B: GOTO 12A 012C: NOP 012D: BTFSC 77.7 012E: GOTO 118 012F: BTFSC 77.6 0130: GOTO 120 0131: GOTO 11A 0132: RETLW 00 .................... .................... delay_ms(300); * 0166: MOVLW 02 0167: BCF 03.5 0168: MOVWF 2F 0169: MOVLW 96 016A: MOVWF 30 016B: CALL 0D4 016C: DECFSZ 2F,F 016D: GOTO 169 .................... .................... output_high(LED1); //vklop 016E: BSF 03.5 016F: BCF 05.3 0170: BCF 03.5 0171: BSF 05.3 .................... output_high(LED2); //vklop 0172: BSF 03.5 0173: BCF 05.4 0174: BCF 03.5 0175: BSF 05.4 .................... output_high(LED3); //vklop 0176: BSF 03.5 0177: BCF 05.5 0178: BCF 03.5 0179: BSF 05.5 .................... output_high(LED4); //vklop 017A: BSF 03.5 017B: BCF 09.0 017C: BCF 03.5 017D: BSF 09.0 .................... output_high(LED5); //vklop 017E: BSF 03.5 017F: BCF 09.1 0180: BCF 03.5 0181: BSF 09.1 .................... output_high(LED6); //vklop 0182: BSF 03.5 0183: BCF 09.2 0184: BCF 03.5 0185: BSF 09.2 .................... .................... printf("PIC KRMILNIK\n\r"); * 0004: BCF 0A.0 0005: BCF 0A.1 0006: BCF 0A.2 0007: ADDWF 02,F 0008: RETLW 50 0009: RETLW 49 000A: RETLW 43 000B: RETLW 20 000C: RETLW 4B 000D: RETLW 52 000E: RETLW 4D 000F: RETLW 49 0010: RETLW 4C 0011: RETLW 4E 0012: RETLW 49 0013: RETLW 4B 0014: RETLW 0A 0015: RETLW 0D 0016: RETLW 00 * 0186: CLRF 2F 0187: MOVF 2F,W 0188: CALL 004 0189: INCF 2F,F 018A: MOVWF 30 018B: CALL 0E7 018C: MOVLW 0E 018D: SUBWF 2F,W 018E: BTFSS 03.2 018F: GOTO 187 .................... printf("S tipkami na tipkovnici lahko dolocite, kaj naj naredijo diode:\n\r"); * 0017: BCF 0A.0 0018: BCF 0A.1 0019: BCF 0A.2 001A: ADDWF 02,F 001B: RETLW 53 001C: RETLW 20 001D: RETLW 74 001E: RETLW 69 001F: RETLW 70 0020: RETLW 6B 0021: RETLW 61 0022: RETLW 6D 0023: RETLW 69 0024: RETLW 20 0025: RETLW 6E 0026: RETLW 61 0027: RETLW 20 0028: RETLW 74 0029: RETLW 69 002A: RETLW 70 002B: RETLW 6B 002C: RETLW 6F 002D: RETLW 76 002E: RETLW 6E 002F: RETLW 69 0030: RETLW 63 0031: RETLW 69 0032: RETLW 20 0033: RETLW 6C 0034: RETLW 61 0035: RETLW 68 0036: RETLW 6B 0037: RETLW 6F 0038: RETLW 20 0039: RETLW 64 003A: RETLW 6F 003B: RETLW 6C 003C: RETLW 6F 003D: RETLW 63 003E: RETLW 69 003F: RETLW 74 0040: RETLW 65 0041: RETLW 2C 0042: RETLW 20 0043: RETLW 6B 0044: RETLW 61 0045: RETLW 6A 0046: RETLW 20 0047: RETLW 6E 0048: RETLW 61 0049: RETLW 6A 004A: RETLW 20 004B: RETLW 6E 004C: RETLW 61 004D: RETLW 72 004E: RETLW 65 004F: RETLW 64 0050: RETLW 69 0051: RETLW 6A 0052: RETLW 6F 0053: RETLW 20 0054: RETLW 64 0055: RETLW 69 0056: RETLW 6F 0057: RETLW 64 0058: RETLW 65 0059: RETLW 3A 005A: RETLW 0A 005B: RETLW 0D 005C: RETLW 00 * 0190: CLRF 2F 0191: MOVF 2F,W 0192: CALL 017 0193: INCF 2F,F 0194: MOVWF 30 0195: CALL 0E7 0196: MOVLW 41 0197: SUBWF 2F,W 0198: BTFSS 03.2 0199: GOTO 191 .................... printf("Za vklop diod pritisnite V, za izklop I in za utripanje U \n\r"); * 005D: BCF 0A.0 005E: BCF 0A.1 005F: BCF 0A.2 0060: ADDWF 02,F 0061: RETLW 5A 0062: RETLW 61 0063: RETLW 20 0064: RETLW 76 0065: RETLW 6B 0066: RETLW 6C 0067: RETLW 6F 0068: RETLW 70 0069: RETLW 20 006A: RETLW 64 006B: RETLW 69 006C: RETLW 6F 006D: RETLW 64 006E: RETLW 20 006F: RETLW 70 0070: RETLW 72 0071: RETLW 69 0072: RETLW 74 0073: RETLW 69 0074: RETLW 73 0075: RETLW 6E 0076: RETLW 69 0077: RETLW 74 0078: RETLW 65 0079: RETLW 20 007A: RETLW 56 007B: RETLW 2C 007C: RETLW 20 007D: RETLW 7A 007E: RETLW 61 007F: RETLW 20 0080: RETLW 69 0081: RETLW 7A 0082: RETLW 6B 0083: RETLW 6C 0084: RETLW 6F 0085: RETLW 70 0086: RETLW 20 0087: RETLW 49 0088: RETLW 20 0089: RETLW 69 008A: RETLW 6E 008B: RETLW 20 008C: RETLW 7A 008D: RETLW 61 008E: RETLW 20 008F: RETLW 75 0090: RETLW 74 0091: RETLW 72 0092: RETLW 69 0093: RETLW 70 0094: RETLW 61 0095: RETLW 6E 0096: RETLW 6A 0097: RETLW 65 0098: RETLW 20 0099: RETLW 55 009A: RETLW 20 009B: RETLW 0A 009C: RETLW 0D 009D: RETLW 00 * 019A: CLRF 2F 019B: MOVF 2F,W 019C: CALL 05D 019D: INCF 2F,F 019E: MOVWF 30 019F: CALL 0E7 01A0: MOVLW 3C 01A1: SUBWF 2F,W 01A2: BTFSS 03.2 01A3: GOTO 19B .................... printf("s stevilom do 9, kar pomeni 9 utripov.\n\r"); * 009E: BCF 0A.0 009F: BCF 0A.1 00A0: BCF 0A.2 00A1: ADDWF 02,F 00A2: RETLW 73 00A3: RETLW 20 00A4: RETLW 73 00A5: RETLW 74 00A6: RETLW 65 00A7: RETLW 76 00A8: RETLW 69 00A9: RETLW 6C 00AA: RETLW 6F 00AB: RETLW 6D 00AC: RETLW 20 00AD: RETLW 64 00AE: RETLW 6F 00AF: RETLW 20 00B0: RETLW 39 00B1: RETLW 2C 00B2: RETLW 20 00B3: RETLW 6B 00B4: RETLW 61 00B5: RETLW 72 00B6: RETLW 20 00B7: RETLW 70 00B8: RETLW 6F 00B9: RETLW 6D 00BA: RETLW 65 00BB: RETLW 6E 00BC: RETLW 69 00BD: RETLW 20 00BE: RETLW 39 00BF: RETLW 20 00C0: RETLW 75 00C1: RETLW 74 00C2: RETLW 72 00C3: RETLW 69 00C4: RETLW 70 00C5: RETLW 6F 00C6: RETLW 76 00C7: RETLW 2E 00C8: RETLW 0A 00C9: RETLW 0D 00CA: RETLW 00 * 01A4: CLRF 2F 01A5: MOVF 2F,W 01A6: CALL 09E 01A7: INCF 2F,F 01A8: MOVWF 30 01A9: CALL 0E7 01AA: MOVLW 28 01AB: SUBWF 2F,W 01AC: BTFSS 03.2 01AD: GOTO 1A5 .................... while (1) { .................... printf("\n\r>"); 01AE: MOVLW 0A 01AF: MOVWF 30 01B0: CALL 0E7 01B1: MOVLW 0D 01B2: MOVWF 30 01B3: CALL 0E7 01B4: MOVLW 3E 01B5: MOVWF 30 01B6: CALL 0E7 .................... komanda = getc(); 01B7: CALL 10D 01B8: MOVF 78,W 01B9: MOVWF 2B .................... .................... if (komanda=='V') { 01BA: MOVF 2B,W 01BB: SUBLW 56 01BC: BTFSS 03.2 01BD: GOTO 1D9 .................... putc(komanda); 01BE: MOVF 2B,W 01BF: MOVWF 30 01C0: CALL 0E7 .................... output_low(LED1); //vklop 01C1: BSF 03.5 01C2: BCF 05.3 01C3: BCF 03.5 01C4: BCF 05.3 .................... output_low(LED2); //vklop 01C5: BSF 03.5 01C6: BCF 05.4 01C7: BCF 03.5 01C8: BCF 05.4 .................... output_low(LED3); //vklop 01C9: BSF 03.5 01CA: BCF 05.5 01CB: BCF 03.5 01CC: BCF 05.5 .................... output_low(LED4); //vklop 01CD: BSF 03.5 01CE: BCF 09.0 01CF: BCF 03.5 01D0: BCF 09.0 .................... output_low(LED5); //vklop 01D1: BSF 03.5 01D2: BCF 09.1 01D3: BCF 03.5 01D4: BCF 09.1 .................... output_low(LED6); //vklop 01D5: BSF 03.5 01D6: BCF 09.2 01D7: BCF 03.5 01D8: BCF 09.2 .................... .................... } .................... .................... if (komanda=='I') { 01D9: MOVF 2B,W 01DA: SUBLW 49 01DB: BTFSS 03.2 01DC: GOTO 1F8 .................... putc(komanda); 01DD: MOVF 2B,W 01DE: MOVWF 30 01DF: CALL 0E7 .................... output_high(LED1); //vklop 01E0: BSF 03.5 01E1: BCF 05.3 01E2: BCF 03.5 01E3: BSF 05.3 .................... output_high(LED2); //vklop 01E4: BSF 03.5 01E5: BCF 05.4 01E6: BCF 03.5 01E7: BSF 05.4 .................... output_high(LED3); //vklop 01E8: BSF 03.5 01E9: BCF 05.5 01EA: BCF 03.5 01EB: BSF 05.5 .................... output_high(LED4); //vklop 01EC: BSF 03.5 01ED: BCF 09.0 01EE: BCF 03.5 01EF: BSF 09.0 .................... output_high(LED5); //vklop 01F0: BSF 03.5 01F1: BCF 09.1 01F2: BCF 03.5 01F3: BSF 09.1 .................... output_high(LED6); //vklop 01F4: BSF 03.5 01F5: BCF 09.2 01F6: BCF 03.5 01F7: BSF 09.2 .................... .................... } .................... if (komanda=='U') { 01F8: MOVF 2B,W 01F9: SUBLW 55 01FA: BTFSS 03.2 01FB: GOTO 255 .................... putc(komanda); 01FC: MOVF 2B,W 01FD: MOVWF 30 01FE: CALL 0E7 .................... komanda = getc(); 01FF: CALL 10D 0200: MOVF 78,W 0201: MOVWF 2B .................... putc(komanda); 0202: MOVF 2B,W 0203: MOVWF 30 0204: CALL 0E7 .................... stevilo=komanda-'0'; 0205: MOVLW 30 0206: SUBWF 2B,W 0207: MOVWF 2C .................... for (stevec=1;stevec<=stevilo;stevec=stevec+1) 0208: CLRF 28 0209: MOVLW 01 020A: MOVWF 27 020B: MOVF 28,F 020C: BTFSS 03.2 020D: GOTO 255 020E: MOVF 27,W 020F: SUBWF 2C,W 0210: BTFSS 03.0 0211: GOTO 255 .................... { .................... .................... output_low(LED1); //vklop 0212: BSF 03.5 0213: BCF 05.3 0214: BCF 03.5 0215: BCF 05.3 .................... output_low(LED2); //vklop 0216: BSF 03.5 0217: BCF 05.4 0218: BCF 03.5 0219: BCF 05.4 .................... output_low(LED3); //vklop 021A: BSF 03.5 021B: BCF 05.5 021C: BCF 03.5 021D: BCF 05.5 .................... output_low(LED4); //vklop 021E: BSF 03.5 021F: BCF 09.0 0220: BCF 03.5 0221: BCF 09.0 .................... output_low(LED5); //vklop 0222: BSF 03.5 0223: BCF 09.1 0224: BCF 03.5 0225: BCF 09.1 .................... output_low(LED6); //vklop 0226: BSF 03.5 0227: BCF 09.2 0228: BCF 03.5 0229: BCF 09.2 .................... delay_ms(500); 022A: MOVLW 02 022B: MOVWF 2F 022C: MOVLW FA 022D: MOVWF 30 022E: CALL 0D4 022F: DECFSZ 2F,F 0230: GOTO 22C .................... .................... output_high(LED1); //vklop 0231: BSF 03.5 0232: BCF 05.3 0233: BCF 03.5 0234: BSF 05.3 .................... output_high(LED2); //vklop 0235: BSF 03.5 0236: BCF 05.4 0237: BCF 03.5 0238: BSF 05.4 .................... output_high(LED3); //vklop 0239: BSF 03.5 023A: BCF 05.5 023B: BCF 03.5 023C: BSF 05.5 .................... output_high(LED4); //vklop 023D: BSF 03.5 023E: BCF 09.0 023F: BCF 03.5 0240: BSF 09.0 .................... output_high(LED5); //vklop 0241: BSF 03.5 0242: BCF 09.1 0243: BCF 03.5 0244: BSF 09.1 .................... output_high(LED6); //vklop 0245: BSF 03.5 0246: BCF 09.2 0247: BCF 03.5 0248: BSF 09.2 .................... delay_ms(500); 0249: MOVLW 02 024A: MOVWF 2F 024B: MOVLW FA 024C: MOVWF 30 024D: CALL 0D4 024E: DECFSZ 2F,F 024F: GOTO 24B .................... .................... } 0250: MOVLW 01 0251: ADDWF 27,F 0252: BTFSC 03.0 0253: INCF 28,F 0254: GOTO 20B .................... } .................... .................... .................... printf("\n\rOK"); * 00CB: BCF 0A.0 00CC: BCF 0A.1 00CD: BCF 0A.2 00CE: ADDWF 02,F 00CF: RETLW 0A 00D0: RETLW 0D 00D1: RETLW 4F 00D2: RETLW 4B 00D3: RETLW 00 * 0255: CLRF 2F 0256: MOVF 2F,W 0257: CALL 0CB 0258: INCF 2F,F 0259: MOVWF 30 025A: CALL 0E7 025B: MOVLW 04 025C: SUBWF 2F,W 025D: BTFSS 03.2 025E: GOTO 256 .................... .................... } 025F: GOTO 1AE .................... .................... while (1) { /* v neskončni zanki */ .................... .................... // komunikacija(); .................... output_high(PIN_B3); //vklop 0260: BSF 03.5 0261: BCF 06.3 0262: BCF 03.5 0263: BSF 06.3 .................... delay_ms(pavza); 0264: MOVF 29,W 0265: MOVWF 30 0266: CALL 0D4 .................... output_low(PIN_B3); //izklop 0267: BSF 03.5 0268: BCF 06.3 0269: BCF 03.5 026A: BCF 06.3 .................... delay_ms(pavza); 026B: MOVF 29,W 026C: MOVWF 30 026D: CALL 0D4 .................... .................... } /* konec while zanke */ 026E: GOTO 260 .................... } /* konec funkcije main */ .................... 026F: SLEEP .................... .................... .................... .................... .................... ....................