1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
|
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 288 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\language_support.h" 1 3
# 2 "<built-in>" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 1 3
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\__size_t.h" 1 3
typedef unsigned size_t;
# 4 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 2 3
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\__null.h" 1 3
# 5 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 2 3
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdarg.h" 1 3
typedef void * va_list[1];
#pragma intrinsic(__va_start)
extern void * __va_start(void);
#pragma intrinsic(__va_arg)
extern void * __va_arg(void *, ...);
# 11 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 2 3
# 43 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 3
struct __prbuf
{
char * ptr;
void (* func)(char);
};
# 85 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 3
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\conio.h" 1 3
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\errno.h" 1 3
# 29 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\errno.h" 3
extern int errno;
# 8 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\conio.h" 2 3
extern void init_uart(void);
extern char getch(void);
extern char getche(void);
extern void putch(char);
extern void ungetch(char);
extern __bit kbhit(void);
extern char * cgets(char *);
extern void cputs(const char *);
# 85 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 2 3
extern int cprintf(char *, ...);
#pragma printf_check(cprintf)
extern int _doprnt(struct __prbuf *, const register char *, register va_list);
# 180 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdio.h" 3
#pragma printf_check(vprintf) const
#pragma printf_check(vsprintf) const
extern char * gets(char *);
extern int puts(const char *);
extern int scanf(const char *, ...) __attribute__((unsupported("scanf() is not supported by this compiler")));
extern int sscanf(const char *, const char *, ...) __attribute__((unsupported("sscanf() is not supported by this compiler")));
extern int vprintf(const char *, va_list) __attribute__((unsupported("vprintf() is not supported by this compiler")));
extern int vsprintf(char *, const char *, va_list) __attribute__((unsupported("vsprintf() is not supported by this compiler")));
extern int vscanf(const char *, va_list ap) __attribute__((unsupported("vscanf() is not supported by this compiler")));
extern int vsscanf(const char *, const char *, va_list) __attribute__((unsupported("vsscanf() is not supported by this compiler")));
#pragma printf_check(printf) const
#pragma printf_check(sprintf) const
extern int sprintf(char *, const char *, ...);
extern int printf(const char *, ...);
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\ctype.h" 1 3
extern __bit isalpha(char);
extern __bit isupper(char);
extern __bit islower(char);
extern __bit isdigit(char);
extern __bit isxdigit(char);
extern __bit isspace(char);
extern __bit ispunct(char);
extern __bit isalnum(char);
extern __bit isprint(char);
extern __bit isgraph(char);
extern __bit iscntrl(char);
extern char toupper(char);
extern char tolower(char);
# 2 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdlib.h" 1 3
typedef unsigned short wchar_t;
typedef struct {
int rem;
int quot;
} div_t;
typedef struct {
unsigned rem;
unsigned quot;
} udiv_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef struct {
unsigned long quot;
unsigned long rem;
} uldiv_t;
# 65 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdlib.h" 3
extern double atof(const char *);
extern double strtod(const char *, const char **);
extern int atoi(const char *);
extern unsigned xtoi(const char *);
extern long atol(const char *);
extern long strtol(const char *, char **, int);
extern int rand(void);
extern void srand(unsigned int);
extern void * calloc(size_t, size_t);
extern div_t div(int numer, int denom);
extern udiv_t udiv(unsigned numer, unsigned denom);
extern ldiv_t ldiv(long numer, long denom);
extern uldiv_t uldiv(unsigned long numer,unsigned long denom);
extern unsigned long _lrotl(unsigned long value, unsigned int shift);
extern unsigned long _lrotr(unsigned long value, unsigned int shift);
extern unsigned int _rotl(unsigned int value, unsigned int shift);
extern unsigned int _rotr(unsigned int value, unsigned int shift);
extern void * malloc(size_t);
extern void free(void *);
extern void * realloc(void *, size_t);
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\xc8debug.h" 1 3
# 13 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\xc8debug.h" 3
#pragma intrinsic(__builtin_software_breakpoint)
extern void __builtin_software_breakpoint(void);
# 99 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\stdlib.h" 2 3
extern int atexit(void (*)(void));
extern char * getenv(const char *);
extern char ** environ;
extern int system(char *);
extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
extern void * bsearch(const void *, void *, size_t, size_t, int(*)(const void *, const void *));
extern int abs(int);
extern long labs(long);
extern char * itoa(char * buf, int val, int base);
extern char * utoa(char * buf, unsigned val, int base);
extern char * ltoa(char * buf, long val, int base);
extern char * ultoa(char * buf, unsigned long val, int base);
extern char * ftoa(float f, int * status);
# 3 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\string.h" 1 3
# 14 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\string.h" 3
extern void * memcpy(void *, const void *, size_t);
extern void * memmove(void *, const void *, size_t);
extern void * memset(void *, int, size_t);
# 36 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\string.h" 3
extern char * strcat(char *, const char *);
extern char * strcpy(char *, const char *);
extern char * strncat(char *, const char *, size_t);
extern char * strncpy(char *, const char *, size_t);
extern char * strdup(const char *);
extern char * strtok(char *, const char *);
extern int memcmp(const void *, const void *, size_t);
extern int strcmp(const char *, const char *);
extern int stricmp(const char *, const char *);
extern int strncmp(const char *, const char *, size_t);
extern int strnicmp(const char *, const char *, size_t);
extern void * memchr(const void *, int, size_t);
extern size_t strcspn(const char *, const char *);
extern char * strpbrk(const char *, const char *);
extern size_t strspn(const char *, const char *);
extern char * strstr(const char *, const char *);
extern char * stristr(const char *, const char *);
extern char * strerror(int);
extern size_t strlen(const char *);
extern char * strchr(const char *, int);
extern char * strichr(const char *, int);
extern char * strrchr(const char *, int);
extern char * strrichr(const char *, int);
# 4 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\math.h" 1 3
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\__unsupported.h" 1 3
# 4 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\math.h" 2 3
# 30 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\math.h" 3
extern double fabs(double);
extern double floor(double);
extern double ceil(double);
extern double modf(double, double *);
extern double sqrt(double);
extern double atof(const char *);
extern double sin(double) ;
extern double cos(double) ;
extern double tan(double) ;
extern double asin(double) ;
extern double acos(double) ;
extern double atan(double);
extern double atan2(double, double) ;
extern double log(double);
extern double log10(double);
extern double pow(double, double) ;
extern double exp(double) ;
extern double sinh(double) ;
extern double cosh(double) ;
extern double tanh(double);
extern double eval_poly(double, const double *, int);
extern double frexp(double, int *);
extern double ldexp(double, int);
extern double fmod(double, double);
extern double trunc(double);
extern double round(double);
# 7 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
# 1 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\include\\c90\\float.h" 1 3
# 8 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c" 2
#pragma warning disable 350
# 358 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
const static unsigned int dpowers[] = {1, 10, 100, 1000, 10000,
};
# 463 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
int
# 500 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
sprintf(char * sp, const char * f, ...)
{
va_list ap;
char c;
int width;
signed char prec;
unsigned char flag;
# 535 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
union {
unsigned long vd;
double integ;
} tmpval;
unsigned int val;
unsigned len;
const char * cp;
*ap = __va_start();
while((c = *f++)) {
if(c != '%')
{
((*sp++ = (c)));
continue;
}
width = 0;
flag = 0;
for(;;) {
switch(*f) {
# 591 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
case '0':
flag |= 0x04;
f++;
continue;
}
break;
}
# 609 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
if(isdigit((unsigned)*f)) {
width = 0;
do {
width *= 10;
width += *f++ - '0';
} while(isdigit((unsigned)*f));
}
# 654 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
switch(c = *f++) {
case 0:
goto alldone;
# 716 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
case 'd':
case 'i':
break;
# 747 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
case 's':
cp = (*(const char * *)__va_arg((*(const char * **)ap), (const char *)0));
if(!cp)
cp = "(null)";
len = 0;
while(cp[len])
len++;
dostring:
if(width > len)
width -= len;
else
width = 0;
while(width--)
((*sp++ = (' ')));
while(len--)
((*sp++ = (*cp++)));
continue;
# 803 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
case 'c':
# 818 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
c = (*(int *)__va_arg((*(int **)ap), (int)0));
default:
cp = (char *)&c;
len = 1;
goto dostring;
# 841 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
}
# 1272 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
{
val = (int)(*(int *)__va_arg((*(int **)ap), (int)0));
if((int)val < 0) {
flag |= 0x03;
val = -val;
}
}
# 1324 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
for(c = 1 ; c != sizeof dpowers/sizeof dpowers[0] ; c++)
if(val < dpowers[c])
break;
# 1364 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
if(width && flag & 0x03)
width--;
# 1400 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
if(width > c)
width -= c;
else
width = 0;
if(flag & 0x04) {
if(flag & 0x03)
((*sp++ = ('-')));
# 1434 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
if(width)
do
((*sp++ = ('0')));
while(--width);
} else
{
if(width
)
do
((*sp++ = (' ')));
while(--width);
if(flag & 0x03)
((*sp++ = ('-')));
# 1488 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
}
prec = c;
while(prec--) {
{
# 1508 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
c = (val / dpowers[prec]) % 10 + '0';
# 1542 "C:\\Program Files (x86)\\Microchip\\xc8\\v2.05\\pic\\sources\\c90\\common\\doprnt.c"
}
((*sp++ = (c)));
}
}
alldone:
*sp = 0;
return 0;
}
|