Automatic commit. Sat Sep 22 00:00:07 WST 2012
[matches/honours.git] / research / TCS / apparatus / source_code / datalog.lss
1
2 datalog.elf:     file format elf32-avr
3
4 Sections:
5 Idx Name          Size      VMA       LMA       File off  Algn
6   0 .data         0000008a  00800100  000019ac  00001a40  2**0
7                   CONTENTS, ALLOC, LOAD, DATA
8   1 .text         000019ac  00000000  00000000  00000094  2**1
9                   CONTENTS, ALLOC, LOAD, READONLY, CODE
10   2 .bss          00000081  0080018a  0080018a  00001aca  2**0
11                   ALLOC
12   3 .stab         00002a6c  00000000  00000000  00001acc  2**2
13                   CONTENTS, READONLY, DEBUGGING
14   4 .stabstr      00000471  00000000  00000000  00004538  2**0
15                   CONTENTS, READONLY, DEBUGGING
16   5 .debug_aranges 00000238  00000000  00000000  000049a9  2**0
17                   CONTENTS, READONLY, DEBUGGING
18   6 .debug_pubnames 000003c6  00000000  00000000  00004be1  2**0
19                   CONTENTS, READONLY, DEBUGGING
20   7 .debug_info   00001499  00000000  00000000  00004fa7  2**0
21                   CONTENTS, READONLY, DEBUGGING
22   8 .debug_abbrev 00000969  00000000  00000000  00006440  2**0
23                   CONTENTS, READONLY, DEBUGGING
24   9 .debug_line   0000149c  00000000  00000000  00006da9  2**0
25                   CONTENTS, READONLY, DEBUGGING
26  10 .debug_frame  00000330  00000000  00000000  00008248  2**2
27                   CONTENTS, READONLY, DEBUGGING
28  11 .debug_str    000004e3  00000000  00000000  00008578  2**0
29                   CONTENTS, READONLY, DEBUGGING
30  12 .debug_loc    00000ab7  00000000  00000000  00008a5b  2**0
31                   CONTENTS, READONLY, DEBUGGING
32  13 .debug_ranges 00000200  00000000  00000000  00009512  2**0
33                   CONTENTS, READONLY, DEBUGGING
34
35 Disassembly of section .text:
36
37 00000000 <__vectors>:
38 *
39 *       Purpose :               Clear the LCD
40 *
41 *****************************************************************************/
42 void LCD_Clear(void)
43 {
44        0:       63 c0           rjmp    .+198           ; 0xc8 <__ctors_end>
45         str[s] = '\0';
46         return s;
47 }
48
49 int sprintf(char * str, const char * format, ...)
50 {
51        2:       00 00           nop
52        4:       7d c0           rjmp    .+250           ; 0x100 <__bad_interrupt>
53        6:       00 00           nop
54        8:       7b c0           rjmp    .+246           ; 0x100 <__bad_interrupt>
55        a:       00 00           nop
56        c:       79 c0           rjmp    .+242           ; 0x100 <__bad_interrupt>
57        e:       00 00           nop
58       10:       77 c0           rjmp    .+238           ; 0x100 <__bad_interrupt>
59       12:       00 00           nop
60       14:       75 c0           rjmp    .+234           ; 0x100 <__bad_interrupt>
61       16:       00 00           nop
62       18:       73 c0           rjmp    .+230           ; 0x100 <__bad_interrupt>
63       1a:       00 00           nop
64       1c:       71 c0           rjmp    .+226           ; 0x100 <__bad_interrupt>
65       1e:       00 00           nop
66       20:       6f c0           rjmp    .+222           ; 0x100 <__bad_interrupt>
67       22:       00 00           nop
68       24:       6d c0           rjmp    .+218           ; 0x100 <__bad_interrupt>
69       26:       00 00           nop
70       28:       0c 94 55 09     jmp     0x12aa  ; 0x12aa <__vector_10>
71       2c:       69 c0           rjmp    .+210           ; 0x100 <__bad_interrupt>
72       2e:       00 00           nop
73       30:       67 c0           rjmp    .+206           ; 0x100 <__bad_interrupt>
74       32:       00 00           nop
75       34:       65 c0           rjmp    .+202           ; 0x100 <__bad_interrupt>
76       36:       00 00           nop
77       38:       63 c0           rjmp    .+198           ; 0x100 <__bad_interrupt>
78       3a:       00 00           nop
79       3c:       61 c0           rjmp    .+194           ; 0x100 <__bad_interrupt>
80       3e:       00 00           nop
81       40:       5f c0           rjmp    .+190           ; 0x100 <__bad_interrupt>
82       42:       00 00           nop
83       44:       5d c0           rjmp    .+186           ; 0x100 <__bad_interrupt>
84       46:       00 00           nop
85       48:       5b c0           rjmp    .+182           ; 0x100 <__bad_interrupt>
86       4a:       00 00           nop
87       4c:       59 c0           rjmp    .+178           ; 0x100 <__bad_interrupt>
88       4e:       00 00           nop
89       50:       57 c0           rjmp    .+174           ; 0x100 <__bad_interrupt>
90       52:       00 00           nop
91       54:       55 c0           rjmp    .+170           ; 0x100 <__bad_interrupt>
92       56:       00 00           nop
93       58:       b6 c4           rjmp    .+2412          ; 0x9c6 <__vector_22>
94         ...
95
96 0000005c <LCD_character_table>:
97       5c:       51 0a 80 2a 00 00 00 0a 00 ff 00 00 59 55 18 01     Q..*........YU..
98       6c:       11 1e 11 1b 50 0b 41 1b 41 1f 11 01 51 1f 51 1b     ....P.A.A...Q.Q.
99         ...
100       88:       00 00 51 0f 91 39 41 14 91 31 41 1e 41 0e 41 1d     ..Q..9A..1A.A.A.
101       98:       50 0f 80 20 10 15 48 86 40 14 78 05 70 85 51 15     P.. [email protected].
102       a8:       51 0e 51 95 51 8e 21 90 81 20 50 15 48 44 50 c5     Q.Q.Q.!.. P.HDP.
103       b8:       28 c0 28 20 09 50 00 00 00 00 00 00 00 00 00 00     (.( .P..........
104
105 000000c8 <__ctors_end>:
106       c8:       11 24           eor     r1, r1
107       ca:       1f be           out     0x3f, r1        ; 63
108       cc:       cf ef           ldi     r28, 0xFF       ; 255
109       ce:       d4 e0           ldi     r29, 0x04       ; 4
110       d0:       de bf           out     0x3e, r29       ; 62
111       d2:       cd bf           out     0x3d, r28       ; 61
112
113 000000d4 <__do_copy_data>:
114       d4:       11 e0           ldi     r17, 0x01       ; 1
115       d6:       a0 e0           ldi     r26, 0x00       ; 0
116       d8:       b1 e0           ldi     r27, 0x01       ; 1
117       da:       ec ea           ldi     r30, 0xAC       ; 172
118       dc:       f9 e1           ldi     r31, 0x19       ; 25
119       de:       02 c0           rjmp    .+4             ; 0xe4 <.do_copy_data_start>
120
121 000000e0 <.do_copy_data_loop>:
122       e0:       05 90           lpm     r0, Z+
123       e2:       0d 92           st      X+, r0
124
125 000000e4 <.do_copy_data_start>:
126       e4:       aa 38           cpi     r26, 0x8A       ; 138
127       e6:       b1 07           cpc     r27, r17
128       e8:       d9 f7           brne    .-10            ; 0xe0 <.do_copy_data_loop>
129
130 000000ea <__do_clear_bss>:
131       ea:       12 e0           ldi     r17, 0x02       ; 2
132       ec:       aa e8           ldi     r26, 0x8A       ; 138
133       ee:       b1 e0           ldi     r27, 0x01       ; 1
134       f0:       01 c0           rjmp    .+2             ; 0xf4 <.do_clear_bss_start>
135
136 000000f2 <.do_clear_bss_loop>:
137       f2:       1d 92           st      X+, r1
138
139 000000f4 <.do_clear_bss_start>:
140       f4:       ab 30           cpi     r26, 0x0B       ; 11
141       f6:       b1 07           cpc     r27, r17
142       f8:       e1 f7           brne    .-8             ; 0xf2 <.do_clear_bss_loop>
143       fa:       9d d0           rcall   .+314           ; 0x236 <main>
144       fc:       0c 94 d4 0c     jmp     0x19a8  ; 0x19a8 <_exit>
145
146 00000100 <__bad_interrupt>:
147      100:       7f cf           rjmp    .-258           ; 0x0 <__vectors>
148
149 00000102 <Delay>:
150 *
151 *   Purpose :       Delay-loop
152 *
153 *****************************************************************************/
154 void Delay(unsigned int millisec)
155 {
156      102:       06 c0           rjmp    .+12            ; 0x110 <Delay+0xe>
157         // mt, int i did not work in the simulator:  int i; 
158         uint8_t i;
159
160         while (millisec--) {
161      104:       20 e0           ldi     r18, 0x00       ; 0
162                 for (i=0; i<125; i++) {
163                         asm volatile ("nop"::);
164      106:       00 00           nop
165 {
166         // mt, int i did not work in the simulator:  int i; 
167         uint8_t i;
168
169         while (millisec--) {
170                 for (i=0; i<125; i++) {
171      108:       2f 5f           subi    r18, 0xFF       ; 255
172      10a:       2d 37           cpi     r18, 0x7D       ; 125
173      10c:       e1 f7           brne    .-8             ; 0x106 <Delay+0x4>
174      10e:       01 97           sbiw    r24, 0x01       ; 1
175 void Delay(unsigned int millisec)
176 {
177         // mt, int i did not work in the simulator:  int i; 
178         uint8_t i;
179
180         while (millisec--) {
181      110:       00 97           sbiw    r24, 0x00       ; 0
182      112:       c1 f7           brne    .-16            ; 0x104 <Delay+0x2>
183                 for (i=0; i<125; i++) {
184                         asm volatile ("nop"::);
185                 }
186         }
187 }
188      114:       08 95           ret
189
190 00000116 <OSCCAL_calibration>:
191 {
192     unsigned char calibrate = FALSE;
193     int temp;
194     unsigned char tempL;
195
196     CLKPR = (1<<CLKPCE);        // set Clock Prescaler Change Enable
197      116:       80 e8           ldi     r24, 0x80       ; 128
198      118:       80 93 61 00     sts     0x0061, r24
199     // set prescaler = 8, Inter RC 8Mhz / 8 = 1Mhz
200     CLKPR = (1<<CLKPS1) | (1<<CLKPS0);
201      11c:       83 e0           ldi     r24, 0x03       ; 3
202      11e:       80 93 61 00     sts     0x0061, r24
203     
204     TIMSK2 = 0;             //disable OCIE2A and TOIE2
205      122:       10 92 70 00     sts     0x0070, r1
206
207     ASSR = (1<<AS2);        //select asynchronous operation of timer2 (32,768kHz)
208      126:       88 e0           ldi     r24, 0x08       ; 8
209      128:       80 93 b6 00     sts     0x00B6, r24
210     
211     OCR2A = 200;            // set timer2 compare value 
212      12c:       88 ec           ldi     r24, 0xC8       ; 200
213      12e:       80 93 b3 00     sts     0x00B3, r24
214
215     TIMSK0 = 0;             // delete any interrupt sources
216      132:       10 92 6e 00     sts     0x006E, r1
217         
218     TCCR1B = (1<<CS10);     // start timer1 with no prescaling
219      136:       81 e0           ldi     r24, 0x01       ; 1
220      138:       80 93 81 00     sts     0x0081, r24
221     TCCR2A = (1<<CS20);     // start timer2 with no prescaling
222      13c:       80 93 b0 00     sts     0x00B0, r24
223
224     while((ASSR & 0x01) | (ASSR & 0x04));       //wait for TCN2UB and TCR2UB to be cleared
225      140:       20 91 b6 00     lds     r18, 0x00B6
226      144:       80 91 b6 00     lds     r24, 0x00B6
227      148:       90 e0           ldi     r25, 0x00       ; 0
228      14a:       84 70           andi    r24, 0x04       ; 4
229      14c:       90 70           andi    r25, 0x00       ; 0
230      14e:       30 e0           ldi     r19, 0x00       ; 0
231      150:       21 70           andi    r18, 0x01       ; 1
232      152:       30 70           andi    r19, 0x00       ; 0
233      154:       82 2b           or      r24, r18
234      156:       93 2b           or      r25, r19
235      158:       89 2b           or      r24, r25
236      15a:       91 f7           brne    .-28            ; 0x140 <OSCCAL_calibration+0x2a>
237
238     Delay(1000);    // wait for external crystal to stabilise
239      15c:       88 ee           ldi     r24, 0xE8       ; 232
240      15e:       93 e0           ldi     r25, 0x03       ; 3
241      160:       d0 df           rcall   .-96            ; 0x102 <Delay>
242     
243     while(!calibrate)
244     {
245         cli(); // mt __disable_interrupt();  // disable global interrupt
246         
247         TIFR1 = 0xFF;   // delete TIFR1 flags
248      162:       3f ef           ldi     r19, 0xFF       ; 255
249     
250         if (temp > 6250)
251         {
252             OSCCAL--;   // the internRC oscillator runs to fast, decrease the OSCCAL
253         }
254         else if (temp < 6120)
255      164:       41 e0           ldi     r20, 0x01       ; 1
256
257     Delay(1000);    // wait for external crystal to stabilise
258     
259     while(!calibrate)
260     {
261         cli(); // mt __disable_interrupt();  // disable global interrupt
262      166:       f8 94           cli
263         
264         TIFR1 = 0xFF;   // delete TIFR1 flags
265      168:       36 bb           out     0x16, r19       ; 22
266         TIFR2 = 0xFF;   // delete TIFR2 flags
267      16a:       37 bb           out     0x17, r19       ; 23
268         
269         TCNT1H = 0;     // clear timer1 counter
270      16c:       10 92 85 00     sts     0x0085, r1
271         TCNT1L = 0;
272      170:       10 92 84 00     sts     0x0084, r1
273         TCNT2 = 0;      // clear timer2 counter
274      174:       10 92 b2 00     sts     0x00B2, r1
275            
276         // shc/mt while ( !(TIFR2 && (1<<OCF2A)) );   // wait for timer2 compareflag    
277         while ( !(TIFR2 & (1<<OCF2A)) );   // wait for timer2 compareflag
278      178:       b9 9b           sbis    0x17, 1 ; 23
279      17a:       fe cf           rjmp    .-4             ; 0x178 <OSCCAL_calibration+0x62>
280
281         TCCR1B = 0; // stop timer1
282      17c:       10 92 81 00     sts     0x0081, r1
283
284         sei(); // __enable_interrupt();  // enable global interrupt
285      180:       78 94           sei
286     
287         // shc/mt if ( (TIFR1 && (1<<TOV1)) )
288         if ( (TIFR1 & (1<<TOV1)) )
289      182:       b0 99           sbic    0x16, 0 ; 22
290      184:       16 c0           rjmp    .+44            ; 0x1b2 <OSCCAL_calibration+0x9c>
291         {
292             temp = 0xFFFF;      // if timer1 overflows, set the temp to 0xFFFF
293         }
294         else
295         {   // read out the timer1 counter value
296             tempL = TCNT1L;
297      186:       20 91 84 00     lds     r18, 0x0084
298             temp = TCNT1H;
299      18a:       80 91 85 00     lds     r24, 0x0085
300      18e:       90 e0           ldi     r25, 0x00       ; 0
301             temp = (temp << 8);
302      190:       98 2f           mov     r25, r24
303      192:       88 27           eor     r24, r24
304             temp += tempL;
305      194:       82 0f           add     r24, r18
306      196:       91 1d           adc     r25, r1
307         }
308     
309         if (temp > 6250)
310      198:       28 e1           ldi     r18, 0x18       ; 24
311      19a:       8b 36           cpi     r24, 0x6B       ; 107
312      19c:       92 07           cpc     r25, r18
313      19e:       24 f0           brlt    .+8             ; 0x1a8 <OSCCAL_calibration+0x92>
314         {
315             OSCCAL--;   // the internRC oscillator runs to fast, decrease the OSCCAL
316      1a0:       80 91 66 00     lds     r24, 0x0066
317      1a4:       81 50           subi    r24, 0x01       ; 1
318      1a6:       08 c0           rjmp    .+16            ; 0x1b8 <OSCCAL_calibration+0xa2>
319         }
320         else if (temp < 6120)
321      1a8:       88 5e           subi    r24, 0xE8       ; 232
322      1aa:       97 41           sbci    r25, 0x17       ; 23
323      1ac:       14 f0           brlt    .+4             ; 0x1b2 <OSCCAL_calibration+0x9c>
324      1ae:       81 e0           ldi     r24, 0x01       ; 1
325      1b0:       06 c0           rjmp    .+12            ; 0x1be <OSCCAL_calibration+0xa8>
326         {
327             OSCCAL++;   // the internRC oscillator runs to slow, increase the OSCCAL
328      1b2:       80 91 66 00     lds     r24, 0x0066
329      1b6:       8f 5f           subi    r24, 0xFF       ; 255
330      1b8:       80 93 66 00     sts     0x0066, r24
331      1bc:       80 e0           ldi     r24, 0x00       ; 0
332         }
333         else
334             calibrate = TRUE;   // the interRC is correct
335
336         TCCR1B = (1<<CS10); // start timer1
337      1be:       40 93 81 00     sts     0x0081, r20
338
339     while((ASSR & 0x01) | (ASSR & 0x04));       //wait for TCN2UB and TCR2UB to be cleared
340
341     Delay(1000);    // wait for external crystal to stabilise
342     
343     while(!calibrate)
344      1c2:       88 23           and     r24, r24
345      1c4:       81 f2           breq    .-96            ; 0x166 <OSCCAL_calibration+0x50>
346         else
347             calibrate = TRUE;   // the interRC is correct
348
349         TCCR1B = (1<<CS10); // start timer1
350     }
351 }
352      1c6:       08 95           ret
353
354 000001c8 <Initialization>:
355 *   Purpose :       Initializate the different modules
356 *
357 *****************************************************************************/
358 void Initialization(void)
359 {
360     OSCCAL_calibration();       // calibrate the OSCCAL byte
361      1c8:       a6 df           rcall   .-180           ; 0x116 <OSCCAL_calibration>
362         
363     CLKPR = (1<<CLKPCE);        // set Clock Prescaler Change Enable
364      1ca:       e1 e6           ldi     r30, 0x61       ; 97
365      1cc:       f0 e0           ldi     r31, 0x00       ; 0
366      1ce:       80 e8           ldi     r24, 0x80       ; 128
367      1d0:       80 83           st      Z, r24
368
369     // set prescaler = 8, Inter RC 8Mhz / 8 = 1Mhz
370     CLKPR = (1<<CLKPS1) | (1<<CLKPS0);
371      1d2:       83 e0           ldi     r24, 0x03       ; 3
372      1d4:       80 83           st      Z, r24
373
374     Timer0_Init();              // Used when playing music etc.
375      1d6:       0e 94 4c 09     call    0x1298  ; 0x1298 <Timer0_Init>
376
377     USART_Init(UART_4800);      // Baud rate = 4800bps
378      1da:       8c e0           ldi     r24, 0x0C       ; 12
379      1dc:       90 e0           ldi     r25, 0x00       ; 0
380      1de:       0e 94 7e 09     call    0x12fc  ; 0x12fc <USART_Init>
381         
382     LCD_Init();                 // initialize the LCD
383      1e2:       d7 d3           rcall   .+1966          ; 0x992 <LCD_Init>
384
385
386         //Disable JTAG to use ADC4-7
387         MCUCR |= ( 1 <<JTD );
388      1e4:       85 b7           in      r24, 0x35       ; 53
389      1e6:       80 68           ori     r24, 0x80       ; 128
390      1e8:       85 bf           out     0x35, r24       ; 53
391         MCUCR |= ( 1 <<JTD );
392      1ea:       85 b7           in      r24, 0x35       ; 53
393      1ec:       80 68           ori     r24, 0x80       ; 128
394      1ee:       85 bf           out     0x35, r24       ; 53
395
396
397
398
399
400         setup.adc_averages = 1;
401      1f0:       81 e0           ldi     r24, 0x01       ; 1
402      1f2:       90 e0           ldi     r25, 0x00       ; 0
403      1f4:       90 93 91 01     sts     0x0191, r25
404      1f8:       80 93 90 01     sts     0x0190, r24
405         setup.poll_delay = 1;
406      1fc:       90 93 8f 01     sts     0x018F, r25
407      200:       80 93 8e 01     sts     0x018E, r24
408         setup.poll_timeout = (uint32)(-1);
409      204:       8f ef           ldi     r24, 0xFF       ; 255
410      206:       9f ef           ldi     r25, 0xFF       ; 255
411      208:       af ef           ldi     r26, 0xFF       ; 255
412      20a:       bf ef           ldi     r27, 0xFF       ; 255
413      20c:       80 93 92 01     sts     0x0192, r24
414      210:       90 93 93 01     sts     0x0193, r25
415      214:       a0 93 94 01     sts     0x0194, r26
416      218:       b0 93 95 01     sts     0x0195, r27
417         setup.elapsed_time = 0;
418      21c:       10 92 96 01     sts     0x0196, r1
419      220:       10 92 97 01     sts     0x0197, r1
420      224:       10 92 98 01     sts     0x0198, r1
421      228:       10 92 99 01     sts     0x0199, r1
422         setup.dac_value = 0;
423      22c:       10 92 9b 01     sts     0x019B, r1
424      230:       10 92 9a 01     sts     0x019A, r1
425 }
426      234:       08 95           ret
427
428 00000236 <main>:
429 {    
430
431
432
433     // Program initalization
434         Initialization();  
435      236:       c8 df           rcall   .-112           ; 0x1c8 <Initialization>
436         sei(); // mt __enable_interrupt();
437      238:       78 94           sei
438
439
440         LCD_puts("hello"); 
441      23a:       80 e0           ldi     r24, 0x00       ; 0
442      23c:       91 e0           ldi     r25, 0x01       ; 1
443      23e:       73 d4           rcall   .+2278          ; 0xb26 <LCD_puts>
444
445         USART_printf("\r\n# hello\r\n");
446      240:       00 d0           rcall   .+0             ; 0x242 <main+0xc>
447      242:       86 e0           ldi     r24, 0x06       ; 6
448      244:       91 e0           ldi     r25, 0x01       ; 1
449      246:       ed b7           in      r30, 0x3d       ; 61
450      248:       fe b7           in      r31, 0x3e       ; 62
451      24a:       92 83           std     Z+2, r25        ; 0x02
452      24c:       81 83           std     Z+1, r24        ; 0x01
453      24e:       0e 94 a7 09     call    0x134e  ; 0x134e <USART_printf>
454         Delay(1000);
455      252:       0f 90           pop     r0
456      254:       0f 90           pop     r0
457      256:       88 ee           ldi     r24, 0xE8       ; 232
458      258:       93 e0           ldi     r25, 0x03       ; 3
459      25a:       53 df           rcall   .-346           ; 0x102 <Delay>
460
461
462         for (;;)
463         {
464                 
465                 ParseCommand();
466      25c:       6e d5           rcall   .+2780          ; 0xd3a <ParseCommand>
467      25e:       fe cf           rjmp    .-4             ; 0x25c <main+0x26>
468
469 00000260 <ADC_read>:
470 *
471 *   Purpose :       Do a Analog to Digital Conversion
472 *
473 *****************************************************************************/
474 float ADC_read(uint8 input)
475 {
476      260:       2f 92           push    r2
477      262:       3f 92           push    r3
478      264:       4f 92           push    r4
479      266:       5f 92           push    r5
480      268:       6f 92           push    r6
481      26a:       7f 92           push    r7
482      26c:       8f 92           push    r8
483      26e:       9f 92           push    r9
484      270:       af 92           push    r10
485      272:       bf 92           push    r11
486      274:       cf 92           push    r12
487      276:       df 92           push    r13
488      278:       ef 92           push    r14
489      27a:       ff 92           push    r15
490      27c:       0f 93           push    r16
491      27e:       1f 93           push    r17
492      280:       df 93           push    r29
493      282:       cf 93           push    r28
494      284:       00 d0           rcall   .+0             ; 0x286 <ADC_read+0x26>
495      286:       00 d0           rcall   .+0             ; 0x288 <ADC_read+0x28>
496      288:       0f 92           push    r0
497      28a:       cd b7           in      r28, 0x3d       ; 61
498      28c:       de b7           in      r29, 0x3e       ; 62
499      28e:       8b 83           std     Y+3, r24        ; 0x03
500         
501         ADMUX = input;
502      290:       80 93 7c 00     sts     0x007C, r24
503         if (input == 1)
504      294:       81 30           cpi     r24, 0x01       ; 1
505      296:       51 f4           brne    .+20            ; 0x2ac <ADC_read+0x4c>
506         {
507                 ADMUX |= (1<<REFS0) | (1<<REFS1);
508      298:       80 91 7c 00     lds     r24, 0x007C
509      29c:       80 6c           ori     r24, 0xC0       ; 192
510      29e:       80 93 7c 00     sts     0x007C, r24
511                 while (SCK_ON);
512      2a2:       2b 99           sbic    0x05, 3 ; 5
513      2a4:       fe cf           rjmp    .-4             ; 0x2a2 <ADC_read+0x42>
514                 while (SCK_OFF);
515      2a6:       2b 9b           sbis    0x05, 3 ; 5
516      2a8:       fe cf           rjmp    .-4             ; 0x2a6 <ADC_read+0x46>
517      2aa:       0a c0           rjmp    .+20            ; 0x2c0 <ADC_read+0x60>
518         }
519         else
520         {
521                 ADMUX |= (1<<REFS0);
522      2ac:       80 91 7c 00     lds     r24, 0x007C
523      2b0:       80 64           ori     r24, 0x40       ; 64
524      2b2:       80 93 7c 00     sts     0x007C, r24
525                 ADMUX &= ~(1<<REFS1);
526      2b6:       80 91 7c 00     lds     r24, 0x007C
527      2ba:       8f 77           andi    r24, 0x7F       ; 127
528      2bc:       80 93 7c 00     sts     0x007C, r24
529         float delta = 0;
530         float M2 = 0;
531  //   uint32 ADCr = 0;
532         
533
534     ADCSRA = (1<<ADEN) | (1<<ADPS1) | (1<<ADPS0); 
535      2c0:       83 e8           ldi     r24, 0x83       ; 131
536      2c2:       80 93 7a 00     sts     0x007A, r24
537
538     //do a dummy readout first
539     ADCSRA |= (1<<ADSC);        // do single conversion
540      2c6:       80 91 7a 00     lds     r24, 0x007A
541      2ca:       80 64           ori     r24, 0x40       ; 64
542      2cc:       80 93 7a 00     sts     0x007A, r24
543     while(!(ADCSRA & 0x10));    // wait for conversion done, ADIF flag active
544      2d0:       80 91 7a 00     lds     r24, 0x007A
545      2d4:       84 ff           sbrs    r24, 4
546      2d6:       fc cf           rjmp    .-8             ; 0x2d0 <ADC_read+0x70>
547         
548     for(i=0;i<setup.adc_averages;i++)            // do several ADC conversions, for averaging
549      2d8:       20 91 90 01     lds     r18, 0x0190
550      2dc:       30 91 91 01     lds     r19, 0x0191
551      2e0:       3a 83           std     Y+2, r19        ; 0x02
552      2e2:       29 83           std     Y+1, r18        ; 0x01
553      2e4:       1d 82           std     Y+5, r1 ; 0x05
554      2e6:       1c 82           std     Y+4, r1 ; 0x04
555      2e8:       0f 2e           mov     r0, r31
556      2ea:       f0 e0           ldi     r31, 0x00       ; 0
557      2ec:       2f 2e           mov     r2, r31
558      2ee:       f0 e0           ldi     r31, 0x00       ; 0
559      2f0:       3f 2e           mov     r3, r31
560      2f2:       f0 e0           ldi     r31, 0x00       ; 0
561      2f4:       4f 2e           mov     r4, r31
562      2f6:       f0 e0           ldi     r31, 0x00       ; 0
563      2f8:       5f 2e           mov     r5, r31
564      2fa:       f0 2d           mov     r31, r0
565      2fc:       42 01           movw    r8, r4
566      2fe:       31 01           movw    r6, r2
567      300:       57 c0           rjmp    .+174           ; 0x3b0 <ADC_read+0x150>
568     {
569         ADCSRA |= (1<<ADSC);        // do single conversion
570      302:       80 91 7a 00     lds     r24, 0x007A
571      306:       80 64           ori     r24, 0x40       ; 64
572      308:       80 93 7a 00     sts     0x007A, r24
573         while(!(ADCSRA & 0x10));    // wait for conversion done, ADIF flag active
574      30c:       80 91 7a 00     lds     r24, 0x007A
575      310:       84 ff           sbrs    r24, 4
576      312:       fc cf           rjmp    .-8             ; 0x30c <ADC_read+0xac>
577         
578         ADC_temp = ADCL;            // read out ADCL register
579      314:       60 91 78 00     lds     r22, 0x0078
580      318:       70 e0           ldi     r23, 0x00       ; 0
581      31a:       80 e0           ldi     r24, 0x00       ; 0
582      31c:       90 e0           ldi     r25, 0x00       ; 0
583      31e:       0e 94 db 0a     call    0x15b6  ; 0x15b6 <__floatunsisf>
584      322:       7b 01           movw    r14, r22
585      324:       8c 01           movw    r16, r24
586         ADC_temp += (ADCH << 8);    // read out ADCH register        
587      326:       60 91 79 00     lds     r22, 0x0079
588      32a:       70 e0           ldi     r23, 0x00       ; 0
589      32c:       76 2f           mov     r23, r22
590      32e:       66 27           eor     r22, r22
591      330:       88 27           eor     r24, r24
592      332:       77 fd           sbrc    r23, 7
593      334:       80 95           com     r24
594      336:       98 2f           mov     r25, r24
595      338:       0e 94 dd 0a     call    0x15ba  ; 0x15ba <__floatsisf>
596      33c:       9b 01           movw    r18, r22
597      33e:       ac 01           movw    r20, r24
598      340:       c8 01           movw    r24, r16
599      342:       b7 01           movw    r22, r14
600      344:       0e 94 da 09     call    0x13b4  ; 0x13b4 <__addsf3>
601      348:       7b 01           movw    r14, r22
602      34a:       8c 01           movw    r16, r24
603
604         delta = ADC_temp - mean;
605      34c:       a2 01           movw    r20, r4
606      34e:       91 01           movw    r18, r2
607      350:       0e 94 d9 09     call    0x13b2  ; 0x13b2 <__subsf3>
608      354:       5b 01           movw    r10, r22
609      356:       6c 01           movw    r12, r24
610         mean = mean + delta/(i+1);
611      358:       8c 81           ldd     r24, Y+4        ; 0x04
612      35a:       9d 81           ldd     r25, Y+5        ; 0x05
613      35c:       01 96           adiw    r24, 0x01       ; 1
614      35e:       9d 83           std     Y+5, r25        ; 0x05
615      360:       8c 83           std     Y+4, r24        ; 0x04
616      362:       bc 01           movw    r22, r24
617      364:       80 e0           ldi     r24, 0x00       ; 0
618      366:       90 e0           ldi     r25, 0x00       ; 0
619      368:       0e 94 db 0a     call    0x15b6  ; 0x15b6 <__floatunsisf>
620      36c:       9b 01           movw    r18, r22
621      36e:       ac 01           movw    r20, r24
622      370:       c6 01           movw    r24, r12
623      372:       b5 01           movw    r22, r10
624      374:       0e 94 42 0a     call    0x1484  ; 0x1484 <__divsf3>
625      378:       9b 01           movw    r18, r22
626      37a:       ac 01           movw    r20, r24
627      37c:       c2 01           movw    r24, r4
628      37e:       b1 01           movw    r22, r2
629      380:       0e 94 da 09     call    0x13b4  ; 0x13b4 <__addsf3>
630      384:       1b 01           movw    r2, r22
631      386:       2c 01           movw    r4, r24
632         M2 = M2 + delta*(ADC_temp - mean);
633      388:       c8 01           movw    r24, r16
634      38a:       b7 01           movw    r22, r14
635      38c:       a2 01           movw    r20, r4
636      38e:       91 01           movw    r18, r2
637      390:       0e 94 d9 09     call    0x13b2  ; 0x13b2 <__subsf3>
638      394:       9b 01           movw    r18, r22
639      396:       ac 01           movw    r20, r24
640      398:       c6 01           movw    r24, r12
641      39a:       b5 01           movw    r22, r10
642      39c:       0e 94 8d 0b     call    0x171a  ; 0x171a <__mulsf3>
643      3a0:       9b 01           movw    r18, r22
644      3a2:       ac 01           movw    r20, r24
645      3a4:       c4 01           movw    r24, r8
646      3a6:       b3 01           movw    r22, r6
647      3a8:       0e 94 da 09     call    0x13b4  ; 0x13b4 <__addsf3>
648      3ac:       3b 01           movw    r6, r22
649      3ae:       4c 01           movw    r8, r24
650
651     //do a dummy readout first
652     ADCSRA |= (1<<ADSC);        // do single conversion
653     while(!(ADCSRA & 0x10));    // wait for conversion done, ADIF flag active
654         
655     for(i=0;i<setup.adc_averages;i++)            // do several ADC conversions, for averaging
656      3b0:       ec 81           ldd     r30, Y+4        ; 0x04
657      3b2:       fd 81           ldd     r31, Y+5        ; 0x05
658      3b4:       29 81           ldd     r18, Y+1        ; 0x01
659      3b6:       3a 81           ldd     r19, Y+2        ; 0x02
660      3b8:       e2 17           cp      r30, r18
661      3ba:       f3 07           cpc     r31, r19
662      3bc:       08 f4           brcc    .+2             ; 0x3c0 <ADC_read+0x160>
663      3be:       a1 cf           rjmp    .-190           ; 0x302 <ADC_read+0xa2>
664     }
665    // ADCr = ADCr / setup.adc_averages;     // average the samples
666         
667
668             
669     ADCSRA &= ~(1<<ADEN);      // disable the ADC
670      3c0:       80 91 7a 00     lds     r24, 0x007A
671      3c4:       8f 77           andi    r24, 0x7F       ; 127
672      3c6:       80 93 7a 00     sts     0x007A, r24
673
674         setup.adc_values[input] = mean;
675      3ca:       3b 81           ldd     r19, Y+3        ; 0x03
676      3cc:       03 2f           mov     r16, r19
677      3ce:       10 e0           ldi     r17, 0x00       ; 0
678      3d0:       f8 01           movw    r30, r16
679      3d2:       ee 0f           add     r30, r30
680      3d4:       ff 1f           adc     r31, r31
681      3d6:       ee 0f           add     r30, r30
682      3d8:       ff 1f           adc     r31, r31
683      3da:       e2 57           subi    r30, 0x72       ; 114
684      3dc:       fe 4f           sbci    r31, 0xFE       ; 254
685      3de:       26 86           std     Z+14, r2        ; 0x0e
686      3e0:       37 86           std     Z+15, r3        ; 0x0f
687      3e2:       40 8a           std     Z+16, r4        ; 0x10
688      3e4:       51 8a           std     Z+17, r5        ; 0x11
689         if (M2 < 0)
690      3e6:       c4 01           movw    r24, r8
691      3e8:       b3 01           movw    r22, r6
692      3ea:       20 e0           ldi     r18, 0x00       ; 0
693      3ec:       30 e0           ldi     r19, 0x00       ; 0
694      3ee:       40 e0           ldi     r20, 0x00       ; 0
695      3f0:       50 e0           ldi     r21, 0x00       ; 0
696      3f2:       0e 94 3e 0a     call    0x147c  ; 0x147c <__cmpsf2>
697      3f6:       88 23           and     r24, r24
698      3f8:       24 f4           brge    .+8             ; 0x402 <ADC_read+0x1a2>
699                 M2 = -M2;
700      3fa:       97 fa           bst     r9, 7
701      3fc:       90 94           com     r9
702      3fe:       97 f8           bld     r9, 7
703      400:       90 94           com     r9
704         setup.adc_variance[input] = M2/setup.adc_averages;
705      402:       00 0f           add     r16, r16
706      404:       11 1f           adc     r17, r17
707      406:       00 0f           add     r16, r16
708      408:       11 1f           adc     r17, r17
709      40a:       02 57           subi    r16, 0x72       ; 114
710      40c:       1e 4f           sbci    r17, 0xFE       ; 254
711      40e:       e9 81           ldd     r30, Y+1        ; 0x01
712      410:       fa 81           ldd     r31, Y+2        ; 0x02
713      412:       bf 01           movw    r22, r30
714      414:       80 e0           ldi     r24, 0x00       ; 0
715      416:       90 e0           ldi     r25, 0x00       ; 0
716      418:       0e 94 db 0a     call    0x15b6  ; 0x15b6 <__floatunsisf>
717      41c:       9b 01           movw    r18, r22
718      41e:       ac 01           movw    r20, r24
719      420:       c4 01           movw    r24, r8
720      422:       b3 01           movw    r22, r6
721      424:       0e 94 42 0a     call    0x1484  ; 0x1484 <__divsf3>
722      428:       f8 01           movw    r30, r16
723      42a:       66 a7           std     Z+46, r22       ; 0x2e
724      42c:       77 a7           std     Z+47, r23       ; 0x2f
725      42e:       80 ab           std     Z+48, r24       ; 0x30
726      430:       91 ab           std     Z+49, r25       ; 0x31
727 //
728         return (setup.adc_values[input]);
729 }
730      432:       c2 01           movw    r24, r4
731      434:       b1 01           movw    r22, r2
732      436:       0f 90           pop     r0
733      438:       0f 90           pop     r0
734      43a:       0f 90           pop     r0
735      43c:       0f 90           pop     r0
736      43e:       0f 90           pop     r0
737      440:       cf 91           pop     r28
738      442:       df 91           pop     r29
739      444:       1f 91           pop     r17
740      446:       0f 91           pop     r16
741      448:       ff 90           pop     r15
742      44a:       ef 90           pop     r14
743      44c:       df 90           pop     r13
744      44e:       cf 90           pop     r12
745      450:       bf 90           pop     r11
746      452:       af 90           pop     r10
747      454:       9f 90           pop     r9
748      456:       8f 90           pop     r8
749      458:       7f 90           pop     r7
750      45a:       6f 90           pop     r6
751      45c:       5f 90           pop     r5
752      45e:       4f 90           pop     r4
753      460:       3f 90           pop     r3
754      462:       2f 90           pop     r2
755      464:       08 95           ret
756
757 00000466 <reset>:
758         return 0;
759 }
760
761 uint8 reset(char * arg)
762 {
763         Initialization();
764      466:       b0 de           rcall   .-672           ; 0x1c8 <Initialization>
765         return 0;
766 }
767      468:       80 e0           ldi     r24, 0x00       ; 0
768      46a:       08 95           ret
769
770 0000046c <set_delay>:
771         LCD_printf("timeout %i", setup.poll_timeout);
772         return 0;
773 }
774
775 uint8 set_delay(char * arg)
776 {
777      46c:       fc 01           movw    r30, r24
778         if (arg[0] != '\0')
779      46e:       80 81           ld      r24, Z
780      470:       88 23           and     r24, r24
781      472:       39 f0           breq    .+14            ; 0x482 <set_delay+0x16>
782         {
783                 setup.poll_delay = atoi(arg);
784      474:       cf 01           movw    r24, r30
785      476:       0e 94 af 0c     call    0x195e  ; 0x195e <atoi>
786      47a:       90 93 8f 01     sts     0x018F, r25
787      47e:       80 93 8e 01     sts     0x018E, r24
788         }
789         USART_printf("# delay %i\r\n", setup.poll_delay);
790      482:       00 d0           rcall   .+0             ; 0x484 <set_delay+0x18>
791      484:       00 d0           rcall   .+0             ; 0x486 <set_delay+0x1a>
792      486:       82 e1           ldi     r24, 0x12       ; 18
793      488:       91 e0           ldi     r25, 0x01       ; 1
794      48a:       ed b7           in      r30, 0x3d       ; 61
795      48c:       fe b7           in      r31, 0x3e       ; 62
796      48e:       92 83           std     Z+2, r25        ; 0x02
797      490:       81 83           std     Z+1, r24        ; 0x01
798      492:       80 91 8e 01     lds     r24, 0x018E
799      496:       90 91 8f 01     lds     r25, 0x018F
800      49a:       94 83           std     Z+4, r25        ; 0x04
801      49c:       83 83           std     Z+3, r24        ; 0x03
802      49e:       57 d7           rcall   .+3758          ; 0x134e <USART_printf>
803         LCD_printf("delay %i", setup.poll_delay);
804      4a0:       8f e1           ldi     r24, 0x1F       ; 31
805      4a2:       91 e0           ldi     r25, 0x01       ; 1
806      4a4:       ed b7           in      r30, 0x3d       ; 61
807      4a6:       fe b7           in      r31, 0x3e       ; 62
808      4a8:       92 83           std     Z+2, r25        ; 0x02
809      4aa:       81 83           std     Z+1, r24        ; 0x01
810      4ac:       80 91 8e 01     lds     r24, 0x018E
811      4b0:       90 91 8f 01     lds     r25, 0x018F
812      4b4:       94 83           std     Z+4, r25        ; 0x04
813      4b6:       83 83           std     Z+3, r24        ; 0x03
814      4b8:       16 d4           rcall   .+2092          ; 0xce6 <LCD_printf>
815      4ba:       0f 90           pop     r0
816      4bc:       0f 90           pop     r0
817      4be:       0f 90           pop     r0
818      4c0:       0f 90           pop     r0
819         return 0;
820 }
821      4c2:       80 e0           ldi     r24, 0x00       ; 0
822      4c4:       08 95           ret
823
824 000004c6 <set_timeout>:
825         LCD_printf("Avgs %i", setup.adc_averages);
826         return 0;
827 }
828
829 uint8 set_timeout(char * arg)
830 {
831      4c6:       fc 01           movw    r30, r24
832         if (arg[0] != '\0')
833      4c8:       80 81           ld      r24, Z
834      4ca:       88 23           and     r24, r24
835      4cc:       79 f0           breq    .+30            ; 0x4ec <set_timeout+0x26>
836         {
837                 setup.poll_timeout = atoi(arg);
838      4ce:       cf 01           movw    r24, r30
839      4d0:       0e 94 af 0c     call    0x195e  ; 0x195e <atoi>
840      4d4:       aa 27           eor     r26, r26
841      4d6:       97 fd           sbrc    r25, 7
842      4d8:       a0 95           com     r26
843      4da:       ba 2f           mov     r27, r26
844      4dc:       80 93 92 01     sts     0x0192, r24
845      4e0:       90 93 93 01     sts     0x0193, r25
846      4e4:       a0 93 94 01     sts     0x0194, r26
847      4e8:       b0 93 95 01     sts     0x0195, r27
848         }
849         USART_printf("# timeout %i\r\n", setup.poll_timeout);
850      4ec:       00 d0           rcall   .+0             ; 0x4ee <set_timeout+0x28>
851      4ee:       00 d0           rcall   .+0             ; 0x4f0 <set_timeout+0x2a>
852      4f0:       00 d0           rcall   .+0             ; 0x4f2 <set_timeout+0x2c>
853      4f2:       88 e2           ldi     r24, 0x28       ; 40
854      4f4:       91 e0           ldi     r25, 0x01       ; 1
855      4f6:       ed b7           in      r30, 0x3d       ; 61
856      4f8:       fe b7           in      r31, 0x3e       ; 62
857      4fa:       92 83           std     Z+2, r25        ; 0x02
858      4fc:       81 83           std     Z+1, r24        ; 0x01
859      4fe:       80 91 92 01     lds     r24, 0x0192
860      502:       90 91 93 01     lds     r25, 0x0193
861      506:       a0 91 94 01     lds     r26, 0x0194
862      50a:       b0 91 95 01     lds     r27, 0x0195
863      50e:       83 83           std     Z+3, r24        ; 0x03
864      510:       94 83           std     Z+4, r25        ; 0x04
865      512:       a5 83           std     Z+5, r26        ; 0x05
866      514:       b6 83           std     Z+6, r27        ; 0x06
867      516:       1b d7           rcall   .+3638          ; 0x134e <USART_printf>
868         LCD_printf("timeout %i", setup.poll_timeout);
869      518:       87 e3           ldi     r24, 0x37       ; 55
870      51a:       91 e0           ldi     r25, 0x01       ; 1
871      51c:       ed b7           in      r30, 0x3d       ; 61
872      51e:       fe b7           in      r31, 0x3e       ; 62
873      520:       92 83           std     Z+2, r25        ; 0x02
874      522:       81 83           std     Z+1, r24        ; 0x01
875      524:       80 91 92 01     lds     r24, 0x0192
876      528:       90 91 93 01     lds     r25, 0x0193
877      52c:       a0 91 94 01     lds     r26, 0x0194
878      530:       b0 91 95 01     lds     r27, 0x0195
879      534:       83 83           std     Z+3, r24        ; 0x03
880      536:       94 83           std     Z+4, r25        ; 0x04
881      538:       a5 83           std     Z+5, r26        ; 0x05
882      53a:       b6 83           std     Z+6, r27        ; 0x06
883      53c:       d4 d3           rcall   .+1960          ; 0xce6 <LCD_printf>
884      53e:       8d b7           in      r24, 0x3d       ; 61
885      540:       9e b7           in      r25, 0x3e       ; 62
886      542:       06 96           adiw    r24, 0x06       ; 6
887      544:       0f b6           in      r0, 0x3f        ; 63
888      546:       f8 94           cli
889      548:       9e bf           out     0x3e, r25       ; 62
890      54a:       0f be           out     0x3f, r0        ; 63
891      54c:       8d bf           out     0x3d, r24       ; 61
892         return 0;
893 }
894      54e:       80 e0           ldi     r24, 0x00       ; 0
895      550:       08 95           ret
896
897 00000552 <set_averages>:
898         LCD_printf("D %i", setup.dac_value);
899         return 0;
900 }
901
902 uint8 set_averages(char * arg)
903 {
904      552:       fc 01           movw    r30, r24
905         if (arg[0] != '\0')
906      554:       80 81           ld      r24, Z
907      556:       88 23           and     r24, r24
908      558:       39 f0           breq    .+14            ; 0x568 <set_averages+0x16>
909         {
910                 setup.adc_averages = atoi(arg);
911      55a:       cf 01           movw    r24, r30
912      55c:       0e 94 af 0c     call    0x195e  ; 0x195e <atoi>
913      560:       90 93 91 01     sts     0x0191, r25
914      564:       80 93 90 01     sts     0x0190, r24
915         }
916         USART_printf("# Avgs %i\r\n", setup.adc_averages);
917      568:       00 d0           rcall   .+0             ; 0x56a <set_averages+0x18>
918      56a:       00 d0           rcall   .+0             ; 0x56c <set_averages+0x1a>
919      56c:       82 e4           ldi     r24, 0x42       ; 66
920      56e:       91 e0           ldi     r25, 0x01       ; 1
921      570:       ed b7           in      r30, 0x3d       ; 61
922      572:       fe b7           in      r31, 0x3e       ; 62
923      574:       92 83           std     Z+2, r25        ; 0x02
924      576:       81 83           std     Z+1, r24        ; 0x01
925      578:       80 91 90 01     lds     r24, 0x0190
926      57c:       90 91 91 01     lds     r25, 0x0191
927      580:       94 83           std     Z+4, r25        ; 0x04
928      582:       83 83           std     Z+3, r24        ; 0x03
929      584:       e4 d6           rcall   .+3528          ; 0x134e <USART_printf>
930         LCD_printf("Avgs %i", setup.adc_averages);
931      586:       8e e4           ldi     r24, 0x4E       ; 78
932      588:       91 e0           ldi     r25, 0x01       ; 1
933      58a:       ed b7           in      r30, 0x3d       ; 61
934      58c:       fe b7           in      r31, 0x3e       ; 62
935      58e:       92 83           std     Z+2, r25        ; 0x02
936      590:       81 83           std     Z+1, r24        ; 0x01
937      592:       80 91 90 01     lds     r24, 0x0190
938      596:       90 91 91 01     lds     r25, 0x0191
939      59a:       94 83           std     Z+4, r25        ; 0x04
940      59c:       83 83           std     Z+3, r24        ; 0x03
941      59e:       a3 d3           rcall   .+1862          ; 0xce6 <LCD_printf>
942      5a0:       0f 90           pop     r0
943      5a2:       0f 90           pop     r0
944      5a4:       0f 90           pop     r0
945      5a6:       0f 90           pop     r0
946         return 0;
947 }
948      5a8:       80 e0           ldi     r24, 0x00       ; 0
949      5aa:       08 95           ret
950
951 000005ac <set_dac>:
952         LCD_Colon(0);
953         return 0;
954 }
955
956 uint8 set_dac(char * arg)
957 {
958      5ac:       fc 01           movw    r30, r24
959         if (arg[0] != '\0')
960      5ae:       80 81           ld      r24, Z
961      5b0:       88 23           and     r24, r24
962      5b2:       41 f0           breq    .+16            ; 0x5c4 <set_dac+0x18>
963         {
964                 setup.dac_value = atoi(arg);
965      5b4:       cf 01           movw    r24, r30
966      5b6:       0e 94 af 0c     call    0x195e  ; 0x195e <atoi>
967      5ba:       90 93 9b 01     sts     0x019B, r25
968      5be:       80 93 9a 01     sts     0x019A, r24
969                 DAC_Set(setup.dac_value);
970      5c2:       44 d1           rcall   .+648           ; 0x84c <DAC_Set>
971         }
972         USART_printf("# DAC %i\r\n", setup.dac_value);
973      5c4:       00 d0           rcall   .+0             ; 0x5c6 <set_dac+0x1a>
974      5c6:       00 d0           rcall   .+0             ; 0x5c8 <set_dac+0x1c>
975      5c8:       86 e5           ldi     r24, 0x56       ; 86
976      5ca:       91 e0           ldi     r25, 0x01       ; 1
977      5cc:       ed b7           in      r30, 0x3d       ; 61
978      5ce:       fe b7           in      r31, 0x3e       ; 62
979      5d0:       92 83           std     Z+2, r25        ; 0x02
980      5d2:       81 83           std     Z+1, r24        ; 0x01
981      5d4:       80 91 9a 01     lds     r24, 0x019A
982      5d8:       90 91 9b 01     lds     r25, 0x019B
983      5dc:       94 83           std     Z+4, r25        ; 0x04
984      5de:       83 83           std     Z+3, r24        ; 0x03
985      5e0:       b6 d6           rcall   .+3436          ; 0x134e <USART_printf>
986         LCD_printf("D %i", setup.dac_value);
987      5e2:       81 e6           ldi     r24, 0x61       ; 97
988      5e4:       91 e0           ldi     r25, 0x01       ; 1
989      5e6:       ed b7           in      r30, 0x3d       ; 61
990      5e8:       fe b7           in      r31, 0x3e       ; 62
991      5ea:       92 83           std     Z+2, r25        ; 0x02
992      5ec:       81 83           std     Z+1, r24        ; 0x01
993      5ee:       80 91 9a 01     lds     r24, 0x019A
994      5f2:       90 91 9b 01     lds     r25, 0x019B
995      5f6:       94 83           std     Z+4, r25        ; 0x04
996      5f8:       83 83           std     Z+3, r24        ; 0x03
997      5fa:       75 d3           rcall   .+1770          ; 0xce6 <LCD_printf>
998      5fc:       0f 90           pop     r0
999      5fe:       0f 90           pop     r0
1000      600:       0f 90           pop     r0
1001      602:       0f 90           pop     r0
1002         return 0;
1003 }
1004      604:       80 e0           ldi     r24, 0x00       ; 0
1005      606:       08 95           ret
1006
1007 00000608 <read_adc>:
1008 #include <string.h>
1009 #include <stdlib.h>
1010
1011
1012 uint8 read_adc(char * arg)
1013 {
1014      608:       af 92           push    r10
1015      60a:       bf 92           push    r11
1016      60c:       cf 92           push    r12
1017      60e:       df 92           push    r13
1018      610:       ef 92           push    r14
1019      612:       ff 92           push    r15
1020      614:       0f 93           push    r16
1021      616:       1f 93           push    r17
1022      618:       cf 93           push    r28
1023      61a:       df 93           push    r29
1024      61c:       6c 01           movw    r12, r24
1025         if (arg[0] == '\0')
1026      61e:       dc 01           movw    r26, r24
1027      620:       8c 91           ld      r24, X
1028      622:       88 23           and     r24, r24
1029      624:       31 f0           breq    .+12            ; 0x632 <read_adc+0x2a>
1030      626:       e6 01           movw    r28, r12
1031         {
1032                 for (char * a = arg; *a != '\0'; ++a)
1033                 {
1034                         //uint8 channel = *a - '0';
1035                         //if (channel >= 0 && channel <= 7)     
1036                         USART_printf("%f %f ", ADC_read(*a - '0'), sqrt(setup.adc_variance[(*a - '0')]));
1037      628:       2a e6           ldi     r18, 0x6A       ; 106
1038      62a:       a2 2e           mov     r10, r18
1039      62c:       21 e0           ldi     r18, 0x01       ; 1
1040      62e:       b2 2e           mov     r11, r18
1041      630:       56 c0           rjmp    .+172           ; 0x6de <read_adc+0xd6>
1042 #include <stdlib.h>
1043
1044
1045 uint8 read_adc(char * arg)
1046 {
1047         if (arg[0] == '\0')
1048      632:       00 e0           ldi     r16, 0x00       ; 0
1049         {
1050                 for (uint8 i=0; i < 8; ++i)
1051                 {
1052                         USART_printf("%i ", ADC_read(i));
1053      634:       c6 e6           ldi     r28, 0x66       ; 102
1054      636:       d1 e0           ldi     r29, 0x01       ; 1
1055      638:       80 2f           mov     r24, r16
1056      63a:       12 de           rcall   .-988           ; 0x260 <ADC_read>
1057      63c:       00 d0           rcall   .+0             ; 0x63e <read_adc+0x36>
1058      63e:       00 d0           rcall   .+0             ; 0x640 <read_adc+0x38>
1059      640:       00 d0           rcall   .+0             ; 0x642 <read_adc+0x3a>
1060      642:       ed b7           in      r30, 0x3d       ; 61
1061      644:       fe b7           in      r31, 0x3e       ; 62
1062      646:       d2 83           std     Z+2, r29        ; 0x02
1063      648:       c1 83           std     Z+1, r28        ; 0x01
1064      64a:       ad b7           in      r26, 0x3d       ; 61
1065      64c:       be b7           in      r27, 0x3e       ; 62
1066      64e:       13 96           adiw    r26, 0x03       ; 3
1067      650:       6d 93           st      X+, r22
1068      652:       7d 93           st      X+, r23
1069      654:       8d 93           st      X+, r24
1070      656:       9c 93           st      X, r25
1071      658:       16 97           sbiw    r26, 0x06       ; 6
1072      65a:       79 d6           rcall   .+3314          ; 0x134e <USART_printf>
1073
1074 uint8 read_adc(char * arg)
1075 {
1076         if (arg[0] == '\0')
1077         {
1078                 for (uint8 i=0; i < 8; ++i)
1079      65c:       0f 5f           subi    r16, 0xFF       ; 255
1080      65e:       ed b7           in      r30, 0x3d       ; 61
1081      660:       fe b7           in      r31, 0x3e       ; 62
1082      662:       36 96           adiw    r30, 0x06       ; 6
1083      664:       0f b6           in      r0, 0x3f        ; 63
1084      666:       f8 94           cli
1085      668:       fe bf           out     0x3e, r31       ; 62
1086      66a:       0f be           out     0x3f, r0        ; 63
1087      66c:       ed bf           out     0x3d, r30       ; 61
1088      66e:       08 30           cpi     r16, 0x08       ; 8
1089      670:       19 f7           brne    .-58            ; 0x638 <read_adc+0x30>
1090      672:       5c c0           rjmp    .+184           ; 0x72c <read_adc+0x124>
1091         {
1092                 for (char * a = arg; *a != '\0'; ++a)
1093                 {
1094                         //uint8 channel = *a - '0';
1095                         //if (channel >= 0 && channel <= 7)     
1096                         USART_printf("%f %f ", ADC_read(*a - '0'), sqrt(setup.adc_variance[(*a - '0')]));
1097      674:       80 53           subi    r24, 0x30       ; 48
1098      676:       f4 dd           rcall   .-1048          ; 0x260 <ADC_read>
1099      678:       7b 01           movw    r14, r22
1100      67a:       8c 01           movw    r16, r24
1101      67c:       e9 91           ld      r30, Y+
1102      67e:       f0 e0           ldi     r31, 0x00       ; 0
1103      680:       ee 0f           add     r30, r30
1104      682:       ff 1f           adc     r31, r31
1105      684:       ee 0f           add     r30, r30
1106      686:       ff 1f           adc     r31, r31
1107      688:       e2 53           subi    r30, 0x32       ; 50
1108      68a:       ff 4f           sbci    r31, 0xFF       ; 255
1109      68c:       66 a5           ldd     r22, Z+46       ; 0x2e
1110      68e:       77 a5           ldd     r23, Z+47       ; 0x2f
1111      690:       80 a9           ldd     r24, Z+48       ; 0x30
1112      692:       91 a9           ldd     r25, Z+49       ; 0x31
1113      694:       0e 94 f4 0b     call    0x17e8  ; 0x17e8 <sqrt>
1114      698:       2d b7           in      r18, 0x3d       ; 61
1115      69a:       3e b7           in      r19, 0x3e       ; 62
1116      69c:       2a 50           subi    r18, 0x0A       ; 10
1117      69e:       30 40           sbci    r19, 0x00       ; 0
1118      6a0:       0f b6           in      r0, 0x3f        ; 63
1119      6a2:       f8 94           cli
1120      6a4:       3e bf           out     0x3e, r19       ; 62
1121      6a6:       0f be           out     0x3f, r0        ; 63
1122      6a8:       2d bf           out     0x3d, r18       ; 61
1123      6aa:       ed b7           in      r30, 0x3d       ; 61
1124      6ac:       fe b7           in      r31, 0x3e       ; 62
1125      6ae:       31 96           adiw    r30, 0x01       ; 1
1126      6b0:       ad b7           in      r26, 0x3d       ; 61
1127      6b2:       be b7           in      r27, 0x3e       ; 62
1128      6b4:       12 96           adiw    r26, 0x02       ; 2
1129      6b6:       bc 92           st      X, r11
1130      6b8:       ae 92           st      -X, r10
1131      6ba:       11 97           sbiw    r26, 0x01       ; 1
1132      6bc:       e2 82           std     Z+2, r14        ; 0x02
1133      6be:       f3 82           std     Z+3, r15        ; 0x03
1134      6c0:       04 83           std     Z+4, r16        ; 0x04
1135      6c2:       15 83           std     Z+5, r17        ; 0x05
1136      6c4:       66 83           std     Z+6, r22        ; 0x06
1137      6c6:       77 83           std     Z+7, r23        ; 0x07
1138      6c8:       80 87           std     Z+8, r24        ; 0x08
1139      6ca:       91 87           std     Z+9, r25        ; 0x09
1140      6cc:       40 d6           rcall   .+3200          ; 0x134e <USART_printf>
1141                         USART_printf("%i ", ADC_read(i));
1142                 }
1143         }
1144         else
1145         {
1146                 for (char * a = arg; *a != '\0'; ++a)
1147      6ce:       ed b7           in      r30, 0x3d       ; 61
1148      6d0:       fe b7           in      r31, 0x3e       ; 62
1149      6d2:       3a 96           adiw    r30, 0x0a       ; 10
1150      6d4:       0f b6           in      r0, 0x3f        ; 63
1151      6d6:       f8 94           cli
1152      6d8:       fe bf           out     0x3e, r31       ; 62
1153      6da:       0f be           out     0x3f, r0        ; 63
1154      6dc:       ed bf           out     0x3d, r30       ; 61
1155      6de:       88 81           ld      r24, Y
1156      6e0:       88 23           and     r24, r24
1157      6e2:       41 f6           brne    .-112           ; 0x674 <read_adc+0x6c>
1158                 {
1159                         //uint8 channel = *a - '0';
1160                         //if (channel >= 0 && channel <= 7)     
1161                         USART_printf("%f %f ", ADC_read(*a - '0'), sqrt(setup.adc_variance[(*a - '0')]));
1162                 }
1163                 LCD_printf("%i", (uint)(setup.adc_values[(int)(arg[0] - '0')]));
1164      6e4:       00 d0           rcall   .+0             ; 0x6e6 <read_adc+0xde>
1165      6e6:       00 d0           rcall   .+0             ; 0x6e8 <read_adc+0xe0>
1166      6e8:       0d b7           in      r16, 0x3d       ; 61
1167      6ea:       1e b7           in      r17, 0x3e       ; 62
1168      6ec:       0f 5f           subi    r16, 0xFF       ; 255
1169      6ee:       1f 4f           sbci    r17, 0xFF       ; 255
1170      6f0:       81 e7           ldi     r24, 0x71       ; 113
1171      6f2:       91 e0           ldi     r25, 0x01       ; 1
1172      6f4:       ad b7           in      r26, 0x3d       ; 61
1173      6f6:       be b7           in      r27, 0x3e       ; 62
1174      6f8:       12 96           adiw    r26, 0x02       ; 2
1175      6fa:       9c 93           st      X, r25
1176      6fc:       8e 93           st      -X, r24
1177      6fe:       11 97           sbiw    r26, 0x01       ; 1
1178      700:       d6 01           movw    r26, r12
1179      702:       ec 91           ld      r30, X
1180      704:       f0 e0           ldi     r31, 0x00       ; 0
1181      706:       ee 0f           add     r30, r30
1182      708:       ff 1f           adc     r31, r31
1183      70a:       ee 0f           add     r30, r30
1184      70c:       ff 1f           adc     r31, r31
1185      70e:       e2 53           subi    r30, 0x32       ; 50
1186      710:       ff 4f           sbci    r31, 0xFF       ; 255
1187      712:       66 85           ldd     r22, Z+14       ; 0x0e
1188      714:       77 85           ldd     r23, Z+15       ; 0x0f
1189      716:       80 89           ldd     r24, Z+16       ; 0x10
1190      718:       91 89           ldd     r25, Z+17       ; 0x11
1191      71a:       21 d7           rcall   .+3650          ; 0x155e <__fixunssfsi>
1192      71c:       f8 01           movw    r30, r16
1193      71e:       73 83           std     Z+3, r23        ; 0x03
1194      720:       62 83           std     Z+2, r22        ; 0x02
1195      722:       e1 d2           rcall   .+1474          ; 0xce6 <LCD_printf>
1196      724:       0f 90           pop     r0
1197      726:       0f 90           pop     r0
1198      728:       0f 90           pop     r0
1199      72a:       0f 90           pop     r0
1200         }
1201         USART_printf("\r\n");
1202      72c:       00 d0           rcall   .+0             ; 0x72e <read_adc+0x126>
1203      72e:       84 e7           ldi     r24, 0x74       ; 116
1204      730:       91 e0           ldi     r25, 0x01       ; 1
1205      732:       ad b7           in      r26, 0x3d       ; 61
1206      734:       be b7           in      r27, 0x3e       ; 62
1207      736:       12 96           adiw    r26, 0x02       ; 2
1208      738:       9c 93           st      X, r25
1209      73a:       8e 93           st      -X, r24
1210      73c:       11 97           sbiw    r26, 0x01       ; 1
1211      73e:       07 d6           rcall   .+3086          ; 0x134e <USART_printf>
1212      740:       0f 90           pop     r0
1213      742:       0f 90           pop     r0
1214
1215         return 0;
1216 }
1217      744:       80 e0           ldi     r24, 0x00       ; 0
1218      746:       df 91           pop     r29
1219      748:       cf 91           pop     r28
1220      74a:       1f 91           pop     r17
1221      74c:       0f 91           pop     r16
1222      74e:       ff 90           pop     r15
1223      750:       ef 90           pop     r14
1224      752:       df 90           pop     r13
1225      754:       cf 90           pop     r12
1226      756:       bf 90           pop     r11
1227      758:       af 90           pop     r10
1228      75a:       08 95           ret
1229
1230 0000075c <poll_adc>:
1231
1232 uint8 poll_adc(char * arg)
1233 {
1234      75c:       cf 92           push    r12
1235      75e:       df 92           push    r13
1236      760:       ef 92           push    r14
1237      762:       ff 92           push    r15
1238      764:       0f 93           push    r16
1239      766:       1f 93           push    r17
1240      768:       cf 93           push    r28
1241      76a:       df 93           push    r29
1242      76c:       ec 01           movw    r28, r24
1243         uint32 tmr = 0;
1244         //USART_printf("# poll\r\n");
1245         LCD_puts("poll");
1246      76e:       87 e7           ldi     r24, 0x77       ; 119
1247      770:       91 e0           ldi     r25, 0x01       ; 1
1248      772:       d9 d1           rcall   .+946           ; 0xb26 <LCD_puts>
1249      774:       ee 24           eor     r14, r14
1250      776:       ff 24           eor     r15, r15
1251      778:       87 01           movw    r16, r14
1252         //USART_printf("#t      ADC0    ADC1    ADC2    ADC3    ADC4    ADC5    ADC6    ADC7\r\n);      
1253         do
1254         {
1255                 setup.elapsed_time = 0;
1256                 USART_printf("%l ", tmr);
1257      77a:       3c e7           ldi     r19, 0x7C       ; 124
1258      77c:       c3 2e           mov     r12, r19
1259      77e:       31 e0           ldi     r19, 0x01       ; 1
1260      780:       d3 2e           mov     r13, r19
1261         //USART_printf("# poll\r\n");
1262         LCD_puts("poll");
1263         //USART_printf("#t      ADC0    ADC1    ADC2    ADC3    ADC4    ADC5    ADC6    ADC7\r\n);      
1264         do
1265         {
1266                 setup.elapsed_time = 0;
1267      782:       10 92 96 01     sts     0x0196, r1
1268      786:       10 92 97 01     sts     0x0197, r1
1269      78a:       10 92 98 01     sts     0x0198, r1
1270      78e:       10 92 99 01     sts     0x0199, r1
1271                 USART_printf("%l ", tmr);
1272      792:       00 d0           rcall   .+0             ; 0x794 <poll_adc+0x38>
1273      794:       00 d0           rcall   .+0             ; 0x796 <poll_adc+0x3a>
1274      796:       00 d0           rcall   .+0             ; 0x798 <poll_adc+0x3c>
1275      798:       ed b7           in      r30, 0x3d       ; 61
1276      79a:       fe b7           in      r31, 0x3e       ; 62
1277      79c:       d2 82           std     Z+2, r13        ; 0x02
1278      79e:       c1 82           std     Z+1, r12        ; 0x01
1279      7a0:       e3 82           std     Z+3, r14        ; 0x03
1280      7a2:       f4 82           std     Z+4, r15        ; 0x04
1281      7a4:       05 83           std     Z+5, r16        ; 0x05
1282      7a6:       16 83           std     Z+6, r17        ; 0x06
1283      7a8:       d2 d5           rcall   .+2980          ; 0x134e <USART_printf>
1284                 read_adc(arg);
1285      7aa:       8d b7           in      r24, 0x3d       ; 61
1286      7ac:       9e b7           in      r25, 0x3e       ; 62
1287      7ae:       06 96           adiw    r24, 0x06       ; 6
1288      7b0:       0f b6           in      r0, 0x3f        ; 63
1289      7b2:       f8 94           cli
1290      7b4:       9e bf           out     0x3e, r25       ; 62
1291      7b6:       0f be           out     0x3f, r0        ; 63
1292      7b8:       8d bf           out     0x3d, r24       ; 61
1293      7ba:       ce 01           movw    r24, r28
1294      7bc:       25 df           rcall   .-438           ; 0x608 <read_adc>
1295                 if (arg[0] == '\0' || arg[1] == 't')
1296      7be:       88 81           ld      r24, Y
1297      7c0:       88 23           and     r24, r24
1298      7c2:       19 f0           breq    .+6             ; 0x7ca <poll_adc+0x6e>
1299      7c4:       89 81           ldd     r24, Y+1        ; 0x01
1300      7c6:       84 37           cpi     r24, 0x74       ; 116
1301      7c8:       49 f4           brne    .+18            ; 0x7dc <poll_adc+0x80>
1302                 {
1303                         LCD_Colon(1);
1304      7ca:       81 e0           ldi     r24, 0x01       ; 1
1305      7cc:       dc d1           rcall   .+952           ; 0xb86 <LCD_Colon>
1306                         LCD_ShowTime(tmr);
1307      7ce:       c8 01           movw    r24, r16
1308      7d0:       b7 01           movw    r22, r14
1309      7d2:       f0 d1           rcall   .+992           ; 0xbb4 <LCD_ShowTime>
1310      7d4:       03 c0           rjmp    .+6             ; 0x7dc <poll_adc+0x80>
1311                 //      return 255;
1312                 //}
1313
1314                 while (setup.elapsed_time < setup.poll_delay)
1315                 {
1316                         if (USART_Poll() != '\0')
1317      7d6:       b2 d5           rcall   .+2916          ; 0x133c <USART_Poll>
1318      7d8:       88 23           and     r24, r24
1319      7da:       29 f5           brne    .+74            ; 0x826 <poll_adc+0xca>
1320                 //{
1321                 //      USART_printf("# tmr>delay\r\n");
1322                 //      return 255;
1323                 //}
1324
1325                 while (setup.elapsed_time < setup.poll_delay)
1326      7dc:       20 91 96 01     lds     r18, 0x0196
1327      7e0:       30 91 97 01     lds     r19, 0x0197
1328      7e4:       40 91 98 01     lds     r20, 0x0198
1329      7e8:       50 91 99 01     lds     r21, 0x0199
1330      7ec:       80 91 8e 01     lds     r24, 0x018E
1331      7f0:       90 91 8f 01     lds     r25, 0x018F
1332      7f4:       a0 e0           ldi     r26, 0x00       ; 0
1333      7f6:       b0 e0           ldi     r27, 0x00       ; 0
1334      7f8:       28 17           cp      r18, r24
1335      7fa:       39 07           cpc     r19, r25
1336      7fc:       4a 07           cpc     r20, r26
1337      7fe:       5b 07           cpc     r21, r27
1338      800:       50 f3           brcs    .-44            ; 0x7d6 <poll_adc+0x7a>
1339                                 //USART_printf("# STOP %i\r\n", tmr+setup.elapsed_time);
1340                                 LCD_Colon(0);
1341                                 return 0;
1342                         }
1343                 }
1344                 tmr += setup.elapsed_time;
1345      802:       e2 0e           add     r14, r18
1346      804:       f3 1e           adc     r15, r19
1347      806:       04 1f           adc     r16, r20
1348      808:       15 1f           adc     r17, r21
1349         }
1350         while (tmr < setup.poll_timeout);
1351      80a:       80 91 92 01     lds     r24, 0x0192
1352      80e:       90 91 93 01     lds     r25, 0x0193
1353      812:       a0 91 94 01     lds     r26, 0x0194
1354      816:       b0 91 95 01     lds     r27, 0x0195
1355      81a:       e8 16           cp      r14, r24
1356      81c:       f9 06           cpc     r15, r25
1357      81e:       0a 07           cpc     r16, r26
1358      820:       1b 07           cpc     r17, r27
1359      822:       08 f4           brcc    .+2             ; 0x826 <poll_adc+0xca>
1360      824:       ae cf           rjmp    .-164           ; 0x782 <poll_adc+0x26>
1361         //USART_printf("# done.\r\n");
1362         LCD_Colon(0);
1363      826:       80 e0           ldi     r24, 0x00       ; 0
1364      828:       ae d1           rcall   .+860           ; 0xb86 <LCD_Colon>
1365         return 0;
1366 }
1367      82a:       80 e0           ldi     r24, 0x00       ; 0
1368      82c:       df 91           pop     r29
1369      82e:       cf 91           pop     r28
1370      830:       1f 91           pop     r17
1371      832:       0f 91           pop     r16
1372      834:       ff 90           pop     r15
1373      836:       ef 90           pop     r14
1374      838:       df 90           pop     r13
1375      83a:       cf 90           pop     r12
1376      83c:       08 95           ret
1377
1378 0000083e <DAC_Init>:
1379 void DAC_Init(void)
1380 {
1381         //prevDDR = DAC_DDR;
1382         //prevPORT = DAC_PORT;
1383
1384         DAC_DDR = 0xFF & ~(1<<PORTB6);
1385      83e:       8f eb           ldi     r24, 0xBF       ; 191
1386      840:       84 b9           out     0x04, r24       ; 4
1387         DAC_PORT = 0xFF | (1<<PORTB6);
1388      842:       8f ef           ldi     r24, 0xFF       ; 255
1389      844:       85 b9           out     0x05, r24       ; 5
1390
1391         DAC_PORT = (1<<CS) | (1<<LDAC) | (1<<SHDN) | (1<<PORTB6);
1392      846:       86 e5           ldi     r24, 0x56       ; 86
1393      848:       85 b9           out     0x05, r24       ; 5
1394         //runningDAC = TRUE;
1395 }
1396      84a:       08 95           ret
1397
1398 0000084c <DAC_Set>:
1399
1400 void DAC_Set(int output)
1401 {
1402      84c:       cf 93           push    r28
1403      84e:       df 93           push    r29
1404      850:       ec 01           movw    r28, r24
1405         DAC_Init();
1406      852:       f5 df           rcall   .-22            ; 0x83e <DAC_Init>
1407         
1408         while (SCK_ON);
1409      854:       2b 99           sbic    0x05, 3 ; 5
1410      856:       fe cf           rjmp    .-4             ; 0x854 <DAC_Set+0x8>
1411                 
1412         DAC_PORT |= (1<<CS) | (1<<LDAC);
1413      858:       85 b1           in      r24, 0x05       ; 5
1414      85a:       86 60           ori     r24, 0x06       ; 6
1415      85c:       85 b9           out     0x05, r24       ; 5
1416
1417         while (SCK_OFF);
1418      85e:       2b 9b           sbis    0x05, 3 ; 5
1419      860:       fe cf           rjmp    .-4             ; 0x85e <DAC_Set+0x12>
1420         while (SCK_ON);
1421      862:       2b 99           sbic    0x05, 3 ; 5
1422      864:       fe cf           rjmp    .-4             ; 0x862 <DAC_Set+0x16>
1423         
1424         //Wait for clock off
1425
1426         //Set CS low
1427         DAC_PORT &= ~(1<<CS);
1428      866:       29 98           cbi     0x05, 1 ; 5
1429
1430         //Configuration bits:
1431
1432         //A/B
1433         DAC_PORT &= ~(1<<SDI); //Select DAC A
1434      868:       28 98           cbi     0x05, 0 ; 5
1435
1436         while (SCK_OFF);
1437      86a:       2b 9b           sbis    0x05, 3 ; 5
1438      86c:       fe cf           rjmp    .-4             ; 0x86a <DAC_Set+0x1e>
1439         while (SCK_ON);
1440      86e:       2b 99           sbic    0x05, 3 ; 5
1441      870:       fe cf           rjmp    .-4             ; 0x86e <DAC_Set+0x22>
1442
1443         //BUF
1444         DAC_PORT |= (1<<SDI); //Select buffered reference voltage
1445      872:       28 9a           sbi     0x05, 0 ; 5
1446
1447         while (SCK_OFF);
1448      874:       2b 9b           sbis    0x05, 3 ; 5
1449      876:       fe cf           rjmp    .-4             ; 0x874 <DAC_Set+0x28>
1450         while (SCK_ON);
1451      878:       2b 99           sbic    0x05, 3 ; 5
1452      87a:       fe cf           rjmp    .-4             ; 0x878 <DAC_Set+0x2c>
1453
1454         //GA
1455         if (output > 0xFFF)
1456      87c:       80 e1           ldi     r24, 0x10       ; 16
1457      87e:       c0 30           cpi     r28, 0x00       ; 0
1458      880:       d8 07           cpc     r29, r24
1459      882:       24 f0           brlt    .+8             ; 0x88c <DAC_Set+0x40>
1460         {
1461                 DAC_PORT &= ~(1<<SDI); //Select 2x gain
1462      884:       28 98           cbi     0x05, 0 ; 5
1463                 output = output / 2;
1464      886:       d5 95           asr     r29
1465      888:       c7 95           ror     r28
1466      88a:       01 c0           rjmp    .+2             ; 0x88e <DAC_Set+0x42>
1467         }
1468         else
1469                 DAC_PORT |= (1<<SDI); //Select 1x gain
1470      88c:       28 9a           sbi     0x05, 0 ; 5
1471
1472         while (SCK_OFF);
1473      88e:       2b 9b           sbis    0x05, 3 ; 5
1474      890:       fe cf           rjmp    .-4             ; 0x88e <DAC_Set+0x42>
1475         while (SCK_ON);
1476      892:       2b 99           sbic    0x05, 3 ; 5
1477      894:       fe cf           rjmp    .-4             ; 0x892 <DAC_Set+0x46>
1478
1479         //SHDN
1480         DAC_PORT |= (1<<SDI); //DAC is turned on!
1481      896:       28 9a           sbi     0x05, 0 ; 5
1482
1483         while (SCK_OFF);
1484      898:       2b 9b           sbis    0x05, 3 ; 5
1485      89a:       fe cf           rjmp    .-4             ; 0x898 <DAC_Set+0x4c>
1486         while (SCK_ON);
1487      89c:       2b 99           sbic    0x05, 3 ; 5
1488      89e:       fe cf           rjmp    .-4             ; 0x89c <DAC_Set+0x50>
1489      8a0:       2b e0           ldi     r18, 0x0B       ; 11
1490      8a2:       30 e0           ldi     r19, 0x00       ; 0
1491
1492         //Now send the 12 data bits
1493         for (int i=1; i <= 12; ++i)
1494         {
1495                 if ((output & (1<<(12-i))) == 0x00)
1496      8a4:       ce 01           movw    r24, r28
1497      8a6:       02 2e           mov     r0, r18
1498      8a8:       02 c0           rjmp    .+4             ; 0x8ae <DAC_Set+0x62>
1499      8aa:       95 95           asr     r25
1500      8ac:       87 95           ror     r24
1501      8ae:       0a 94           dec     r0
1502      8b0:       e2 f7           brpl    .-8             ; 0x8aa <DAC_Set+0x5e>
1503      8b2:       80 fd           sbrc    r24, 0
1504      8b4:       02 c0           rjmp    .+4             ; 0x8ba <DAC_Set+0x6e>
1505                         DAC_PORT &= ~(1<<SDI);
1506      8b6:       28 98           cbi     0x05, 0 ; 5
1507      8b8:       01 c0           rjmp    .+2             ; 0x8bc <DAC_Set+0x70>
1508                 else
1509                         DAC_PORT |= (1<<SDI);
1510      8ba:       28 9a           sbi     0x05, 0 ; 5
1511
1512         
1513                 while (SCK_OFF);
1514      8bc:       2b 9b           sbis    0x05, 3 ; 5
1515      8be:       fe cf           rjmp    .-4             ; 0x8bc <DAC_Set+0x70>
1516                 while (SCK_ON);
1517      8c0:       2b 99           sbic    0x05, 3 ; 5
1518      8c2:       fe cf           rjmp    .-4             ; 0x8c0 <DAC_Set+0x74>
1519      8c4:       21 50           subi    r18, 0x01       ; 1
1520      8c6:       30 40           sbci    r19, 0x00       ; 0
1521
1522         while (SCK_OFF);
1523         while (SCK_ON);
1524
1525         //Now send the 12 data bits
1526         for (int i=1; i <= 12; ++i)
1527      8c8:       8f ef           ldi     r24, 0xFF       ; 255
1528      8ca:       2f 3f           cpi     r18, 0xFF       ; 255
1529      8cc:       38 07           cpc     r19, r24
1530      8ce:       51 f7           brne    .-44            ; 0x8a4 <DAC_Set+0x58>
1531                 while (SCK_OFF);
1532                 while (SCK_ON);
1533         }
1534
1535         // Set CS to 1
1536         DAC_PORT |= (1<<CS);
1537      8d0:       29 9a           sbi     0x05, 1 ; 5
1538
1539         while (SCK_OFF);
1540      8d2:       2b 9b           sbis    0x05, 3 ; 5
1541      8d4:       fe cf           rjmp    .-4             ; 0x8d2 <DAC_Set+0x86>
1542         while (SCK_ON);
1543      8d6:       2b 99           sbic    0x05, 3 ; 5
1544      8d8:       fe cf           rjmp    .-4             ; 0x8d6 <DAC_Set+0x8a>
1545
1546         //Toggle LDAC
1547         DAC_PORT &= ~(1<<LDAC);
1548      8da:       2a 98           cbi     0x05, 2 ; 5
1549
1550         while (SCK_OFF);
1551      8dc:       2b 9b           sbis    0x05, 3 ; 5
1552      8de:       fe cf           rjmp    .-4             ; 0x8dc <DAC_Set+0x90>
1553         while (SCK_ON);
1554      8e0:       2b 99           sbic    0x05, 3 ; 5
1555      8e2:       fe cf           rjmp    .-4             ; 0x8e0 <DAC_Set+0x94>
1556
1557         DAC_PORT |= (1<<LDAC);
1558      8e4:       2a 9a           sbi     0x05, 2 ; 5
1559
1560         while (SCK_OFF);
1561      8e6:       2b 9b           sbis    0x05, 3 ; 5
1562      8e8:       fe cf           rjmp    .-4             ; 0x8e6 <DAC_Set+0x9a>
1563         while (SCK_ON);
1564      8ea:       2b 99           sbic    0x05, 3 ; 5
1565      8ec:       fe cf           rjmp    .-4             ; 0x8ea <DAC_Set+0x9e>
1566 }
1567      8ee:       df 91           pop     r29
1568      8f0:       cf 91           pop     r28
1569      8f2:       08 95           ret
1570
1571 000008f4 <LCD_WriteDigit>:
1572 *   Purpose :       Stores LCD control data in the LCD_displayData buffer.
1573 *                   (The LCD_displayData is latched in the LCD_SOF interrupt.)
1574 *
1575 *****************************************************************************/
1576 void LCD_WriteDigit(char c, char digit)
1577 {
1578      8f4:       cf 93           push    r28
1579      8f6:       df 93           push    r29
1580      8f8:       98 2f           mov     r25, r24
1581     char mask, nibble;
1582     volatile char *ptr;
1583     char i;
1584
1585
1586     if (digit > 5)                              // Skip if digit is illegal
1587      8fa:       66 30           cpi     r22, 0x06       ; 6
1588      8fc:       c8 f5           brcc    .+114           ; 0x970 <LCD_WriteDigit+0x7c>
1589         return;
1590
1591     //Lookup character table for segmet data
1592     if ((c >= '*') && (c <= 'z'))
1593      8fe:       8a 52           subi    r24, 0x2A       ; 42
1594      900:       81 35           cpi     r24, 0x51       ; 81
1595      902:       18 f0           brcs    .+6             ; 0x90a <LCD_WriteDigit+0x16>
1596      904:       a0 e0           ldi     r26, 0x00       ; 0
1597      906:       b0 e0           ldi     r27, 0x00       ; 0
1598      908:       0c c0           rjmp    .+24            ; 0x922 <LCD_WriteDigit+0x2e>
1599     {
1600         // c is a letter
1601         if (c >= 'a')                           // Convert to upper case
1602      90a:       91 36           cpi     r25, 0x61       ; 97
1603      90c:       08 f0           brcs    .+2             ; 0x910 <LCD_WriteDigit+0x1c>
1604             c &= ~0x20;                         // if necessarry
1605      90e:       9f 7d           andi    r25, 0xDF       ; 223
1606
1607         c -= '*';
1608
1609         //mt seg = LCD_character_table[c];
1610         seg = (unsigned int) pgm_read_word(&LCD_character_table[(uint8_t)c]); 
1611      910:       9a 52           subi    r25, 0x2A       ; 42
1612      912:       e9 2f           mov     r30, r25
1613      914:       f0 e0           ldi     r31, 0x00       ; 0
1614      916:       ee 0f           add     r30, r30
1615      918:       ff 1f           adc     r31, r31
1616      91a:       e4 5a           subi    r30, 0xA4       ; 164
1617      91c:       ff 4f           sbci    r31, 0xFF       ; 255
1618      91e:       a5 91           lpm     r26, Z+
1619      920:       b4 91           lpm     r27, Z+
1620     }
1621
1622     // Adjust mask according to LCD segment mapping
1623     if (digit & 0x01)
1624      922:       86 2f           mov     r24, r22
1625      924:       90 e0           ldi     r25, 0x00       ; 0
1626      926:       ec 01           movw    r28, r24
1627      928:       c1 70           andi    r28, 0x01       ; 1
1628      92a:       d0 70           andi    r29, 0x00       ; 0
1629      92c:       60 fd           sbrc    r22, 0
1630      92e:       02 c0           rjmp    .+4             ; 0x934 <LCD_WriteDigit+0x40>
1631      930:       90 ef           ldi     r25, 0xF0       ; 240
1632      932:       01 c0           rjmp    .+2             ; 0x936 <LCD_WriteDigit+0x42>
1633      934:       9f e0           ldi     r25, 0x0F       ; 15
1634         mask = 0x0F;                // Digit 1, 3, 5
1635     else
1636         mask = 0xF0;                // Digit 0, 2, 4
1637
1638     ptr = LCD_Data + (digit >> 1);  // digit = {0,0,1,1,2,2}
1639      936:       66 95           lsr     r22
1640      938:       70 e0           ldi     r23, 0x00       ; 0
1641      93a:       63 52           subi    r22, 0x23       ; 35
1642      93c:       7e 4f           sbci    r23, 0xFE       ; 254
1643      93e:       20 e0           ldi     r18, 0x00       ; 0
1644      940:       30 e0           ldi     r19, 0x00       ; 0
1645      942:       fb 01           movw    r30, r22
1646      944:       e2 0f           add     r30, r18
1647      946:       f3 1f           adc     r31, r19
1648
1649     for (i = 0; i < 4; i++)
1650     {
1651         nibble = seg & 0x000F;
1652      948:       4a 2f           mov     r20, r26
1653      94a:       4f 70           andi    r20, 0x0F       ; 15
1654         seg >>= 4;
1655      94c:       84 e0           ldi     r24, 0x04       ; 4
1656      94e:       b6 95           lsr     r27
1657      950:       a7 95           ror     r26
1658      952:       8a 95           dec     r24
1659      954:       e1 f7           brne    .-8             ; 0x94e <LCD_WriteDigit+0x5a>
1660         if (digit & 0x01)
1661      956:       20 97           sbiw    r28, 0x00       ; 0
1662      958:       11 f0           breq    .+4             ; 0x95e <LCD_WriteDigit+0x6a>
1663             nibble <<= 4;
1664      95a:       42 95           swap    r20
1665      95c:       40 7f           andi    r20, 0xF0       ; 240
1666         *ptr = (*ptr & mask) | nibble;
1667      95e:       80 81           ld      r24, Z
1668      960:       89 23           and     r24, r25
1669      962:       48 2b           or      r20, r24
1670      964:       40 83           st      Z, r20
1671      966:       2b 5f           subi    r18, 0xFB       ; 251
1672      968:       3f 4f           sbci    r19, 0xFF       ; 255
1673     else
1674         mask = 0xF0;                // Digit 0, 2, 4
1675
1676     ptr = LCD_Data + (digit >> 1);  // digit = {0,0,1,1,2,2}
1677
1678     for (i = 0; i < 4; i++)
1679      96a:       24 31           cpi     r18, 0x14       ; 20
1680      96c:       31 05           cpc     r19, r1
1681      96e:       49 f7           brne    .-46            ; 0x942 <LCD_WriteDigit+0x4e>
1682         if (digit & 0x01)
1683             nibble <<= 4;
1684         *ptr = (*ptr & mask) | nibble;
1685         ptr += 5;
1686     }
1687 }
1688      970:       df 91           pop     r29
1689      972:       cf 91           pop     r28
1690      974:       08 95           ret
1691
1692 00000976 <LCD_AllSegments>:
1693 *****************************************************************************/
1694 void LCD_AllSegments(char show)
1695 {
1696     unsigned char i;
1697
1698     if (show)
1699      976:       81 11           cpse    r24, r1
1700      978:       8f ef           ldi     r24, 0xFF       ; 255
1701      97a:       20 e0           ldi     r18, 0x00       ; 0
1702      97c:       30 e0           ldi     r19, 0x00       ; 0
1703      97e:       f9 01           movw    r30, r18
1704      980:       e3 52           subi    r30, 0x23       ; 35
1705      982:       fe 4f           sbci    r31, 0xFE       ; 254
1706         show = 0xFF;
1707
1708     // Set/clear all bits in all LCD registers
1709     for (i=0; i < LCD_REGISTER_COUNT; i++)
1710         *(LCD_Data + i) = show;
1711      984:       80 83           st      Z, r24
1712      986:       2f 5f           subi    r18, 0xFF       ; 255
1713      988:       3f 4f           sbci    r19, 0xFF       ; 255
1714
1715     if (show)
1716         show = 0xFF;
1717
1718     // Set/clear all bits in all LCD registers
1719     for (i=0; i < LCD_REGISTER_COUNT; i++)
1720      98a:       24 31           cpi     r18, 0x14       ; 20
1721      98c:       31 05           cpc     r19, r1
1722      98e:       b9 f7           brne    .-18            ; 0x97e <LCD_AllSegments+0x8>
1723         *(LCD_Data + i) = show;
1724 }
1725      990:       08 95           ret
1726
1727 00000992 <LCD_Init>:
1728 *                   Set up the LCD (timing, contrast, etc.)
1729 *
1730 *****************************************************************************/
1731 void LCD_Init(void)
1732 {
1733     LCD_AllSegments(FALSE);                     // Clear segment buffer.
1734      992:       80 e0           ldi     r24, 0x00       ; 0
1735      994:       f0 df           rcall   .-32            ; 0x976 <LCD_AllSegments>
1736
1737     LCD_CONTRAST_LEVEL(LCD_INITIAL_CONTRAST);    //Set the LCD contrast level
1738      996:       a7 ee           ldi     r26, 0xE7       ; 231
1739      998:       b0 e0           ldi     r27, 0x00       ; 0
1740      99a:       8c 91           ld      r24, X
1741      99c:       8f 60           ori     r24, 0x0F       ; 15
1742      99e:       8c 93           st      X, r24
1743
1744     // Select asynchronous clock source, enable all COM pins and enable all
1745     // segment pins.
1746     LCDCRB = (1<<LCDCS) | (3<<LCDMUX0) | (7<<LCDPM0);
1747      9a0:       87 eb           ldi     r24, 0xB7       ; 183
1748      9a2:       80 93 e5 00     sts     0x00E5, r24
1749
1750     // Set LCD prescaler to give a framerate of 32,0 Hz
1751     LCDFRR = (0<<LCDPS0) | (7<<LCDCD0);    
1752      9a6:       87 e0           ldi     r24, 0x07       ; 7
1753      9a8:       80 93 e6 00     sts     0x00E6, r24
1754
1755     LCDCRA = (1<<LCDEN) | (1<<LCDAB);           // Enable LCD and set low power waveform
1756      9ac:       e4 ee           ldi     r30, 0xE4       ; 228
1757      9ae:       f0 e0           ldi     r31, 0x00       ; 0
1758      9b0:       80 ec           ldi     r24, 0xC0       ; 192
1759      9b2:       80 83           st      Z, r24
1760
1761     //Enable LCD start of frame interrupt
1762     LCDCRA |= (1<<LCDIE);
1763      9b4:       80 81           ld      r24, Z
1764      9b6:       88 60           ori     r24, 0x08       ; 8
1765      9b8:       80 83           st      Z, r24
1766
1767     //updated 2006-10-10, setting LCD drive time to 1150us in FW rev 07, 
1768     //instead of previous 300us in FW rev 06. Due to some variations on the LCD
1769     //glass provided to the AVR Butterfly production.
1770     LCDCCR |= (1<<LCDDC2) | (1<<LCDDC1) | (1<<LCDDC0);
1771      9ba:       8c 91           ld      r24, X
1772      9bc:       80 6e           ori     r24, 0xE0       ; 224
1773      9be:       8c 93           st      X, r24
1774
1775     gLCD_Update_Required = FALSE;
1776      9c0:       10 92 8a 01     sts     0x018A, r1
1777
1778
1779 }
1780      9c4:       08 95           ret
1781
1782 000009c6 <__vector_22>:
1783 *   Purpose: Latch the LCD_displayData and Set LCD_status.updateComplete
1784 *
1785 *****************************************************************************/
1786
1787 ISR(LCD_vect)
1788 {
1789      9c6:       1f 92           push    r1
1790      9c8:       0f 92           push    r0
1791      9ca:       0f b6           in      r0, 0x3f        ; 63
1792      9cc:       0f 92           push    r0
1793      9ce:       11 24           eor     r1, r1
1794      9d0:       ef 92           push    r14
1795      9d2:       ff 92           push    r15
1796      9d4:       0f 93           push    r16
1797      9d6:       1f 93           push    r17
1798      9d8:       2f 93           push    r18
1799      9da:       3f 93           push    r19
1800      9dc:       4f 93           push    r20
1801      9de:       5f 93           push    r21
1802      9e0:       6f 93           push    r22
1803      9e2:       7f 93           push    r23
1804      9e4:       8f 93           push    r24
1805      9e6:       9f 93           push    r25
1806      9e8:       af 93           push    r26
1807      9ea:       bf 93           push    r27
1808      9ec:       cf 93           push    r28
1809      9ee:       df 93           push    r29
1810      9f0:       ef 93           push    r30
1811      9f2:       ff 93           push    r31
1812
1813
1814
1815     c_flash=0; // mt
1816
1817     LCD_timer--;                    // Decreased every LCD frame
1818      9f4:       00 91 89 01     lds     r16, 0x0189
1819      9f8:       01 50           subi    r16, 0x01       ; 1
1820      9fa:       00 93 89 01     sts     0x0189, r16
1821
1822     if (gScrollMode)
1823      9fe:       80 91 dc 01     lds     r24, 0x01DC
1824      a02:       88 23           and     r24, r24
1825      a04:       81 f0           breq    .+32            ; 0xa26 <__vector_22+0x60>
1826     {
1827         // If we are in scroll mode, and the timer has expired,
1828         // we will update the LCD
1829         if (LCD_timer == 0)
1830      a06:       00 23           and     r16, r16
1831      a08:       81 f4           brne    .+32            ; 0xa2a <__vector_22+0x64>
1832         {
1833             if (gLCD_Start_Scroll_Timer == 0)
1834      a0a:       80 91 8b 01     lds     r24, 0x018B
1835      a0e:       88 23           and     r24, r24
1836      a10:       21 f4           brne    .+8             ; 0xa1a <__vector_22+0x54>
1837             {
1838                 gLCD_Update_Required = TRUE;
1839      a12:       81 e0           ldi     r24, 0x01       ; 1
1840      a14:       80 93 8a 01     sts     0x018A, r24
1841      a18:       08 c0           rjmp    .+16            ; 0xa2a <__vector_22+0x64>
1842             }
1843             else
1844                 gLCD_Start_Scroll_Timer--;
1845      a1a:       80 91 8b 01     lds     r24, 0x018B
1846      a1e:       81 50           subi    r24, 0x01       ; 1
1847      a20:       80 93 8b 01     sts     0x018B, r24
1848      a24:       02 c0           rjmp    .+4             ; 0xa2a <__vector_22+0x64>
1849     }
1850     else    
1851     {   // if not scrolling,
1852         // disble LCD start of frame interrupt
1853         // cbi(LCDCRA, LCDIE);   //DEBUG
1854         gScroll = 0;
1855      a26:       10 92 0a 02     sts     0x020A, r1
1856     }
1857
1858
1859     EOL = FALSE;
1860     if (gLCD_Update_Required == TRUE)
1861      a2a:       80 91 8a 01     lds     r24, 0x018A
1862      a2e:       81 30           cpi     r24, 0x01       ; 1
1863      a30:       09 f0           breq    .+2             ; 0xa34 <__vector_22+0x6e>
1864      a32:       51 c0           rjmp    .+162           ; 0xad6 <__vector_22+0x110>
1865     {
1866         // Duty cycle of flashing characters
1867         if (gFlashTimer < (LCD_FLASH_SEED >> 1))
1868      a34:       e0 90 8c 01     lds     r14, 0x018C
1869      a38:       ff 24           eor     r15, r15
1870      a3a:       10 e0           ldi     r17, 0x00       ; 0
1871      a3c:       c0 e0           ldi     r28, 0x00       ; 0
1872      a3e:       d0 e0           ldi     r29, 0x00       ; 0
1873      a40:       6c 2f           mov     r22, r28
1874             flash = 1;
1875
1876         // Repeat for the six LCD characters
1877         for (i = 0; i < 6; i++)
1878         {
1879             if ((gScroll+i) >= 0 && (!EOL))
1880      a42:       80 91 0a 02     lds     r24, 0x020A
1881      a46:       99 27           eor     r25, r25
1882      a48:       87 fd           sbrc    r24, 7
1883      a4a:       90 95           com     r25
1884      a4c:       8c 0f           add     r24, r28
1885      a4e:       9d 1f           adc     r25, r29
1886      a50:       97 fd           sbrc    r25, 7
1887      a52:       15 c0           rjmp    .+42            ; 0xa7e <__vector_22+0xb8>
1888      a54:       11 23           and     r17, r17
1889      a56:       99 f4           brne    .+38            ; 0xa7e <__vector_22+0xb8>
1890             {
1891                 // We have some visible characters
1892                 c = gTextBuffer[i + gScroll];
1893      a58:       e0 91 0a 02     lds     r30, 0x020A
1894      a5c:       ff 27           eor     r31, r31
1895      a5e:       e7 fd           sbrc    r30, 7
1896      a60:       f0 95           com     r31
1897      a62:       ec 0f           add     r30, r28
1898      a64:       fd 1f           adc     r31, r29
1899      a66:       ef 50           subi    r30, 0x0F       ; 15
1900      a68:       fe 4f           sbci    r31, 0xFE       ; 254
1901      a6a:       80 81           ld      r24, Z
1902                 c_flash = c & 0x80 ? 1 : 0;
1903      a6c:       f8 2e           mov     r15, r24
1904      a6e:       ff 1c           adc     r15, r15
1905      a70:       ff 24           eor     r15, r15
1906      a72:       ff 1c           adc     r15, r15
1907                 c = c & 0x7F;
1908      a74:       8f 77           andi    r24, 0x7F       ; 127
1909
1910                 if (c == '\0')
1911      a76:       21 f4           brne    .+8             ; 0xa80 <__vector_22+0xba>
1912      a78:       1c 2f           mov     r17, r28
1913      a7a:       1f 5f           subi    r17, 0xFF       ; 255
1914      a7c:       01 c0           rjmp    .+2             ; 0xa80 <__vector_22+0xba>
1915      a7e:       80 e2           ldi     r24, 0x20       ; 32
1916             else
1917                 c = ' ';
1918
1919             // Check if this character is flashing
1920
1921             if (c_flash && flash)
1922      a80:       ff 20           and     r15, r15
1923      a82:       21 f0           breq    .+8             ; 0xa8c <__vector_22+0xc6>
1924      a84:       94 e0           ldi     r25, 0x04       ; 4
1925      a86:       9e 15           cp      r25, r14
1926      a88:       08 f4           brcc    .+2             ; 0xa8c <__vector_22+0xc6>
1927                 LCD_WriteDigit(' ', i);
1928      a8a:       80 e2           ldi     r24, 0x20       ; 32
1929             else
1930                 LCD_WriteDigit(c, i);
1931      a8c:       33 df           rcall   .-410           ; 0x8f4 <LCD_WriteDigit>
1932      a8e:       21 96           adiw    r28, 0x01       ; 1
1933             flash = 0;
1934         else
1935             flash = 1;
1936
1937         // Repeat for the six LCD characters
1938         for (i = 0; i < 6; i++)
1939      a90:       c6 30           cpi     r28, 0x06       ; 6
1940      a92:       d1 05           cpc     r29, r1
1941      a94:       a9 f6           brne    .-86            ; 0xa40 <__vector_22+0x7a>
1942      a96:       ac ee           ldi     r26, 0xEC       ; 236
1943      a98:       b0 e0           ldi     r27, 0x00       ; 0
1944      a9a:       fd 01           movw    r30, r26
1945      a9c:       ef 50           subi    r30, 0x0F       ; 15
1946      a9e:       ff 4f           sbci    r31, 0xFF       ; 255
1947                 LCD_WriteDigit(c, i);
1948         }
1949
1950         // Copy the segment buffer to the real segments
1951         for (i = 0; i < LCD_REGISTER_COUNT; i++)
1952             *(pLCDREG + i) = *(LCD_Data+i);
1953      aa0:       80 81           ld      r24, Z
1954      aa2:       8d 93           st      X+, r24
1955             else
1956                 LCD_WriteDigit(c, i);
1957         }
1958
1959         // Copy the segment buffer to the real segments
1960         for (i = 0; i < LCD_REGISTER_COUNT; i++)
1961      aa4:       81 e0           ldi     r24, 0x01       ; 1
1962      aa6:       a0 30           cpi     r26, 0x00       ; 0
1963      aa8:       b8 07           cpc     r27, r24
1964      aaa:       b9 f7           brne    .-18            ; 0xa9a <__vector_22+0xd4>
1965             *(pLCDREG + i) = *(LCD_Data+i);
1966
1967         // Handle colon
1968         if (gColon)
1969      aac:       80 91 8d 01     lds     r24, 0x018D
1970      ab0:       88 23           and     r24, r24
1971      ab2:       21 f0           breq    .+8             ; 0xabc <__vector_22+0xf6>
1972             *(pLCDREG + 8) = 0x01;
1973      ab4:       81 e0           ldi     r24, 0x01       ; 1
1974      ab6:       80 93 f4 00     sts     0x00F4, r24
1975      aba:       02 c0           rjmp    .+4             ; 0xac0 <__vector_22+0xfa>
1976         else
1977             *(pLCDREG + 8) = 0x00;
1978      abc:       10 92 f4 00     sts     0x00F4, r1
1979
1980         // If the text scrolled off the display,
1981         // we have to start over again.
1982         if (EOL == 1)
1983      ac0:       11 30           cpi     r17, 0x01       ; 1
1984      ac2:       11 f4           brne    .+4             ; 0xac8 <__vector_22+0x102>
1985             gScroll = -6;
1986      ac4:       8a ef           ldi     r24, 0xFA       ; 250
1987      ac6:       03 c0           rjmp    .+6             ; 0xace <__vector_22+0x108>
1988         else
1989             gScroll++;
1990      ac8:       80 91 0a 02     lds     r24, 0x020A
1991      acc:       8f 5f           subi    r24, 0xFF       ; 255
1992      ace:       80 93 0a 02     sts     0x020A, r24
1993
1994         // No need to update anymore
1995         gLCD_Update_Required = FALSE;
1996      ad2:       10 92 8a 01     sts     0x018A, r1
1997     }
1998
1999
2000     // LCD_timer is used when scrolling text
2001     if (LCD_timer == 0)
2002      ad6:       00 23           and     r16, r16
2003      ad8:       19 f4           brne    .+6             ; 0xae0 <__vector_22+0x11a>
2004     {
2005 /*        if ((gScroll <= 0) || EOL)
2006             LCD_timer = LCD_TIMER_SEED/2;
2007         else*/
2008             LCD_timer = LCD_TIMER_SEED;
2009      ada:       83 e0           ldi     r24, 0x03       ; 3
2010      adc:       80 93 89 01     sts     0x0189, r24
2011     }
2012
2013     // gFlashTimer is used when flashing characters
2014     if (gFlashTimer == LCD_FLASH_SEED)
2015      ae0:       80 91 8c 01     lds     r24, 0x018C
2016      ae4:       8a 30           cpi     r24, 0x0A       ; 10
2017      ae6:       19 f4           brne    .+6             ; 0xaee <__vector_22+0x128>
2018         gFlashTimer= 0;
2019      ae8:       10 92 8c 01     sts     0x018C, r1
2020      aec:       05 c0           rjmp    .+10            ; 0xaf8 <__vector_22+0x132>
2021     else
2022         gFlashTimer++;
2023      aee:       80 91 8c 01     lds     r24, 0x018C
2024      af2:       8f 5f           subi    r24, 0xFF       ; 255
2025      af4:       80 93 8c 01     sts     0x018C, r24
2026
2027 }
2028      af8:       ff 91           pop     r31
2029      afa:       ef 91           pop     r30
2030      afc:       df 91           pop     r29
2031      afe:       cf 91           pop     r28
2032      b00:       bf 91           pop     r27
2033      b02:       af 91           pop     r26
2034      b04:       9f 91           pop     r25
2035      b06:       8f 91           pop     r24
2036      b08:       7f 91           pop     r23
2037      b0a:       6f 91           pop     r22
2038      b0c:       5f 91           pop     r21
2039      b0e:       4f 91           pop     r20
2040      b10:       3f 91           pop     r19
2041      b12:       2f 91           pop     r18
2042      b14:       1f 91           pop     r17
2043      b16:       0f 91           pop     r16
2044      b18:       ff 90           pop     r15
2045      b1a:       ef 90           pop     r14
2046      b1c:       0f 90           pop     r0
2047      b1e:       0f be           out     0x3f, r0        ; 63
2048      b20:       0f 90           pop     r0
2049      b22:       1f 90           pop     r1
2050      b24:       18 95           reti
2051
2052 00000b26 <LCD_puts>:
2053 *
2054 *       Purpose :               Writes a string to the LCD
2055 *
2056 *****************************************************************************/
2057 void LCD_puts(char *pStr)
2058 {
2059      b26:       bc 01           movw    r22, r24
2060     uint8_t i; // char i;
2061
2062     while (gLCD_Update_Required);      // Wait for access to buffer
2063      b28:       80 91 8a 01     lds     r24, 0x018A
2064      b2c:       88 23           and     r24, r24
2065      b2e:       e1 f7           brne    .-8             ; 0xb28 <LCD_puts+0x2>
2066      b30:       20 e0           ldi     r18, 0x00       ; 0
2067      b32:       30 e0           ldi     r19, 0x00       ; 0
2068      b34:       06 c0           rjmp    .+12            ; 0xb42 <LCD_puts+0x1c>
2069
2070     for (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++)
2071     {
2072         gTextBuffer[i] = pStr[i];
2073      b36:       f9 01           movw    r30, r18
2074      b38:       ef 50           subi    r30, 0x0F       ; 15
2075      b3a:       fe 4f           sbci    r31, 0xFE       ; 254
2076      b3c:       80 83           st      Z, r24
2077      b3e:       2f 5f           subi    r18, 0xFF       ; 255
2078      b40:       3f 4f           sbci    r19, 0xFF       ; 255
2079      b42:       42 2f           mov     r20, r18
2080 {
2081     uint8_t i; // char i;
2082
2083     while (gLCD_Update_Required);      // Wait for access to buffer
2084
2085     for (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++)
2086      b44:       fb 01           movw    r30, r22
2087      b46:       e2 0f           add     r30, r18
2088      b48:       f3 1f           adc     r31, r19
2089      b4a:       80 81           ld      r24, Z
2090      b4c:       88 23           and     r24, r24
2091      b4e:       19 f0           breq    .+6             ; 0xb56 <LCD_puts+0x30>
2092      b50:       29 31           cpi     r18, 0x19       ; 25
2093      b52:       31 05           cpc     r19, r1
2094      b54:       81 f7           brne    .-32            ; 0xb36 <LCD_puts+0x10>
2095     {
2096         gTextBuffer[i] = pStr[i];
2097     }
2098
2099     gTextBuffer[i] = '\0';
2100      b56:       e4 2f           mov     r30, r20
2101      b58:       f0 e0           ldi     r31, 0x00       ; 0
2102      b5a:       ef 50           subi    r30, 0x0F       ; 15
2103      b5c:       fe 4f           sbci    r31, 0xFE       ; 254
2104      b5e:       10 82           st      Z, r1
2105
2106     if (i > 6)
2107      b60:       47 30           cpi     r20, 0x07       ; 7
2108      b62:       48 f0           brcs    .+18            ; 0xb76 <LCD_puts+0x50>
2109     {
2110         gScrollMode = 1;        // Scroll if text is longer than display size
2111      b64:       81 e0           ldi     r24, 0x01       ; 1
2112      b66:       80 93 dc 01     sts     0x01DC, r24
2113         gScroll = 0;
2114      b6a:       10 92 0a 02     sts     0x020A, r1
2115         gLCD_Start_Scroll_Timer = 3;    //Start-up delay before scrolling the text
2116      b6e:       83 e0           ldi     r24, 0x03       ; 3
2117      b70:       80 93 8b 01     sts     0x018B, r24
2118      b74:       04 c0           rjmp    .+8             ; 0xb7e <LCD_puts+0x58>
2119     }
2120     else
2121     {
2122         gScrollMode = 0;        
2123      b76:       10 92 dc 01     sts     0x01DC, r1
2124         gScroll = 0;
2125      b7a:       10 92 0a 02     sts     0x020A, r1
2126     }
2127
2128     gLCD_Update_Required = 1;
2129      b7e:       81 e0           ldi     r24, 0x01       ; 1
2130      b80:       80 93 8a 01     sts     0x018A, r24
2131 }
2132      b84:       08 95           ret
2133
2134 00000b86 <LCD_Colon>:
2135 *       Purpose :               Enable/disable colons on the LCD
2136 *
2137 *****************************************************************************/
2138 void LCD_Colon(char show)
2139 {
2140     gColon = show;
2141      b86:       80 93 8d 01     sts     0x018D, r24
2142 }
2143      b8a:       08 95           ret
2144
2145 00000b8c <LCD_UpdateRequired>:
2146 *
2147 *       Purpose :               Tells the LCD that there is new data to be presented
2148 *
2149 *****************************************************************************/
2150 void LCD_UpdateRequired(char update, char scrollmode)
2151 {
2152      b8c:       98 2f           mov     r25, r24
2153
2154     while (gLCD_Update_Required);
2155      b8e:       80 91 8a 01     lds     r24, 0x018A
2156      b92:       88 23           and     r24, r24
2157      b94:       e1 f7           brne    .-8             ; 0xb8e <LCD_UpdateRequired+0x2>
2158     
2159     gScrollMode = scrollmode;
2160      b96:       60 93 dc 01     sts     0x01DC, r22
2161     gScroll = 0;
2162      b9a:       10 92 0a 02     sts     0x020A, r1
2163
2164     gLCD_Update_Required = update;
2165      b9e:       90 93 8a 01     sts     0x018A, r25
2166 }
2167      ba2:       08 95           ret
2168
2169 00000ba4 <LCD_putc>:
2170
2171
2172
2173 void LCD_putc(uint8_t digit, char character)
2174 {
2175     if (digit < TEXTBUFFER_SIZE)
2176      ba4:       89 31           cpi     r24, 0x19       ; 25
2177      ba6:       28 f4           brcc    .+10            ; 0xbb2 <LCD_putc+0xe>
2178         gTextBuffer[digit] = character;
2179      ba8:       e8 2f           mov     r30, r24
2180      baa:       f0 e0           ldi     r31, 0x00       ; 0
2181      bac:       ef 50           subi    r30, 0x0F       ; 15
2182      bae:       fe 4f           sbci    r31, 0xFE       ; 254
2183      bb0:       60 83           st      Z, r22
2184      bb2:       08 95           ret
2185
2186 00000bb4 <LCD_ShowTime>:
2187 }
2188
2189 void LCD_ShowTime(uint32 tmr)
2190 {
2191      bb4:       6f 92           push    r6
2192      bb6:       7f 92           push    r7
2193      bb8:       8f 92           push    r8
2194      bba:       9f 92           push    r9
2195      bbc:       af 92           push    r10
2196      bbe:       bf 92           push    r11
2197      bc0:       cf 92           push    r12
2198      bc2:       df 92           push    r13
2199      bc4:       ef 92           push    r14
2200      bc6:       ff 92           push    r15
2201      bc8:       0f 93           push    r16
2202      bca:       1f 93           push    r17
2203      bcc:       df 93           push    r29
2204      bce:       cf 93           push    r28
2205      bd0:       00 d0           rcall   .+0             ; 0xbd2 <LCD_ShowTime+0x1e>
2206      bd2:       00 d0           rcall   .+0             ; 0xbd4 <LCD_ShowTime+0x20>
2207      bd4:       00 d0           rcall   .+0             ; 0xbd6 <LCD_ShowTime+0x22>
2208      bd6:       cd b7           in      r28, 0x3d       ; 61
2209      bd8:       de b7           in      r29, 0x3e       ; 62
2210      bda:       5b 01           movw    r10, r22
2211      bdc:       6c 01           movw    r12, r24
2212         uint hours = tmr / 360000;
2213      bde:       20 e4           ldi     r18, 0x40       ; 64
2214      be0:       3e e7           ldi     r19, 0x7E       ; 126
2215      be2:       45 e0           ldi     r20, 0x05       ; 5
2216      be4:       50 e0           ldi     r21, 0x00       ; 0
2217      be6:       99 d6           rcall   .+3378          ; 0x191a <__udivmodsi4>
2218      be8:       39 01           movw    r6, r18
2219      bea:       4a 01           movw    r8, r20
2220         tmr = tmr - hours*360000;
2221      bec:       b9 01           movw    r22, r18
2222      bee:       80 e0           ldi     r24, 0x00       ; 0
2223      bf0:       90 e0           ldi     r25, 0x00       ; 0
2224      bf2:       20 ec           ldi     r18, 0xC0       ; 192
2225      bf4:       31 e8           ldi     r19, 0x81       ; 129
2226      bf6:       4a ef           ldi     r20, 0xFA       ; 250
2227      bf8:       5f ef           ldi     r21, 0xFF       ; 255
2228      bfa:       49 d6           rcall   .+3218          ; 0x188e <__mulsi3>
2229      bfc:       7b 01           movw    r14, r22
2230      bfe:       8c 01           movw    r16, r24
2231      c00:       ea 0c           add     r14, r10
2232      c02:       fb 1c           adc     r15, r11
2233      c04:       0c 1d           adc     r16, r12
2234      c06:       1d 1d           adc     r17, r13
2235         uint minutes = tmr / 6000;
2236      c08:       c8 01           movw    r24, r16
2237      c0a:       b7 01           movw    r22, r14
2238      c0c:       20 e7           ldi     r18, 0x70       ; 112
2239      c0e:       37 e1           ldi     r19, 0x17       ; 23
2240      c10:       40 e0           ldi     r20, 0x00       ; 0
2241      c12:       50 e0           ldi     r21, 0x00       ; 0
2242      c14:       82 d6           rcall   .+3332          ; 0x191a <__udivmodsi4>
2243      c16:       59 01           movw    r10, r18
2244      c18:       6a 01           movw    r12, r20
2245         tmr = tmr - minutes*6000;
2246         uint seconds = tmr / 100;
2247      c1a:       80 e7           ldi     r24, 0x70       ; 112
2248      c1c:       97 e1           ldi     r25, 0x17       ; 23
2249      c1e:       9c 01           movw    r18, r24
2250      c20:       2a 9d           mul     r18, r10
2251      c22:       c0 01           movw    r24, r0
2252      c24:       2b 9d           mul     r18, r11
2253      c26:       90 0d           add     r25, r0
2254      c28:       3a 9d           mul     r19, r10
2255      c2a:       90 0d           add     r25, r0
2256      c2c:       11 24           eor     r1, r1
2257      c2e:       a0 e0           ldi     r26, 0x00       ; 0
2258      c30:       b0 e0           ldi     r27, 0x00       ; 0
2259      c32:       e8 1a           sub     r14, r24
2260      c34:       f9 0a           sbc     r15, r25
2261      c36:       0a 0b           sbc     r16, r26
2262      c38:       1b 0b           sbc     r17, r27
2263      c3a:       c8 01           movw    r24, r16
2264      c3c:       b7 01           movw    r22, r14
2265      c3e:       24 e6           ldi     r18, 0x64       ; 100
2266      c40:       30 e0           ldi     r19, 0x00       ; 0
2267      c42:       40 e0           ldi     r20, 0x00       ; 0
2268      c44:       50 e0           ldi     r21, 0x00       ; 0
2269      c46:       69 d6           rcall   .+3282          ; 0x191a <__udivmodsi4>
2270      c48:       89 01           movw    r16, r18
2271      c4a:       9a 01           movw    r18, r20
2272         tmr = tmr - seconds*100;
2273         
2274         
2275         uint8 digits[6];
2276         digits[0] = hours/10;
2277      c4c:       c3 01           movw    r24, r6
2278      c4e:       6a e0           ldi     r22, 0x0A       ; 10
2279      c50:       70 e0           ldi     r23, 0x00       ; 0
2280      c52:       3c d6           rcall   .+3192          ; 0x18cc <__udivmodhi4>
2281      c54:       69 83           std     Y+1, r22        ; 0x01
2282         digits[1] = hours%10;
2283      c56:       c3 01           movw    r24, r6
2284      c58:       6a e0           ldi     r22, 0x0A       ; 10
2285      c5a:       70 e0           ldi     r23, 0x00       ; 0
2286      c5c:       37 d6           rcall   .+3182          ; 0x18cc <__udivmodhi4>
2287      c5e:       8a 83           std     Y+2, r24        ; 0x02
2288         digits[2] = minutes/10;
2289      c60:       c5 01           movw    r24, r10
2290      c62:       6a e0           ldi     r22, 0x0A       ; 10
2291      c64:       70 e0           ldi     r23, 0x00       ; 0
2292      c66:       32 d6           rcall   .+3172          ; 0x18cc <__udivmodhi4>
2293      c68:       6b 83           std     Y+3, r22        ; 0x03
2294         digits[3] = minutes%10;
2295      c6a:       c5 01           movw    r24, r10
2296      c6c:       6a e0           ldi     r22, 0x0A       ; 10
2297      c6e:       70 e0           ldi     r23, 0x00       ; 0
2298      c70:       2d d6           rcall   .+3162          ; 0x18cc <__udivmodhi4>
2299      c72:       8c 83           std     Y+4, r24        ; 0x04
2300         digits[4] = seconds/10;
2301      c74:       c8 01           movw    r24, r16
2302      c76:       6a e0           ldi     r22, 0x0A       ; 10
2303      c78:       70 e0           ldi     r23, 0x00       ; 0
2304      c7a:       28 d6           rcall   .+3152          ; 0x18cc <__udivmodhi4>
2305      c7c:       6d 83           std     Y+5, r22        ; 0x05
2306         digits[5] = seconds%10;
2307      c7e:       c8 01           movw    r24, r16
2308      c80:       6a e0           ldi     r22, 0x0A       ; 10
2309      c82:       70 e0           ldi     r23, 0x00       ; 0
2310      c84:       23 d6           rcall   .+3142          ; 0x18cc <__udivmodhi4>
2311      c86:       8e 83           std     Y+6, r24        ; 0x06
2312      c88:       7e 01           movw    r14, r28
2313      c8a:       08 94           sec
2314      c8c:       e1 1c           adc     r14, r1
2315      c8e:       f1 1c           adc     r15, r1
2316      c90:       87 01           movw    r16, r14
2317
2318         for (uint8 i = 0; i < 6; ++i)
2319      c92:       87 e0           ldi     r24, 0x07       ; 7
2320      c94:       c8 2e           mov     r12, r24
2321      c96:       d1 2c           mov     r13, r1
2322      c98:       cc 0e           add     r12, r28
2323      c9a:       dd 1e           adc     r13, r29
2324         {
2325                 LCD_putc(i, '0' + digits[i]);
2326      c9c:       80 2f           mov     r24, r16
2327      c9e:       8e 19           sub     r24, r14
2328      ca0:       f8 01           movw    r30, r16
2329      ca2:       61 91           ld      r22, Z+
2330      ca4:       8f 01           movw    r16, r30
2331      ca6:       60 5d           subi    r22, 0xD0       ; 208
2332      ca8:       7d df           rcall   .-262           ; 0xba4 <LCD_putc>
2333         digits[2] = minutes/10;
2334         digits[3] = minutes%10;
2335         digits[4] = seconds/10;
2336         digits[5] = seconds%10;
2337
2338         for (uint8 i = 0; i < 6; ++i)
2339      caa:       0c 15           cp      r16, r12
2340      cac:       1d 05           cpc     r17, r13
2341      cae:       b1 f7           brne    .-20            ; 0xc9c <LCD_ShowTime+0xe8>
2342         {
2343                 LCD_putc(i, '0' + digits[i]);
2344         }
2345         LCD_putc(6, '\0');
2346      cb0:       86 e0           ldi     r24, 0x06       ; 6
2347      cb2:       60 e0           ldi     r22, 0x00       ; 0
2348      cb4:       77 df           rcall   .-274           ; 0xba4 <LCD_putc>
2349
2350
2351         LCD_UpdateRequired(1, 0);
2352      cb6:       81 e0           ldi     r24, 0x01       ; 1
2353      cb8:       60 e0           ldi     r22, 0x00       ; 0
2354      cba:       68 df           rcall   .-304           ; 0xb8c <LCD_UpdateRequired>
2355 }
2356      cbc:       26 96           adiw    r28, 0x06       ; 6
2357      cbe:       0f b6           in      r0, 0x3f        ; 63
2358      cc0:       f8 94           cli
2359      cc2:       de bf           out     0x3e, r29       ; 62
2360      cc4:       0f be           out     0x3f, r0        ; 63
2361      cc6:       cd bf           out     0x3d, r28       ; 61
2362      cc8:       cf 91           pop     r28
2363      cca:       df 91           pop     r29
2364      ccc:       1f 91           pop     r17
2365      cce:       0f 91           pop     r16
2366      cd0:       ff 90           pop     r15
2367      cd2:       ef 90           pop     r14
2368      cd4:       df 90           pop     r13
2369      cd6:       cf 90           pop     r12
2370      cd8:       bf 90           pop     r11
2371      cda:       af 90           pop     r10
2372      cdc:       9f 90           pop     r9
2373      cde:       8f 90           pop     r8
2374      ce0:       7f 90           pop     r7
2375      ce2:       6f 90           pop     r6
2376      ce4:       08 95           ret
2377
2378 00000ce6 <LCD_printf>:
2379 }
2380
2381 #include <stdarg.h>
2382 #include "printf.h"
2383 int LCD_printf(const char * format, ...)
2384 {
2385      ce6:       ef 92           push    r14
2386      ce8:       ff 92           push    r15
2387      cea:       0f 93           push    r16
2388      cec:       1f 93           push    r17
2389      cee:       df 93           push    r29
2390      cf0:       cf 93           push    r28
2391      cf2:       cd b7           in      r28, 0x3d       ; 61
2392      cf4:       de b7           in      r29, 0x3e       ; 62
2393      cf6:       69 97           sbiw    r28, 0x19       ; 25
2394      cf8:       0f b6           in      r0, 0x3f        ; 63
2395      cfa:       f8 94           cli
2396      cfc:       de bf           out     0x3e, r29       ; 62
2397      cfe:       0f be           out     0x3f, r0        ; 63
2398      d00:       cd bf           out     0x3d, r28       ; 61
2399      d02:       fe 01           movw    r30, r28
2400      d04:       b2 96           adiw    r30, 0x22       ; 34
2401      d06:       61 91           ld      r22, Z+
2402      d08:       71 91           ld      r23, Z+
2403         char buffer[TEXTBUFFER_SIZE];
2404         va_list args;
2405         va_start(args, format);
2406         int result = vsprintf(buffer, format, args);
2407      d0a:       7e 01           movw    r14, r28
2408      d0c:       08 94           sec
2409      d0e:       e1 1c           adc     r14, r1
2410      d10:       f1 1c           adc     r15, r1
2411      d12:       c7 01           movw    r24, r14
2412      d14:       af 01           movw    r20, r30
2413      d16:       3d d2           rcall   .+1146          ; 0x1192 <vsprintf>
2414      d18:       8c 01           movw    r16, r24
2415         LCD_puts(buffer);
2416      d1a:       c7 01           movw    r24, r14
2417      d1c:       04 df           rcall   .-504           ; 0xb26 <LCD_puts>
2418         return result;
2419 }
2420      d1e:       c8 01           movw    r24, r16
2421      d20:       69 96           adiw    r28, 0x19       ; 25
2422      d22:       0f b6           in      r0, 0x3f        ; 63
2423      d24:       f8 94           cli
2424      d26:       de bf           out     0x3e, r29       ; 62
2425      d28:       0f be           out     0x3f, r0        ; 63
2426      d2a:       cd bf           out     0x3d, r28       ; 61
2427      d2c:       cf 91           pop     r28
2428      d2e:       df 91           pop     r29
2429      d30:       1f 91           pop     r17
2430      d32:       0f 91           pop     r16
2431      d34:       ff 90           pop     r15
2432      d36:       ef 90           pop     r14
2433      d38:       08 95           ret
2434
2435 00000d3a <ParseCommand>:
2436
2437
2438
2439
2440 uint8 ParseCommand()
2441 {
2442      d3a:       af 92           push    r10
2443      d3c:       bf 92           push    r11
2444      d3e:       cf 92           push    r12
2445      d40:       df 92           push    r13
2446      d42:       ef 92           push    r14
2447      d44:       ff 92           push    r15
2448      d46:       0f 93           push    r16
2449      d48:       1f 93           push    r17
2450      d4a:       df 93           push    r29
2451      d4c:       cf 93           push    r28
2452      d4e:       cd b7           in      r28, 0x3d       ; 61
2453      d50:       de b7           in      r29, 0x3e       ; 62
2454      d52:       2a 97           sbiw    r28, 0x0a       ; 10
2455      d54:       0f b6           in      r0, 0x3f        ; 63
2456      d56:       f8 94           cli
2457      d58:       de bf           out     0x3e, r29       ; 62
2458      d5a:       0f be           out     0x3f, r0        ; 63
2459      d5c:       cd bf           out     0x3d, r28       ; 61
2460         //return 0;
2461         
2462         USART_Tx('#');
2463      d5e:       83 e2           ldi     r24, 0x23       ; 35
2464      d60:       dc d2           rcall   .+1464          ; 0x131a <USART_Tx>
2465         char c = USART_Rx();
2466      d62:       e4 d2           rcall   .+1480          ; 0x132c <USART_Rx>
2467      d64:       d8 2e           mov     r13, r24
2468         //LCD_puts("input");
2469         char arg[MAX_TOKEN_SIZE];
2470         USART_Tx(c);
2471      d66:       d9 d2           rcall   .+1458          ; 0x131a <USART_Tx>
2472      d68:       cc 24           eor     r12, r12
2473
2474         uint8 i = 0;
2475         do
2476         {
2477                 arg[i] = USART_Rx();
2478      d6a:       5e 01           movw    r10, r28
2479      d6c:       08 94           sec
2480      d6e:       a1 1c           adc     r10, r1
2481      d70:       b1 1c           adc     r11, r1
2482      d72:       ec 2c           mov     r14, r12
2483      d74:       ff 24           eor     r15, r15
2484      d76:       da d2           rcall   .+1460          ; 0x132c <USART_Rx>
2485      d78:       85 01           movw    r16, r10
2486      d7a:       0e 0d           add     r16, r14
2487      d7c:       1f 1d           adc     r17, r15
2488      d7e:       d8 01           movw    r26, r16
2489      d80:       8c 93           st      X, r24
2490                 USART_Tx(arg[i]);
2491      d82:       cb d2           rcall   .+1430          ; 0x131a <USART_Tx>
2492                 switch (arg[i])
2493      d84:       f8 01           movw    r30, r16
2494      d86:       00 81           ld      r16, Z
2495      d88:       0d 30           cpi     r16, 0x0D       ; 13
2496      d8a:       49 f0           breq    .+18            ; 0xd9e <ParseCommand+0x64>
2497      d8c:       0e 30           cpi     r16, 0x0E       ; 14
2498      d8e:       18 f4           brcc    .+6             ; 0xd96 <ParseCommand+0x5c>
2499      d90:       0a 30           cpi     r16, 0x0A       ; 10
2500      d92:       49 f4           brne    .+18            ; 0xda6 <ParseCommand+0x6c>
2501      d94:       04 c0           rjmp    .+8             ; 0xd9e <ParseCommand+0x64>
2502      d96:       00 32           cpi     r16, 0x20       ; 32
2503      d98:       39 f0           breq    .+14            ; 0xda8 <ParseCommand+0x6e>
2504      d9a:       0b 33           cpi     r16, 0x3B       ; 59
2505      d9c:       21 f4           brne    .+8             ; 0xda6 <ParseCommand+0x6c>
2506                         case ' ':
2507                                 break;
2508                         case ';':
2509                         case '\r':
2510                         case '\n':
2511                                 arg[i] = '\0';
2512      d9e:       ea 0c           add     r14, r10
2513      da0:       fb 1c           adc     r15, r11
2514      da2:       d7 01           movw    r26, r14
2515      da4:       1c 92           st      X, r1
2516                         default:
2517                                 ++i;
2518      da6:       c3 94           inc     r12
2519                                 break;
2520                 }
2521                 
2522         }
2523         while ((arg[i-1] != '\0') && (i < MAX_TOKEN_SIZE));
2524      da8:       ec 2c           mov     r14, r12
2525      daa:       ff 24           eor     r15, r15
2526      dac:       87 01           movw    r16, r14
2527      dae:       01 50           subi    r16, 0x01       ; 1
2528      db0:       10 40           sbci    r17, 0x00       ; 0
2529      db2:       f5 01           movw    r30, r10
2530      db4:       e0 0f           add     r30, r16
2531      db6:       f1 1f           adc     r31, r17
2532      db8:       80 81           ld      r24, Z
2533      dba:       88 23           and     r24, r24
2534      dbc:       19 f0           breq    .+6             ; 0xdc4 <ParseCommand+0x8a>
2535      dbe:       b9 e0           ldi     r27, 0x09       ; 9
2536      dc0:       bc 15           cp      r27, r12
2537      dc2:       b8 f6           brcc    .-82            ; 0xd72 <ParseCommand+0x38>
2538         USART_printf("\r\n");
2539      dc4:       00 d0           rcall   .+0             ; 0xdc6 <ParseCommand+0x8c>
2540      dc6:       80 e8           ldi     r24, 0x80       ; 128
2541      dc8:       91 e0           ldi     r25, 0x01       ; 1
2542      dca:       ed b7           in      r30, 0x3d       ; 61
2543      dcc:       fe b7           in      r31, 0x3e       ; 62
2544      dce:       92 83           std     Z+2, r25        ; 0x02
2545      dd0:       81 83           std     Z+1, r24        ; 0x01
2546      dd2:       bd d2           rcall   .+1402          ; 0x134e <USART_printf>
2547         if (arg[i-1] != '\0')
2548      dd4:       fe 01           movw    r30, r28
2549      dd6:       31 96           adiw    r30, 0x01       ; 1
2550      dd8:       0e 0f           add     r16, r30
2551      dda:       1f 1f           adc     r17, r31
2552      ddc:       0f 90           pop     r0
2553      dde:       0f 90           pop     r0
2554      de0:       d8 01           movw    r26, r16
2555      de2:       8c 91           ld      r24, X
2556      de4:       88 23           and     r24, r24
2557      de6:       69 f0           breq    .+26            ; 0xe02 <ParseCommand+0xc8>
2558         {
2559                 LCD_puts("?");
2560      de8:       83 e8           ldi     r24, 0x83       ; 131
2561      dea:       91 e0           ldi     r25, 0x01       ; 1
2562      dec:       9c de           rcall   .-712           ; 0xb26 <LCD_puts>
2563                 USART_printf("?\r\n");
2564      dee:       00 d0           rcall   .+0             ; 0xdf0 <ParseCommand+0xb6>
2565      df0:       85 e8           ldi     r24, 0x85       ; 133
2566      df2:       91 e0           ldi     r25, 0x01       ; 1
2567      df4:       ed b7           in      r30, 0x3d       ; 61
2568      df6:       fe b7           in      r31, 0x3e       ; 62
2569      df8:       92 83           std     Z+2, r25        ; 0x02
2570      dfa:       81 83           std     Z+1, r24        ; 0x01
2571      dfc:       a8 d2           rcall   .+1360          ; 0x134e <USART_printf>
2572      dfe:       8f ef           ldi     r24, 0xFF       ; 255
2573      e00:       47 c0           rjmp    .+142           ; 0xe90 <ParseCommand+0x156>
2574                 return 255;
2575         }
2576
2577         arg[i] = '\0';
2578      e02:       ee 0d           add     r30, r14
2579      e04:       ff 1d           adc     r31, r15
2580      e06:       10 82           st      Z, r1
2581         
2582
2583         command funct = NULL;
2584                 
2585         switch (c)
2586      e08:       f4 e6           ldi     r31, 0x64       ; 100
2587      e0a:       df 16           cp      r13, r31
2588      e0c:       11 f1           breq    .+68            ; 0xe52 <ParseCommand+0x118>
2589      e0e:       fd 15           cp      r31, r13
2590      e10:       50 f0           brcs    .+20            ; 0xe26 <ParseCommand+0xec>
2591      e12:       81 e2           ldi     r24, 0x21       ; 33
2592      e14:       d8 16           cp      r13, r24
2593      e16:       49 f1           breq    .+82            ; 0xe6a <ParseCommand+0x130>
2594      e18:       a1 e6           ldi     r26, 0x61       ; 97
2595      e1a:       da 16           cp      r13, r26
2596      e1c:       19 f1           breq    .+70            ; 0xe64 <ParseCommand+0x12a>
2597      e1e:       bd e0           ldi     r27, 0x0D       ; 13
2598      e20:       db 16           cp      r13, r27
2599      e22:       51 f5           brne    .+84            ; 0xe78 <ParseCommand+0x13e>
2600      e24:       10 c0           rjmp    .+32            ; 0xe46 <ParseCommand+0x10c>
2601      e26:       e2 e7           ldi     r30, 0x72       ; 114
2602      e28:       de 16           cp      r13, r30
2603      e2a:       69 f0           breq    .+26            ; 0xe46 <ParseCommand+0x10c>
2604      e2c:       ed 15           cp      r30, r13
2605      e2e:       20 f0           brcs    .+8             ; 0xe38 <ParseCommand+0xfe>
2606      e30:       f0 e7           ldi     r31, 0x70       ; 112
2607      e32:       df 16           cp      r13, r31
2608      e34:       09 f5           brne    .+66            ; 0xe78 <ParseCommand+0x13e>
2609      e36:       0a c0           rjmp    .+20            ; 0xe4c <ParseCommand+0x112>
2610      e38:       84 e7           ldi     r24, 0x74       ; 116
2611      e3a:       d8 16           cp      r13, r24
2612      e3c:       69 f0           breq    .+26            ; 0xe58 <ParseCommand+0x11e>
2613      e3e:       a7 e7           ldi     r26, 0x77       ; 119
2614      e40:       da 16           cp      r13, r26
2615      e42:       d1 f4           brne    .+52            ; 0xe78 <ParseCommand+0x13e>
2616      e44:       0c c0           rjmp    .+24            ; 0xe5e <ParseCommand+0x124>
2617      e46:       e4 e0           ldi     r30, 0x04       ; 4
2618      e48:       f3 e0           ldi     r31, 0x03       ; 3
2619      e4a:       11 c0           rjmp    .+34            ; 0xe6e <ParseCommand+0x134>
2620      e4c:       ee ea           ldi     r30, 0xAE       ; 174
2621      e4e:       f3 e0           ldi     r31, 0x03       ; 3
2622      e50:       0e c0           rjmp    .+28            ; 0xe6e <ParseCommand+0x134>
2623                 case 'r':
2624                         funct = &read_adc;
2625                         break;
2626                 case 'p':
2627                         funct = &poll_adc;
2628                         break;
2629      e52:       e6 ed           ldi     r30, 0xD6       ; 214
2630      e54:       f2 e0           ldi     r31, 0x02       ; 2
2631      e56:       0b c0           rjmp    .+22            ; 0xe6e <ParseCommand+0x134>
2632                 case 'd':
2633                         funct = &set_dac;
2634                         break;
2635      e58:       e3 e6           ldi     r30, 0x63       ; 99
2636      e5a:       f2 e0           ldi     r31, 0x02       ; 2
2637      e5c:       08 c0           rjmp    .+16            ; 0xe6e <ParseCommand+0x134>
2638                 case 't':
2639                         funct = &set_timeout;
2640                         break;
2641      e5e:       e6 e3           ldi     r30, 0x36       ; 54
2642      e60:       f2 e0           ldi     r31, 0x02       ; 2
2643      e62:       05 c0           rjmp    .+10            ; 0xe6e <ParseCommand+0x134>
2644                 case 'w':
2645                         funct = &set_delay;
2646                         break;
2647      e64:       e9 ea           ldi     r30, 0xA9       ; 169
2648      e66:       f2 e0           ldi     r31, 0x02       ; 2
2649      e68:       02 c0           rjmp    .+4             ; 0xe6e <ParseCommand+0x134>
2650                 case 'a':
2651                         funct = &set_averages;
2652                         break;
2653      e6a:       e3 e3           ldi     r30, 0x33       ; 51
2654      e6c:       f2 e0           ldi     r31, 0x02       ; 2
2655                         break;
2656                 default:
2657                         break;
2658         }
2659
2660         if (funct == NULL || funct(arg) != 0)
2661      e6e:       ce 01           movw    r24, r28
2662      e70:       01 96           adiw    r24, 0x01       ; 1
2663      e72:       09 95           icall
2664      e74:       88 23           and     r24, r24
2665      e76:       71 f0           breq    .+28            ; 0xe94 <ParseCommand+0x15a>
2666         {
2667                 LCD_puts("?");
2668      e78:       83 e8           ldi     r24, 0x83       ; 131
2669      e7a:       91 e0           ldi     r25, 0x01       ; 1
2670      e7c:       54 de           rcall   .-856           ; 0xb26 <LCD_puts>
2671                 USART_printf("?\r\n");
2672      e7e:       00 d0           rcall   .+0             ; 0xe80 <ParseCommand+0x146>
2673      e80:       85 e8           ldi     r24, 0x85       ; 133
2674      e82:       91 e0           ldi     r25, 0x01       ; 1
2675      e84:       ed b7           in      r30, 0x3d       ; 61
2676      e86:       fe b7           in      r31, 0x3e       ; 62
2677      e88:       92 83           std     Z+2, r25        ; 0x02
2678      e8a:       81 83           std     Z+1, r24        ; 0x01
2679      e8c:       60 d2           rcall   .+1216          ; 0x134e <USART_printf>
2680      e8e:       8e ef           ldi     r24, 0xFE       ; 254
2681      e90:       0f 90           pop     r0
2682      e92:       0f 90           pop     r0
2683                 return 254;
2684         }
2685         return 0;
2686 }
2687      e94:       2a 96           adiw    r28, 0x0a       ; 10
2688      e96:       0f b6           in      r0, 0x3f        ; 63
2689      e98:       f8 94           cli
2690      e9a:       de bf           out     0x3e, r29       ; 62
2691      e9c:       0f be           out     0x3f, r0        ; 63
2692      e9e:       cd bf           out     0x3d, r28       ; 61
2693      ea0:       cf 91           pop     r28
2694      ea2:       df 91           pop     r29
2695      ea4:       1f 91           pop     r17
2696      ea6:       0f 91           pop     r16
2697      ea8:       ff 90           pop     r15
2698      eaa:       ef 90           pop     r14
2699      eac:       df 90           pop     r13
2700      eae:       cf 90           pop     r12
2701      eb0:       bf 90           pop     r11
2702      eb2:       af 90           pop     r10
2703      eb4:       08 95           ret
2704
2705 00000eb6 <luint2str>:
2706  */
2707
2708 //#include <math.h> // Needed for modf
2709
2710 int luint2str(char * str, uint32 integer)
2711 {
2712      eb6:       6f 92           push    r6
2713      eb8:       7f 92           push    r7
2714      eba:       8f 92           push    r8
2715      ebc:       9f 92           push    r9
2716      ebe:       af 92           push    r10
2717      ec0:       bf 92           push    r11
2718      ec2:       cf 92           push    r12
2719      ec4:       df 92           push    r13
2720      ec6:       ef 92           push    r14
2721      ec8:       ff 92           push    r15
2722      eca:       0f 93           push    r16
2723      ecc:       1f 93           push    r17
2724      ece:       cf 93           push    r28
2725      ed0:       df 93           push    r29
2726      ed2:       3c 01           movw    r6, r24
2727      ed4:       5a 01           movw    r10, r20
2728      ed6:       6b 01           movw    r12, r22
2729         uint8 base = 10;
2730
2731         if (integer == 0)
2732      ed8:       41 15           cp      r20, r1
2733      eda:       51 05           cpc     r21, r1
2734      edc:       61 05           cpc     r22, r1
2735      ede:       71 05           cpc     r23, r1
2736      ee0:       19 f0           breq    .+6             ; 0xee8 <luint2str+0x32>
2737      ee2:       80 e0           ldi     r24, 0x00       ; 0
2738      ee4:       90 e0           ldi     r25, 0x00       ; 0
2739      ee6:       1e c0           rjmp    .+60            ; 0xf24 <luint2str+0x6e>
2740         {
2741                 str[0] = '0';
2742      ee8:       80 e3           ldi     r24, 0x30       ; 48
2743      eea:       f3 01           movw    r30, r6
2744      eec:       80 83           st      Z, r24
2745                 str[1] = '\0';
2746      eee:       11 82           std     Z+1, r1 ; 0x01
2747      ef0:       41 e0           ldi     r20, 0x01       ; 1
2748      ef2:       50 e0           ldi     r21, 0x00       ; 0
2749      ef4:       3b c0           rjmp    .+118           ; 0xf6c <luint2str+0xb6>
2750         int i = 0;
2751         
2752         uint remainder;
2753         while (integer >= base)
2754         {
2755                 remainder = integer % base;
2756      ef6:       c6 01           movw    r24, r12
2757      ef8:       b5 01           movw    r22, r10
2758      efa:       2a e0           ldi     r18, 0x0A       ; 10
2759      efc:       30 e0           ldi     r19, 0x00       ; 0
2760      efe:       40 e0           ldi     r20, 0x00       ; 0
2761      f00:       50 e0           ldi     r21, 0x00       ; 0
2762      f02:       0b d5           rcall   .+2582          ; 0x191a <__udivmodsi4>
2763      f04:       7b 01           movw    r14, r22
2764      f06:       8c 01           movw    r16, r24
2765                 integer = integer / base;
2766      f08:       c6 01           movw    r24, r12
2767      f0a:       b5 01           movw    r22, r10
2768      f0c:       2a e0           ldi     r18, 0x0A       ; 10
2769      f0e:       30 e0           ldi     r19, 0x00       ; 0
2770      f10:       40 e0           ldi     r20, 0x00       ; 0
2771      f12:       50 e0           ldi     r21, 0x00       ; 0
2772      f14:       02 d5           rcall   .+2564          ; 0x191a <__udivmodsi4>
2773      f16:       59 01           movw    r10, r18
2774      f18:       6a 01           movw    r12, r20
2775                 str[i] = (char)((uint)'0' + remainder);
2776      f1a:       f0 e3           ldi     r31, 0x30       ; 48
2777      f1c:       ef 0e           add     r14, r31
2778      f1e:       f4 01           movw    r30, r8
2779      f20:       e0 82           st      Z, r14
2780                 ++i;
2781      f22:       ce 01           movw    r24, r28
2782      f24:       43 01           movw    r8, r6
2783      f26:       88 0e           add     r8, r24
2784      f28:       99 1e           adc     r9, r25
2785      f2a:       ec 01           movw    r28, r24
2786      f2c:       21 96           adiw    r28, 0x01       ; 1
2787         }
2788         
2789         int i = 0;
2790         
2791         uint remainder;
2792         while (integer >= base)
2793      f2e:       fa e0           ldi     r31, 0x0A       ; 10
2794      f30:       af 16           cp      r10, r31
2795      f32:       b1 04           cpc     r11, r1
2796      f34:       c1 04           cpc     r12, r1
2797      f36:       d1 04           cpc     r13, r1
2798      f38:       f0 f6           brcc    .-68            ; 0xef6 <luint2str+0x40>
2799                 ++i;
2800         }
2801
2802         if (integer != 0)
2803         {
2804                 str[i] = (char)((uint)'0' + integer);
2805      f3a:       8a 2d           mov     r24, r10
2806      f3c:       80 5d           subi    r24, 0xD0       ; 208
2807      f3e:       f4 01           movw    r30, r8
2808      f40:       80 83           st      Z, r24
2809                 ++i;
2810      f42:       ae 01           movw    r20, r28
2811         }
2812
2813         //reverse the string
2814         for (int j = 0; j < i/2; ++j)
2815      f44:       be 01           movw    r22, r28
2816      f46:       75 95           asr     r23
2817      f48:       67 95           ror     r22
2818      f4a:       d3 01           movw    r26, r6
2819      f4c:       20 e0           ldi     r18, 0x00       ; 0
2820      f4e:       30 e0           ldi     r19, 0x00       ; 0
2821      f50:       07 c0           rjmp    .+14            ; 0xf60 <luint2str+0xaa>
2822         {
2823                 char t = str[j];
2824      f52:       9c 91           ld      r25, X
2825                 str[j] = str[i - 1 - j];
2826      f54:       80 81           ld      r24, Z
2827      f56:       8d 93           st      X+, r24
2828                 str[i -1 - j] = t;
2829      f58:       90 83           st      Z, r25
2830                 str[i] = (char)((uint)'0' + integer);
2831                 ++i;
2832         }
2833
2834         //reverse the string
2835         for (int j = 0; j < i/2; ++j)
2836      f5a:       2f 5f           subi    r18, 0xFF       ; 255
2837      f5c:       3f 4f           sbci    r19, 0xFF       ; 255
2838      f5e:       31 97           sbiw    r30, 0x01       ; 1
2839      f60:       26 17           cp      r18, r22
2840      f62:       37 07           cpc     r19, r23
2841      f64:       b4 f3           brlt    .-20            ; 0xf52 <luint2str+0x9c>
2842         {
2843                 char t = str[j];
2844                 str[j] = str[i - 1 - j];
2845                 str[i -1 - j] = t;
2846         }
2847         str[i] = '\0';
2848      f66:       c6 0d           add     r28, r6
2849      f68:       d7 1d           adc     r29, r7
2850      f6a:       18 82           st      Y, r1
2851         return i;
2852
2853
2854 }
2855      f6c:       ca 01           movw    r24, r20
2856      f6e:       df 91           pop     r29
2857      f70:       cf 91           pop     r28
2858      f72:       1f 91           pop     r17
2859      f74:       0f 91           pop     r16
2860      f76:       ff 90           pop     r15
2861      f78:       ef 90           pop     r14
2862      f7a:       df 90           pop     r13
2863      f7c:       cf 90           pop     r12
2864      f7e:       bf 90           pop     r11
2865      f80:       af 90           pop     r10
2866      f82:       9f 90           pop     r9
2867      f84:       8f 90           pop     r8
2868      f86:       7f 90           pop     r7
2869      f88:       6f 90           pop     r6
2870      f8a:       08 95           ret
2871
2872 00000f8c <uint2str>:
2873
2874 int uint2str(char * str, uint integer)
2875 {
2876      f8c:       ef 92           push    r14
2877      f8e:       ff 92           push    r15
2878      f90:       0f 93           push    r16
2879      f92:       1f 93           push    r17
2880      f94:       cf 93           push    r28
2881      f96:       df 93           push    r29
2882      f98:       7c 01           movw    r14, r24
2883      f9a:       fb 01           movw    r30, r22
2884         uint8 base = 10;
2885
2886         if (integer == 0)
2887      f9c:       61 15           cp      r22, r1
2888      f9e:       71 05           cpc     r23, r1
2889      fa0:       19 f0           breq    .+6             ; 0xfa8 <uint2str+0x1c>
2890      fa2:       80 e0           ldi     r24, 0x00       ; 0
2891      fa4:       90 e0           ldi     r25, 0x00       ; 0
2892      fa6:       16 c0           rjmp    .+44            ; 0xfd4 <uint2str+0x48>
2893         {
2894                 str[0] = '0';
2895      fa8:       80 e3           ldi     r24, 0x30       ; 48
2896      faa:       d7 01           movw    r26, r14
2897      fac:       8c 93           st      X, r24
2898                 str[1] = '\0';
2899      fae:       11 96           adiw    r26, 0x01       ; 1
2900      fb0:       1c 92           st      X, r1
2901      fb2:       41 e0           ldi     r20, 0x01       ; 1
2902      fb4:       50 e0           ldi     r21, 0x00       ; 0
2903      fb6:       2f c0           rjmp    .+94            ; 0x1016 <uint2str+0x8a>
2904         int i = 0;
2905         
2906         uint remainder;
2907         while (integer >= base)
2908         {
2909                 remainder = integer % base;
2910      fb8:       cf 01           movw    r24, r30
2911      fba:       6a e0           ldi     r22, 0x0A       ; 10
2912      fbc:       70 e0           ldi     r23, 0x00       ; 0
2913      fbe:       86 d4           rcall   .+2316          ; 0x18cc <__udivmodhi4>
2914      fc0:       9c 01           movw    r18, r24
2915                 integer = integer / base;
2916      fc2:       cf 01           movw    r24, r30
2917      fc4:       6a e0           ldi     r22, 0x0A       ; 10
2918      fc6:       70 e0           ldi     r23, 0x00       ; 0
2919      fc8:       81 d4           rcall   .+2306          ; 0x18cc <__udivmodhi4>
2920      fca:       fb 01           movw    r30, r22
2921                 str[i] = (char)((uint)'0' + remainder);
2922      fcc:       20 5d           subi    r18, 0xD0       ; 208
2923      fce:       d8 01           movw    r26, r16
2924      fd0:       2c 93           st      X, r18
2925                 ++i;
2926      fd2:       ce 01           movw    r24, r28
2927      fd4:       87 01           movw    r16, r14
2928      fd6:       08 0f           add     r16, r24
2929      fd8:       19 1f           adc     r17, r25
2930      fda:       ec 01           movw    r28, r24
2931      fdc:       21 96           adiw    r28, 0x01       ; 1
2932         }
2933         
2934         int i = 0;
2935         
2936         uint remainder;
2937         while (integer >= base)
2938      fde:       ea 30           cpi     r30, 0x0A       ; 10
2939      fe0:       f1 05           cpc     r31, r1
2940      fe2:       50 f7           brcc    .-44            ; 0xfb8 <uint2str+0x2c>
2941                 ++i;
2942         }
2943
2944         if (integer != 0)
2945         {
2946                 str[i] = (char)((uint)'0' + integer);
2947      fe4:       8e 2f           mov     r24, r30
2948      fe6:       80 5d           subi    r24, 0xD0       ; 208
2949      fe8:       f8 01           movw    r30, r16
2950      fea:       80 83           st      Z, r24
2951                 ++i;
2952      fec:       ae 01           movw    r20, r28
2953         }
2954
2955         //reverse the string
2956         for (int j = 0; j < i/2; ++j)
2957      fee:       be 01           movw    r22, r28
2958      ff0:       75 95           asr     r23
2959      ff2:       67 95           ror     r22
2960      ff4:       d7 01           movw    r26, r14
2961      ff6:       20 e0           ldi     r18, 0x00       ; 0
2962      ff8:       30 e0           ldi     r19, 0x00       ; 0
2963      ffa:       07 c0           rjmp    .+14            ; 0x100a <uint2str+0x7e>
2964         {
2965                 char t = str[j];
2966      ffc:       9c 91           ld      r25, X
2967                 str[j] = str[i - 1 - j];
2968      ffe:       80 81           ld      r24, Z
2969     1000:       8d 93           st      X+, r24
2970                 str[i -1 - j] = t;
2971     1002:       90 83           st      Z, r25
2972                 str[i] = (char)((uint)'0' + integer);
2973                 ++i;
2974         }
2975
2976         //reverse the string
2977         for (int j = 0; j < i/2; ++j)
2978     1004:       2f 5f           subi    r18, 0xFF       ; 255
2979     1006:       3f 4f           sbci    r19, 0xFF       ; 255
2980     1008:       31 97           sbiw    r30, 0x01       ; 1
2981     100a:       26 17           cp      r18, r22
2982     100c:       37 07           cpc     r19, r23
2983     100e:       b4 f3           brlt    .-20            ; 0xffc <uint2str+0x70>
2984         {
2985                 char t = str[j];
2986                 str[j] = str[i - 1 - j];
2987                 str[i -1 - j] = t;
2988         }
2989         str[i] = '\0';
2990     1010:       ce 0d           add     r28, r14
2991     1012:       df 1d           adc     r29, r15
2992     1014:       18 82           st      Y, r1
2993         return i;
2994
2995
2996 }
2997     1016:       ca 01           movw    r24, r20
2998     1018:       df 91           pop     r29
2999     101a:       cf 91           pop     r28
3000     101c:       1f 91           pop     r17
3001     101e:       0f 91           pop     r16
3002     1020:       ff 90           pop     r15
3003     1022:       ef 90           pop     r14
3004     1024:       08 95           ret
3005
3006 00001026 <int2str>:
3007
3008 int int2str(char * str, int integer)
3009 {
3010     1026:       cf 92           push    r12
3011     1028:       df 92           push    r13
3012     102a:       ef 92           push    r14
3013     102c:       ff 92           push    r15
3014     102e:       0f 93           push    r16
3015     1030:       1f 93           push    r17
3016     1032:       cf 93           push    r28
3017     1034:       df 93           push    r29
3018     1036:       ec 01           movw    r28, r24
3019     1038:       8b 01           movw    r16, r22
3020         uint8 base = 10;
3021
3022         if (integer == 0)
3023     103a:       61 15           cp      r22, r1
3024     103c:       71 05           cpc     r23, r1
3025     103e:       21 f0           breq    .+8             ; 0x1048 <int2str+0x22>
3026     1040:       fb 01           movw    r30, r22
3027     1042:       80 e0           ldi     r24, 0x00       ; 0
3028     1044:       90 e0           ldi     r25, 0x00       ; 0
3029     1046:       14 c0           rjmp    .+40            ; 0x1070 <int2str+0x4a>
3030         {
3031                 str[0] = '0';
3032     1048:       80 e3           ldi     r24, 0x30       ; 48
3033     104a:       88 83           st      Y, r24
3034                 str[1] = '\0';
3035     104c:       19 82           std     Y+1, r1 ; 0x01
3036     104e:       21 e0           ldi     r18, 0x01       ; 1
3037     1050:       30 e0           ldi     r19, 0x00       ; 0
3038     1052:       3b c0           rjmp    .+118           ; 0x10ca <int2str+0xa4>
3039         int i = 0;
3040         
3041         uint remainder;
3042         while (integer >= base)
3043         {
3044                 remainder = integer % base;
3045     1054:       cf 01           movw    r24, r30
3046     1056:       6a e0           ldi     r22, 0x0A       ; 10
3047     1058:       70 e0           ldi     r23, 0x00       ; 0
3048     105a:       4c d4           rcall   .+2200          ; 0x18f4 <__divmodhi4>
3049     105c:       9c 01           movw    r18, r24
3050                 integer = integer / base;
3051     105e:       cf 01           movw    r24, r30
3052     1060:       6a e0           ldi     r22, 0x0A       ; 10
3053     1062:       70 e0           ldi     r23, 0x00       ; 0
3054     1064:       47 d4           rcall   .+2190          ; 0x18f4 <__divmodhi4>
3055     1066:       fb 01           movw    r30, r22
3056                 str[i] = (char)((uint)'0' + remainder);
3057     1068:       20 5d           subi    r18, 0xD0       ; 208
3058     106a:       d7 01           movw    r26, r14
3059     106c:       2c 93           st      X, r18
3060                 ++i;
3061     106e:       c6 01           movw    r24, r12
3062     1070:       7e 01           movw    r14, r28
3063     1072:       e8 0e           add     r14, r24
3064     1074:       f9 1e           adc     r15, r25
3065     1076:       6c 01           movw    r12, r24
3066     1078:       08 94           sec
3067     107a:       c1 1c           adc     r12, r1
3068     107c:       d1 1c           adc     r13, r1
3069                 negative = TRUE;
3070         
3071         int i = 0;
3072         
3073         uint remainder;
3074         while (integer >= base)
3075     107e:       ea 30           cpi     r30, 0x0A       ; 10
3076     1080:       f1 05           cpc     r31, r1
3077     1082:       44 f7           brge    .-48            ; 0x1054 <int2str+0x2e>
3078                 ++i;
3079         }
3080
3081         if (integer != 0)
3082         {
3083                 str[i] = (char)((uint)'0' + integer);
3084     1084:       8e 2f           mov     r24, r30
3085     1086:       80 5d           subi    r24, 0xD0       ; 208
3086     1088:       f7 01           movw    r30, r14
3087     108a:       80 83           st      Z, r24
3088                 ++i;
3089     108c:       96 01           movw    r18, r12
3090         }
3091
3092         if (negative == TRUE)
3093     108e:       17 ff           sbrs    r17, 7
3094     1090:       07 c0           rjmp    .+14            ; 0x10a0 <int2str+0x7a>
3095         {
3096                 str[i] = '-';
3097     1092:       fe 01           movw    r30, r28
3098     1094:       ec 0d           add     r30, r12
3099     1096:       fd 1d           adc     r31, r13
3100     1098:       8d e2           ldi     r24, 0x2D       ; 45
3101     109a:       80 83           st      Z, r24
3102                 ++i;
3103     109c:       2f 5f           subi    r18, 0xFF       ; 255
3104     109e:       3f 4f           sbci    r19, 0xFF       ; 255
3105
3106         }
3107
3108         //reverse the string
3109         for (int j = 0; j < i/2; ++j)
3110     10a0:       b9 01           movw    r22, r18
3111     10a2:       75 95           asr     r23
3112     10a4:       67 95           ror     r22
3113     10a6:       fe 01           movw    r30, r28
3114
3115
3116 }
3117
3118 int int2str(char * str, int integer)
3119 {
3120     10a8:       c2 0f           add     r28, r18
3121     10aa:       d3 1f           adc     r29, r19
3122     10ac:       de 01           movw    r26, r28
3123     10ae:       40 e0           ldi     r20, 0x00       ; 0
3124     10b0:       50 e0           ldi     r21, 0x00       ; 0
3125     10b2:       06 c0           rjmp    .+12            ; 0x10c0 <int2str+0x9a>
3126         }
3127
3128         //reverse the string
3129         for (int j = 0; j < i/2; ++j)
3130         {
3131                 char t = str[j];
3132     10b4:       90 81           ld      r25, Z
3133                 str[j] = str[i - 1 - j];
3134     10b6:       8c 91           ld      r24, X
3135     10b8:       81 93           st      Z+, r24
3136                 str[i -1 - j] = t;
3137     10ba:       9c 93           st      X, r25
3138                 ++i;
3139
3140         }
3141
3142         //reverse the string
3143         for (int j = 0; j < i/2; ++j)
3144     10bc:       4f 5f           subi    r20, 0xFF       ; 255
3145     10be:       5f 4f           sbci    r21, 0xFF       ; 255
3146     10c0:       11 97           sbiw    r26, 0x01       ; 1
3147     10c2:       46 17           cp      r20, r22
3148     10c4:       57 07           cpc     r21, r23
3149     10c6:       b4 f3           brlt    .-20            ; 0x10b4 <int2str+0x8e>
3150         {
3151                 char t = str[j];
3152                 str[j] = str[i - 1 - j];
3153                 str[i -1 - j] = t;
3154         }
3155         str[i] = '\0';
3156     10c8:       18 82           st      Y, r1
3157         return i;
3158
3159
3160 }
3161     10ca:       c9 01           movw    r24, r18
3162     10cc:       df 91           pop     r29
3163     10ce:       cf 91           pop     r28
3164     10d0:       1f 91           pop     r17
3165     10d2:       0f 91           pop     r16
3166     10d4:       ff 90           pop     r15
3167     10d6:       ef 90           pop     r14
3168     10d8:       df 90           pop     r13
3169     10da:       cf 90           pop     r12
3170     10dc:       08 95           ret
3171
3172 000010de <float2str>:
3173
3174 int float2str(char * str, float flt)
3175 {
3176     10de:       6f 92           push    r6
3177     10e0:       7f 92           push    r7
3178     10e2:       8f 92           push    r8
3179     10e4:       9f 92           push    r9
3180     10e6:       af 92           push    r10
3181     10e8:       bf 92           push    r11
3182     10ea:       cf 92           push    r12
3183     10ec:       df 92           push    r13
3184     10ee:       ef 92           push    r14
3185     10f0:       ff 92           push    r15
3186     10f2:       0f 93           push    r16
3187     10f4:       1f 93           push    r17
3188     10f6:       5c 01           movw    r10, r24
3189     10f8:       3a 01           movw    r6, r20
3190     10fa:       4b 01           movw    r8, r22
3191         int places = 100;
3192
3193         int intpart = (int)(flt);
3194     10fc:       cb 01           movw    r24, r22
3195     10fe:       ba 01           movw    r22, r20
3196     1100:       29 d2           rcall   .+1106          ; 0x1554 <__fixsfsi>
3197     1102:       9b 01           movw    r18, r22
3198     1104:       ac 01           movw    r20, r24
3199     1106:       7b 01           movw    r14, r22
3200         double decpart = flt - (double)(intpart);
3201         int s = int2str(str, intpart);
3202     1108:       c5 01           movw    r24, r10
3203     110a:       b9 01           movw    r22, r18
3204     110c:       8c df           rcall   .-232           ; 0x1026 <int2str>
3205     110e:       6c 01           movw    r12, r24
3206
3207         str[s] = '.';
3208     1110:       f5 01           movw    r30, r10
3209     1112:       e8 0f           add     r30, r24
3210     1114:       f9 1f           adc     r31, r25
3211     1116:       8e e2           ldi     r24, 0x2E       ; 46
3212     1118:       80 83           st      Z, r24
3213         ++s;
3214     111a:       08 94           sec
3215     111c:       c1 1c           adc     r12, r1
3216     111e:       d1 1c           adc     r13, r1
3217         s += int2str(str+s, (int)(decpart*places));
3218     1120:       ac 0c           add     r10, r12
3219     1122:       bd 1c           adc     r11, r13
3220     1124:       00 27           eor     r16, r16
3221     1126:       f7 fc           sbrc    r15, 7
3222     1128:       00 95           com     r16
3223     112a:       10 2f           mov     r17, r16
3224     112c:       c8 01           movw    r24, r16
3225     112e:       b7 01           movw    r22, r14
3226     1130:       44 d2           rcall   .+1160          ; 0x15ba <__floatsisf>
3227     1132:       9b 01           movw    r18, r22
3228     1134:       ac 01           movw    r20, r24
3229     1136:       c4 01           movw    r24, r8
3230     1138:       b3 01           movw    r22, r6
3231     113a:       3b d1           rcall   .+630           ; 0x13b2 <__subsf3>
3232     113c:       20 e0           ldi     r18, 0x00       ; 0
3233     113e:       30 e0           ldi     r19, 0x00       ; 0
3234     1140:       48 ec           ldi     r20, 0xC8       ; 200
3235     1142:       52 e4           ldi     r21, 0x42       ; 66
3236     1144:       ea d2           rcall   .+1492          ; 0x171a <__mulsf3>
3237     1146:       06 d2           rcall   .+1036          ; 0x1554 <__fixsfsi>
3238     1148:       9b 01           movw    r18, r22
3239     114a:       ac 01           movw    r20, r24
3240     114c:       c5 01           movw    r24, r10
3241     114e:       b9 01           movw    r22, r18
3242     1150:       6a df           rcall   .-300           ; 0x1026 <int2str>
3243         return s;
3244
3245 }
3246     1152:       8c 0d           add     r24, r12
3247     1154:       9d 1d           adc     r25, r13
3248     1156:       1f 91           pop     r17
3249     1158:       0f 91           pop     r16
3250     115a:       ff 90           pop     r15
3251     115c:       ef 90           pop     r14
3252     115e:       df 90           pop     r13
3253     1160:       cf 90           pop     r12
3254     1162:       bf 90           pop     r11
3255     1164:       af 90           pop     r10
3256     1166:       9f 90           pop     r9
3257     1168:       8f 90           pop     r8
3258     116a:       7f 90           pop     r7
3259     116c:       6f 90           pop     r6
3260     116e:       08 95           ret
3261
3262 00001170 <str2str>:
3263
3264 int str2str(char * str1, char * str2)
3265 {
3266     1170:       9c 01           movw    r18, r24
3267     1172:       80 e0           ldi     r24, 0x00       ; 0
3268     1174:       90 e0           ldi     r25, 0x00       ; 0
3269     1176:       02 c0           rjmp    .+4             ; 0x117c <str2str+0xc>
3270         int i = 0;
3271         for (i = 0; str2[i] != '\0'; ++i)
3272         {
3273                 str1[i] = str2[i];
3274     1178:       ec 93           st      X, r30
3275 }
3276
3277 int str2str(char * str1, char * str2)
3278 {
3279         int i = 0;
3280         for (i = 0; str2[i] != '\0'; ++i)
3281     117a:       01 96           adiw    r24, 0x01       ; 1
3282     117c:       fb 01           movw    r30, r22
3283     117e:       e8 0f           add     r30, r24
3284     1180:       f9 1f           adc     r31, r25
3285     1182:       e0 81           ld      r30, Z
3286     1184:       d9 01           movw    r26, r18
3287     1186:       a8 0f           add     r26, r24
3288     1188:       b9 1f           adc     r27, r25
3289     118a:       ee 23           and     r30, r30
3290     118c:       a9 f7           brne    .-22            ; 0x1178 <str2str+0x8>
3291         {
3292                 str1[i] = str2[i];
3293         }
3294         str1[i] = '\0';
3295     118e:       1c 92           st      X, r1
3296         return i;
3297 }
3298     1190:       08 95           ret
3299
3300 00001192 <vsprintf>:
3301 {
3302         int s; int f;
3303         s = 0;
3304         for (f = 0; format[f] != '\0'; ++f)
3305         {
3306                 if (format[f] == '%')
3307     1192:       af 92           push    r10
3308     1194:       bf 92           push    r11
3309     1196:       cf 92           push    r12
3310     1198:       df 92           push    r13
3311     119a:       ef 92           push    r14
3312     119c:       ff 92           push    r15
3313     119e:       0f 93           push    r16
3314     11a0:       1f 93           push    r17
3315     11a2:       cf 93           push    r28
3316     11a4:       df 93           push    r29
3317     11a6:       7c 01           movw    r14, r24
3318     11a8:       5b 01           movw    r10, r22
3319     11aa:       da 01           movw    r26, r20
3320     11ac:       c0 e0           ldi     r28, 0x00       ; 0
3321     11ae:       d0 e0           ldi     r29, 0x00       ; 0
3322     11b0:       cc 24           eor     r12, r12
3323     11b2:       dd 24           eor     r13, r13
3324     11b4:       5a c0           rjmp    .+180           ; 0x126a <vsprintf+0xd8>
3325     11b6:       85 32           cpi     r24, 0x25       ; 37
3326     11b8:       09 f0           breq    .+2             ; 0x11bc <vsprintf+0x2a>
3327     11ba:       4f c0           rjmp    .+158           ; 0x125a <vsprintf+0xc8>
3328                 {
3329                         switch (format[f+1])
3330     11bc:       81 81           ldd     r24, Z+1        ; 0x01
3331     11be:       89 36           cpi     r24, 0x69       ; 105
3332     11c0:       91 f0           breq    .+36            ; 0x11e6 <vsprintf+0x54>
3333     11c2:       8a 36           cpi     r24, 0x6A       ; 106
3334     11c4:       38 f4           brcc    .+14            ; 0x11d4 <vsprintf+0x42>
3335     11c6:       84 36           cpi     r24, 0x64       ; 100
3336     11c8:       71 f0           breq    .+28            ; 0x11e6 <vsprintf+0x54>
3337     11ca:       86 36           cpi     r24, 0x66       ; 102
3338     11cc:       79 f1           breq    .+94            ; 0x122c <vsprintf+0x9a>
3339     11ce:       83 36           cpi     r24, 0x63       ; 99
3340     11d0:       39 f4           brne    .+14            ; 0x11e0 <vsprintf+0x4e>
3341     11d2:       38 c0           rjmp    .+112           ; 0x1244 <vsprintf+0xb2>
3342     11d4:       83 37           cpi     r24, 0x73       ; 115
3343     11d6:       01 f1           breq    .+64            ; 0x1218 <vsprintf+0x86>
3344     11d8:       85 37           cpi     r24, 0x75       ; 117
3345     11da:       29 f0           breq    .+10            ; 0x11e6 <vsprintf+0x54>
3346     11dc:       8c 36           cpi     r24, 0x6C       ; 108
3347     11de:       69 f0           breq    .+26            ; 0x11fa <vsprintf+0x68>
3348     11e0:       cf ef           ldi     r28, 0xFF       ; 255
3349     11e2:       df ef           ldi     r29, 0xFF       ; 255
3350     11e4:       4d c0           rjmp    .+154           ; 0x1280 <vsprintf+0xee>
3351                         {
3352                                 case 'd':
3353                                 case 'u':
3354                                 case 'i':
3355                                 {
3356                                         uint integer = va_arg(args, uint);
3357     11e6:       8d 01           movw    r16, r26
3358     11e8:       0e 5f           subi    r16, 0xFE       ; 254
3359     11ea:       1f 4f           sbci    r17, 0xFF       ; 255
3360                                         s += uint2str(str+s, integer);
3361     11ec:       6d 91           ld      r22, X+
3362     11ee:       7c 91           ld      r23, X
3363     11f0:       c7 01           movw    r24, r14
3364     11f2:       8c 0f           add     r24, r28
3365     11f4:       9d 1f           adc     r25, r29
3366     11f6:       ca de           rcall   .-620           ; 0xf8c <uint2str>
3367     11f8:       0b c0           rjmp    .+22            ; 0x1210 <vsprintf+0x7e>
3368                                         break;
3369                                 }
3370                                 case 'l':
3371                                 {
3372                                         uint32 integer = va_arg(args, uint32);
3373     11fa:       8d 01           movw    r16, r26
3374     11fc:       0c 5f           subi    r16, 0xFC       ; 252
3375     11fe:       1f 4f           sbci    r17, 0xFF       ; 255
3376                                         s += luint2str(str+s, integer);
3377     1200:       4d 91           ld      r20, X+
3378     1202:       5d 91           ld      r21, X+
3379     1204:       6d 91           ld      r22, X+
3380     1206:       7c 91           ld      r23, X
3381     1208:       c7 01           movw    r24, r14
3382     120a:       8c 0f           add     r24, r28
3383     120c:       9d 1f           adc     r25, r29
3384     120e:       53 de           rcall   .-858           ; 0xeb6 <luint2str>
3385     1210:       c8 0f           add     r28, r24
3386     1212:       d9 1f           adc     r29, r25
3387     1214:       d8 01           movw    r26, r16
3388     1216:       1d c0           rjmp    .+58            ; 0x1252 <vsprintf+0xc0>
3389                                         break;
3390                                 }
3391                                 case 's':
3392                                 {
3393                                         char * str2 = va_arg(args, char*);
3394     1218:       8d 01           movw    r16, r26
3395     121a:       0e 5f           subi    r16, 0xFE       ; 254
3396     121c:       1f 4f           sbci    r17, 0xFF       ; 255
3397                                         s += str2str(str+s, str2);
3398     121e:       6d 91           ld      r22, X+
3399     1220:       7c 91           ld      r23, X
3400     1222:       c7 01           movw    r24, r14
3401     1224:       8c 0f           add     r24, r28
3402     1226:       9d 1f           adc     r25, r29
3403     1228:       a3 df           rcall   .-186           ; 0x1170 <str2str>
3404     122a:       f2 cf           rjmp    .-28            ; 0x1210 <vsprintf+0x7e>
3405                                         
3406                                         break;
3407                                 }
3408                                 case 'f':
3409                                 {
3410                                         float flt = va_arg(args, double);
3411     122c:       8d 01           movw    r16, r26
3412     122e:       0c 5f           subi    r16, 0xFC       ; 252
3413     1230:       1f 4f           sbci    r17, 0xFF       ; 255
3414                                         s += float2str(str+s, flt);
3415     1232:       4d 91           ld      r20, X+
3416     1234:       5d 91           ld      r21, X+
3417     1236:       6d 91           ld      r22, X+
3418     1238:       7c 91           ld      r23, X
3419     123a:       c7 01           movw    r24, r14
3420     123c:       8c 0f           add     r24, r28
3421     123e:       9d 1f           adc     r25, r29
3422     1240:       4e df           rcall   .-356           ; 0x10de <float2str>
3423     1242:       e6 cf           rjmp    .-52            ; 0x1210 <vsprintf+0x7e>
3424                                         break;
3425                                 }
3426                                 case 'c':
3427                                         str[s] = (char)(va_arg(args, int));
3428     1244:       f7 01           movw    r30, r14
3429     1246:       ec 0f           add     r30, r28
3430     1248:       fd 1f           adc     r31, r29
3431     124a:       8c 91           ld      r24, X
3432     124c:       80 83           st      Z, r24
3433                                         ++s;
3434     124e:       21 96           adiw    r28, 0x01       ; 1
3435     1250:       12 96           adiw    r26, 0x02       ; 2
3436                                         break;
3437                                 case '\0':
3438                                 default:
3439                                         return -1;
3440                         }
3441                         ++f;
3442     1252:       08 94           sec
3443     1254:       c1 1c           adc     r12, r1
3444     1256:       d1 1c           adc     r13, r1
3445     1258:       05 c0           rjmp    .+10            ; 0x1264 <vsprintf+0xd2>
3446                 }
3447                 else
3448                 {
3449                         str[s] = format[f];
3450     125a:       f7 01           movw    r30, r14
3451     125c:       ec 0f           add     r30, r28
3452     125e:       fd 1f           adc     r31, r29
3453     1260:       80 83           st      Z, r24
3454                         ++s;
3455     1262:       21 96           adiw    r28, 0x01       ; 1
3456
3457 int vsprintf(char * str, const char * format, va_list args)
3458 {
3459         int s; int f;
3460         s = 0;
3461         for (f = 0; format[f] != '\0'; ++f)
3462     1264:       08 94           sec
3463     1266:       c1 1c           adc     r12, r1
3464     1268:       d1 1c           adc     r13, r1
3465     126a:       f5 01           movw    r30, r10
3466     126c:       ec 0d           add     r30, r12
3467     126e:       fd 1d           adc     r31, r13
3468     1270:       80 81           ld      r24, Z
3469     1272:       88 23           and     r24, r24
3470     1274:       09 f0           breq    .+2             ; 0x1278 <vsprintf+0xe6>
3471     1276:       9f cf           rjmp    .-194           ; 0x11b6 <vsprintf+0x24>
3472                 {
3473                         str[s] = format[f];
3474                         ++s;
3475                 }
3476         }
3477         str[s] = '\0';
3478     1278:       ec 0e           add     r14, r28
3479     127a:       fd 1e           adc     r15, r29
3480     127c:       f7 01           movw    r30, r14
3481     127e:       10 82           st      Z, r1
3482         return s;
3483 }
3484     1280:       ce 01           movw    r24, r28
3485     1282:       df 91           pop     r29
3486     1284:       cf 91           pop     r28
3487     1286:       1f 91           pop     r17
3488     1288:       0f 91           pop     r16
3489     128a:       ff 90           pop     r15
3490     128c:       ef 90           pop     r14
3491     128e:       df 90           pop     r13
3492     1290:       cf 90           pop     r12
3493     1292:       bf 90           pop     r11
3494     1294:       af 90           pop     r10
3495     1296:       08 95           ret
3496
3497 00001298 <Timer0_Init>:
3498 *****************************************************************************/
3499 void Timer0_Init(void)
3500 {
3501     //mt char i;
3502   //  uint8_t i;
3503         DDRB |= (1<<SCK);
3504     1298:       23 9a           sbi     0x04, 3 ; 4
3505
3506     // Initialize Timer0.
3507     // Used to give the correct time-delays in the song
3508
3509     // Enable timer0 compare interrupt
3510     TIMSK0 = (1<<OCIE0A);
3511     129a:       82 e0           ldi     r24, 0x02       ; 2
3512     129c:       80 93 6e 00     sts     0x006E, r24
3513
3514     // Sets the compare value
3515     OCR0A = 38;
3516     12a0:       86 e2           ldi     r24, 0x26       ; 38
3517     12a2:       87 bd           out     0x27, r24       ; 39
3518
3519     // Set Clear on Timer Compare (CTC) mode, CLK/256 prescaler
3520     TCCR0A = (1<<WGM01)|(0<<WGM00)|(4<<CS00);
3521     12a4:       8c e0           ldi     r24, 0x0C       ; 12
3522     12a6:       84 bd           out     0x24, r24       ; 36
3523 }
3524     12a8:       08 95           ret
3525
3526 000012aa <__vector_10>:
3527 // mtA
3528 // #pragma vector = TIMER0_COMP_vect
3529 // __interrupt void TIMER0_COMP_interrupt(void)
3530 // SIGNAL(SIG_OUTPUT_COMPARE0)
3531 ISR(TIMER0_COMP_vect)
3532 {
3533     12aa:       1f 92           push    r1
3534     12ac:       0f 92           push    r0
3535     12ae:       0f b6           in      r0, 0x3f        ; 63
3536     12b0:       0f 92           push    r0
3537     12b2:       11 24           eor     r1, r1
3538     12b4:       8f 93           push    r24
3539     12b6:       9f 93           push    r25
3540     12b8:       af 93           push    r26
3541     12ba:       bf 93           push    r27
3542
3543         setup.elapsed_time += 1;
3544     12bc:       80 91 96 01     lds     r24, 0x0196
3545     12c0:       90 91 97 01     lds     r25, 0x0197
3546     12c4:       a0 91 98 01     lds     r26, 0x0198
3547     12c8:       b0 91 99 01     lds     r27, 0x0199
3548     12cc:       01 96           adiw    r24, 0x01       ; 1
3549     12ce:       a1 1d           adc     r26, r1
3550     12d0:       b1 1d           adc     r27, r1
3551     12d2:       80 93 96 01     sts     0x0196, r24
3552     12d6:       90 93 97 01     sts     0x0197, r25
3553     12da:       a0 93 98 01     sts     0x0198, r26
3554     12de:       b0 93 99 01     sts     0x0199, r27
3555         PORTB ^= (1<<SCK);
3556     12e2:       85 b1           in      r24, 0x05       ; 5
3557     12e4:       98 e0           ldi     r25, 0x08       ; 8
3558     12e6:       89 27           eor     r24, r25
3559     12e8:       85 b9           out     0x05, r24       ; 5
3560
3561 }
3562     12ea:       bf 91           pop     r27
3563     12ec:       af 91           pop     r26
3564     12ee:       9f 91           pop     r25
3565     12f0:       8f 91           pop     r24
3566     12f2:       0f 90           pop     r0
3567     12f4:       0f be           out     0x3f, r0        ; 63
3568     12f6:       0f 90           pop     r0
3569     12f8:       1f 90           pop     r1
3570     12fa:       18 95           reti
3571
3572 000012fc <USART_Init>:
3573 *
3574 *****************************************************************************/
3575 void USART_Init(unsigned int baudrate)
3576 {
3577     // Set baud rate
3578     UBRRH = (unsigned char)(baudrate>>8);
3579     12fc:       29 2f           mov     r18, r25
3580     12fe:       33 27           eor     r19, r19
3581     1300:       20 93 c5 00     sts     0x00C5, r18
3582     UBRRL = (unsigned char)baudrate;
3583     1304:       80 93 c4 00     sts     0x00C4, r24
3584
3585     // Disable 2x speed
3586     UCSRA = 0;
3587     1308:       10 92 c0 00     sts     0x00C0, r1
3588 //      cbiBF(PORTB, 6);
3589 //      cbiBF(PORTB, 7);
3590
3591 #ifdef WITH_TRANSMIT
3592     // enabled receive and transmit
3593     UCSRB = (1<<RXEN)|(1<<TXEN)|(0<<RXCIE)|(0<<UDRIE);
3594     130c:       88 e1           ldi     r24, 0x18       ; 24
3595     130e:       80 93 c1 00     sts     0x00C1, r24
3596     // send (only receive in vcard).
3597     UCSRB = (1<<RXEN)|(0<<TXEN)|(0<<RXCIE)|(0<<UDRIE);
3598 #endif
3599
3600     // Async. mode, 8N1
3601     UCSRC = (0<<UMSEL)|(0<<UPM0)|(0<<USBS)|(3<<UCSZ0)|(0<<UCPOL);
3602     1312:       86 e0           ldi     r24, 0x06       ; 6
3603     1314:       80 93 c2 00     sts     0x00C2, r24
3604 }
3605     1318:       08 95           ret
3606
3607 0000131a <USART_Tx>:
3608 *   Purpose :       Send one byte through the USART
3609 *
3610 *****************************************************************************/
3611
3612 void USART_Tx(char data)
3613 {
3614     131a:       98 2f           mov     r25, r24
3615         sbiBF(PORTB, 6);
3616     131c:       2e 9a           sbi     0x05, 6 ; 5
3617     while (!(UCSRA & (1<<UDRE)));
3618     131e:       80 91 c0 00     lds     r24, 0x00C0
3619     1322:       85 ff           sbrs    r24, 5
3620     1324:       fc cf           rjmp    .-8             ; 0x131e <USART_Tx+0x4>
3621     UDR = data;
3622     1326:       90 93 c6 00     sts     0x00C6, r25
3623 //      cbiBF(PORTB, 6);
3624 }
3625     132a:       08 95           ret
3626
3627 0000132c <USART_Rx>:
3628 *   Purpose :       Receives one byte from the USART
3629 *
3630 *****************************************************************************/
3631 char USART_Rx(void)
3632 {
3633         sbiBF(PORTB, 7);
3634     132c:       2f 9a           sbi     0x05, 7 ; 5
3635     while (!(UCSRA & (1<<RXC)));
3636     132e:       80 91 c0 00     lds     r24, 0x00C0
3637     1332:       87 ff           sbrs    r24, 7
3638     1334:       fc cf           rjmp    .-8             ; 0x132e <USART_Rx+0x2>
3639 //      cbiBF(PORTB, 5);
3640     return UDR;
3641     1336:       80 91 c6 00     lds     r24, 0x00C6
3642 }
3643     133a:       08 95           ret
3644
3645 0000133c <USART_Poll>:
3646 char USART_Poll(void)
3647 {
3648         if (!(UCSRA & (1<<RXC)))
3649     133c:       80 91 c0 00     lds     r24, 0x00C0
3650     1340:       87 fd           sbrc    r24, 7
3651     1342:       02 c0           rjmp    .+4             ; 0x1348 <USART_Poll+0xc>
3652     1344:       80 e0           ldi     r24, 0x00       ; 0
3653     1346:       08 95           ret
3654                 return '\0';
3655         return UDR;
3656     1348:       80 91 c6 00     lds     r24, 0x00C6
3657 }
3658     134c:       08 95           ret
3659
3660 0000134e <USART_printf>:
3661
3662 int USART_printf(const char * format, ...)
3663 {
3664     134e:       ef 92           push    r14
3665     1350:       ff 92           push    r15
3666     1352:       0f 93           push    r16
3667     1354:       1f 93           push    r17
3668     1356:       df 93           push    r29
3669     1358:       cf 93           push    r28
3670     135a:       cd b7           in      r28, 0x3d       ; 61
3671     135c:       de b7           in      r29, 0x3e       ; 62
3672     135e:       c0 55           subi    r28, 0x50       ; 80
3673     1360:       d0 40           sbci    r29, 0x00       ; 0
3674     1362:       0f b6           in      r0, 0x3f        ; 63
3675     1364:       f8 94           cli
3676     1366:       de bf           out     0x3e, r29       ; 62
3677     1368:       0f be           out     0x3f, r0        ; 63
3678     136a:       cd bf           out     0x3d, r28       ; 61
3679     136c:       fe 01           movw    r30, r28
3680     136e:       e7 5a           subi    r30, 0xA7       ; 167
3681     1370:       ff 4f           sbci    r31, 0xFF       ; 255
3682     1372:       61 91           ld      r22, Z+
3683     1374:       71 91           ld      r23, Z+
3684         char buffer[80];
3685         va_list args;
3686         va_start(args, format);
3687         int result = vsprintf(buffer, format, args);
3688     1376:       8e 01           movw    r16, r28
3689     1378:       0f 5f           subi    r16, 0xFF       ; 255
3690     137a:       1f 4f           sbci    r17, 0xFF       ; 255
3691     137c:       c8 01           movw    r24, r16
3692     137e:       af 01           movw    r20, r30
3693     1380:       08 df           rcall   .-496           ; 0x1192 <vsprintf>
3694     1382:       7c 01           movw    r14, r24
3695     1384:       03 c0           rjmp    .+6             ; 0x138c <USART_printf+0x3e>
3696         va_end(args);
3697
3698         for (char * b = buffer; *b != '\0'; ++b)
3699                 USART_Tx(*b);
3700     1386:       c9 df           rcall   .-110           ; 0x131a <USART_Tx>
3701         va_list args;
3702         va_start(args, format);
3703         int result = vsprintf(buffer, format, args);
3704         va_end(args);
3705
3706         for (char * b = buffer; *b != '\0'; ++b)
3707     1388:       0f 5f           subi    r16, 0xFF       ; 255
3708     138a:       1f 4f           sbci    r17, 0xFF       ; 255
3709     138c:       f8 01           movw    r30, r16
3710     138e:       80 81           ld      r24, Z
3711     1390:       88 23           and     r24, r24
3712     1392:       c9 f7           brne    .-14            ; 0x1386 <USART_printf+0x38>
3713                 USART_Tx(*b);
3714         return result;
3715 }
3716     1394:       c7 01           movw    r24, r14
3717     1396:       c0 5b           subi    r28, 0xB0       ; 176
3718     1398:       df 4f           sbci    r29, 0xFF       ; 255
3719     139a:       0f b6           in      r0, 0x3f        ; 63
3720     139c:       f8 94           cli
3721     139e:       de bf           out     0x3e, r29       ; 62
3722     13a0:       0f be           out     0x3f, r0        ; 63
3723     13a2:       cd bf           out     0x3d, r28       ; 61
3724     13a4:       cf 91           pop     r28
3725     13a6:       df 91           pop     r29
3726     13a8:       1f 91           pop     r17
3727     13aa:       0f 91           pop     r16
3728     13ac:       ff 90           pop     r15
3729     13ae:       ef 90           pop     r14
3730     13b0:       08 95           ret
3731
3732 000013b2 <__subsf3>:
3733     13b2:       50 58           subi    r21, 0x80       ; 128
3734
3735 000013b4 <__addsf3>:
3736     13b4:       bb 27           eor     r27, r27
3737     13b6:       aa 27           eor     r26, r26
3738     13b8:       0e d0           rcall   .+28            ; 0x13d6 <__addsf3x>
3739     13ba:       75 c1           rjmp    .+746           ; 0x16a6 <__fp_round>
3740     13bc:       66 d1           rcall   .+716           ; 0x168a <__fp_pscA>
3741     13be:       30 f0           brcs    .+12            ; 0x13cc <__addsf3+0x18>
3742     13c0:       6b d1           rcall   .+726           ; 0x1698 <__fp_pscB>
3743     13c2:       20 f0           brcs    .+8             ; 0x13cc <__addsf3+0x18>
3744     13c4:       31 f4           brne    .+12            ; 0x13d2 <__addsf3+0x1e>
3745     13c6:       9f 3f           cpi     r25, 0xFF       ; 255
3746     13c8:       11 f4           brne    .+4             ; 0x13ce <__addsf3+0x1a>
3747     13ca:       1e f4           brtc    .+6             ; 0x13d2 <__addsf3+0x1e>
3748     13cc:       5b c1           rjmp    .+694           ; 0x1684 <__fp_nan>
3749     13ce:       0e f4           brtc    .+2             ; 0x13d2 <__addsf3+0x1e>
3750     13d0:       e0 95           com     r30
3751     13d2:       e7 fb           bst     r30, 7
3752     13d4:       51 c1           rjmp    .+674           ; 0x1678 <__fp_inf>
3753
3754 000013d6 <__addsf3x>:
3755     13d6:       e9 2f           mov     r30, r25
3756     13d8:       77 d1           rcall   .+750           ; 0x16c8 <__fp_split3>
3757     13da:       80 f3           brcs    .-32            ; 0x13bc <__addsf3+0x8>
3758     13dc:       ba 17           cp      r27, r26
3759     13de:       62 07           cpc     r22, r18
3760     13e0:       73 07           cpc     r23, r19
3761     13e2:       84 07           cpc     r24, r20
3762     13e4:       95 07           cpc     r25, r21
3763     13e6:       18 f0           brcs    .+6             ; 0x13ee <__addsf3x+0x18>
3764     13e8:       71 f4           brne    .+28            ; 0x1406 <__addsf3x+0x30>
3765     13ea:       9e f5           brtc    .+102           ; 0x1452 <__addsf3x+0x7c>
3766     13ec:       8f c1           rjmp    .+798           ; 0x170c <__fp_zero>
3767     13ee:       0e f4           brtc    .+2             ; 0x13f2 <__addsf3x+0x1c>
3768     13f0:       e0 95           com     r30
3769     13f2:       0b 2e           mov     r0, r27
3770     13f4:       ba 2f           mov     r27, r26
3771     13f6:       a0 2d           mov     r26, r0
3772     13f8:       0b 01           movw    r0, r22
3773     13fa:       b9 01           movw    r22, r18
3774     13fc:       90 01           movw    r18, r0
3775     13fe:       0c 01           movw    r0, r24
3776     1400:       ca 01           movw    r24, r20
3777     1402:       a0 01           movw    r20, r0
3778     1404:       11 24           eor     r1, r1
3779     1406:       ff 27           eor     r31, r31
3780     1408:       59 1b           sub     r21, r25
3781     140a:       99 f0           breq    .+38            ; 0x1432 <__addsf3x+0x5c>
3782     140c:       59 3f           cpi     r21, 0xF9       ; 249
3783     140e:       50 f4           brcc    .+20            ; 0x1424 <__addsf3x+0x4e>
3784     1410:       50 3e           cpi     r21, 0xE0       ; 224
3785     1412:       68 f1           brcs    .+90            ; 0x146e <__addsf3x+0x98>
3786     1414:       1a 16           cp      r1, r26
3787     1416:       f0 40           sbci    r31, 0x00       ; 0
3788     1418:       a2 2f           mov     r26, r18
3789     141a:       23 2f           mov     r18, r19
3790     141c:       34 2f           mov     r19, r20
3791     141e:       44 27           eor     r20, r20
3792     1420:       58 5f           subi    r21, 0xF8       ; 248
3793     1422:       f3 cf           rjmp    .-26            ; 0x140a <__addsf3x+0x34>
3794     1424:       46 95           lsr     r20
3795     1426:       37 95           ror     r19
3796     1428:       27 95           ror     r18
3797     142a:       a7 95           ror     r26
3798     142c:       f0 40           sbci    r31, 0x00       ; 0
3799     142e:       53 95           inc     r21
3800     1430:       c9 f7           brne    .-14            ; 0x1424 <__addsf3x+0x4e>
3801     1432:       7e f4           brtc    .+30            ; 0x1452 <__addsf3x+0x7c>
3802     1434:       1f 16           cp      r1, r31
3803     1436:       ba 0b           sbc     r27, r26
3804     1438:       62 0b           sbc     r22, r18
3805     143a:       73 0b           sbc     r23, r19
3806     143c:       84 0b           sbc     r24, r20
3807     143e:       ba f0           brmi    .+46            ; 0x146e <__addsf3x+0x98>
3808     1440:       91 50           subi    r25, 0x01       ; 1
3809     1442:       a1 f0           breq    .+40            ; 0x146c <__addsf3x+0x96>
3810     1444:       ff 0f           add     r31, r31
3811     1446:       bb 1f           adc     r27, r27
3812     1448:       66 1f           adc     r22, r22
3813     144a:       77 1f           adc     r23, r23
3814     144c:       88 1f           adc     r24, r24
3815     144e:       c2 f7           brpl    .-16            ; 0x1440 <__addsf3x+0x6a>
3816     1450:       0e c0           rjmp    .+28            ; 0x146e <__addsf3x+0x98>
3817     1452:       ba 0f           add     r27, r26
3818     1454:       62 1f           adc     r22, r18
3819     1456:       73 1f           adc     r23, r19
3820     1458:       84 1f           adc     r24, r20
3821     145a:       48 f4           brcc    .+18            ; 0x146e <__addsf3x+0x98>
3822     145c:       87 95           ror     r24
3823     145e:       77 95           ror     r23
3824     1460:       67 95           ror     r22
3825     1462:       b7 95           ror     r27
3826     1464:       f7 95           ror     r31
3827     1466:       9e 3f           cpi     r25, 0xFE       ; 254
3828     1468:       08 f0           brcs    .+2             ; 0x146c <__addsf3x+0x96>
3829     146a:       b3 cf           rjmp    .-154           ; 0x13d2 <__addsf3+0x1e>
3830     146c:       93 95           inc     r25
3831     146e:       88 0f           add     r24, r24
3832     1470:       08 f0           brcs    .+2             ; 0x1474 <__addsf3x+0x9e>
3833     1472:       99 27           eor     r25, r25
3834     1474:       ee 0f           add     r30, r30
3835     1476:       97 95           ror     r25
3836     1478:       87 95           ror     r24
3837     147a:       08 95           ret
3838
3839 0000147c <__cmpsf2>:
3840     147c:       d9 d0           rcall   .+434           ; 0x1630 <__fp_cmp>
3841     147e:       08 f4           brcc    .+2             ; 0x1482 <__cmpsf2+0x6>
3842     1480:       81 e0           ldi     r24, 0x01       ; 1
3843     1482:       08 95           ret
3844
3845 00001484 <__divsf3>:
3846     1484:       0c d0           rcall   .+24            ; 0x149e <__divsf3x>
3847     1486:       0f c1           rjmp    .+542           ; 0x16a6 <__fp_round>
3848     1488:       07 d1           rcall   .+526           ; 0x1698 <__fp_pscB>
3849     148a:       40 f0           brcs    .+16            ; 0x149c <__divsf3+0x18>
3850     148c:       fe d0           rcall   .+508           ; 0x168a <__fp_pscA>
3851     148e:       30 f0           brcs    .+12            ; 0x149c <__divsf3+0x18>
3852     1490:       21 f4           brne    .+8             ; 0x149a <__divsf3+0x16>
3853     1492:       5f 3f           cpi     r21, 0xFF       ; 255
3854     1494:       19 f0           breq    .+6             ; 0x149c <__divsf3+0x18>
3855     1496:       f0 c0           rjmp    .+480           ; 0x1678 <__fp_inf>
3856     1498:       51 11           cpse    r21, r1
3857     149a:       39 c1           rjmp    .+626           ; 0x170e <__fp_szero>
3858     149c:       f3 c0           rjmp    .+486           ; 0x1684 <__fp_nan>
3859
3860 0000149e <__divsf3x>:
3861     149e:       14 d1           rcall   .+552           ; 0x16c8 <__fp_split3>
3862     14a0:       98 f3           brcs    .-26            ; 0x1488 <__divsf3+0x4>
3863
3864 000014a2 <__divsf3_pse>:
3865     14a2:       99 23           and     r25, r25
3866     14a4:       c9 f3           breq    .-14            ; 0x1498 <__divsf3+0x14>
3867     14a6:       55 23           and     r21, r21
3868     14a8:       b1 f3           breq    .-20            ; 0x1496 <__divsf3+0x12>
3869     14aa:       95 1b           sub     r25, r21
3870     14ac:       55 0b           sbc     r21, r21
3871     14ae:       bb 27           eor     r27, r27
3872     14b0:       aa 27           eor     r26, r26
3873     14b2:       62 17           cp      r22, r18
3874     14b4:       73 07           cpc     r23, r19
3875     14b6:       84 07           cpc     r24, r20
3876     14b8:       38 f0           brcs    .+14            ; 0x14c8 <__divsf3_pse+0x26>
3877     14ba:       9f 5f           subi    r25, 0xFF       ; 255
3878     14bc:       5f 4f           sbci    r21, 0xFF       ; 255
3879     14be:       22 0f           add     r18, r18
3880     14c0:       33 1f           adc     r19, r19
3881     14c2:       44 1f           adc     r20, r20
3882     14c4:       aa 1f           adc     r26, r26
3883     14c6:       a9 f3           breq    .-22            ; 0x14b2 <__divsf3_pse+0x10>
3884     14c8:       33 d0           rcall   .+102           ; 0x1530 <__divsf3_pse+0x8e>
3885     14ca:       0e 2e           mov     r0, r30
3886     14cc:       3a f0           brmi    .+14            ; 0x14dc <__divsf3_pse+0x3a>
3887     14ce:       e0 e8           ldi     r30, 0x80       ; 128
3888     14d0:       30 d0           rcall   .+96            ; 0x1532 <__divsf3_pse+0x90>
3889     14d2:       91 50           subi    r25, 0x01       ; 1
3890     14d4:       50 40           sbci    r21, 0x00       ; 0
3891     14d6:       e6 95           lsr     r30
3892     14d8:       00 1c           adc     r0, r0
3893     14da:       ca f7           brpl    .-14            ; 0x14ce <__divsf3_pse+0x2c>
3894     14dc:       29 d0           rcall   .+82            ; 0x1530 <__divsf3_pse+0x8e>
3895     14de:       fe 2f           mov     r31, r30
3896     14e0:       27 d0           rcall   .+78            ; 0x1530 <__divsf3_pse+0x8e>
3897     14e2:       66 0f           add     r22, r22
3898     14e4:       77 1f           adc     r23, r23
3899     14e6:       88 1f           adc     r24, r24
3900     14e8:       bb 1f           adc     r27, r27
3901     14ea:       26 17           cp      r18, r22
3902     14ec:       37 07           cpc     r19, r23
3903     14ee:       48 07           cpc     r20, r24
3904     14f0:       ab 07           cpc     r26, r27
3905     14f2:       b0 e8           ldi     r27, 0x80       ; 128
3906     14f4:       09 f0           breq    .+2             ; 0x14f8 <__divsf3_pse+0x56>
3907     14f6:       bb 0b           sbc     r27, r27
3908     14f8:       80 2d           mov     r24, r0
3909     14fa:       bf 01           movw    r22, r30
3910     14fc:       ff 27           eor     r31, r31
3911     14fe:       93 58           subi    r25, 0x83       ; 131
3912     1500:       5f 4f           sbci    r21, 0xFF       ; 255
3913     1502:       2a f0           brmi    .+10            ; 0x150e <__divsf3_pse+0x6c>
3914     1504:       9e 3f           cpi     r25, 0xFE       ; 254
3915     1506:       51 05           cpc     r21, r1
3916     1508:       68 f0           brcs    .+26            ; 0x1524 <__divsf3_pse+0x82>
3917     150a:       b6 c0           rjmp    .+364           ; 0x1678 <__fp_inf>
3918     150c:       00 c1           rjmp    .+512           ; 0x170e <__fp_szero>
3919     150e:       5f 3f           cpi     r21, 0xFF       ; 255
3920     1510:       ec f3           brlt    .-6             ; 0x150c <__divsf3_pse+0x6a>
3921     1512:       98 3e           cpi     r25, 0xE8       ; 232
3922     1514:       dc f3           brlt    .-10            ; 0x150c <__divsf3_pse+0x6a>
3923     1516:       86 95           lsr     r24
3924     1518:       77 95           ror     r23
3925     151a:       67 95           ror     r22
3926     151c:       b7 95           ror     r27
3927     151e:       f7 95           ror     r31
3928     1520:       9f 5f           subi    r25, 0xFF       ; 255
3929     1522:       c9 f7           brne    .-14            ; 0x1516 <__divsf3_pse+0x74>
3930     1524:       88 0f           add     r24, r24
3931     1526:       91 1d           adc     r25, r1
3932     1528:       96 95           lsr     r25
3933     152a:       87 95           ror     r24
3934     152c:       97 f9           bld     r25, 7
3935     152e:       08 95           ret
3936     1530:       e1 e0           ldi     r30, 0x01       ; 1
3937     1532:       66 0f           add     r22, r22
3938     1534:       77 1f           adc     r23, r23
3939     1536:       88 1f           adc     r24, r24
3940     1538:       bb 1f           adc     r27, r27
3941     153a:       62 17           cp      r22, r18
3942     153c:       73 07           cpc     r23, r19
3943     153e:       84 07           cpc     r24, r20
3944     1540:       ba 07           cpc     r27, r26
3945     1542:       20 f0           brcs    .+8             ; 0x154c <__divsf3_pse+0xaa>
3946     1544:       62 1b           sub     r22, r18
3947     1546:       73 0b           sbc     r23, r19
3948     1548:       84 0b           sbc     r24, r20
3949     154a:       ba 0b           sbc     r27, r26
3950     154c:       ee 1f           adc     r30, r30
3951     154e:       88 f7           brcc    .-30            ; 0x1532 <__divsf3_pse+0x90>
3952     1550:       e0 95           com     r30
3953     1552:       08 95           ret
3954
3955 00001554 <__fixsfsi>:
3956     1554:       04 d0           rcall   .+8             ; 0x155e <__fixunssfsi>
3957     1556:       68 94           set
3958     1558:       b1 11           cpse    r27, r1
3959     155a:       d9 c0           rjmp    .+434           ; 0x170e <__fp_szero>
3960     155c:       08 95           ret
3961
3962 0000155e <__fixunssfsi>:
3963     155e:       bc d0           rcall   .+376           ; 0x16d8 <__fp_splitA>
3964     1560:       88 f0           brcs    .+34            ; 0x1584 <__fixunssfsi+0x26>
3965     1562:       9f 57           subi    r25, 0x7F       ; 127
3966     1564:       90 f0           brcs    .+36            ; 0x158a <__fixunssfsi+0x2c>
3967     1566:       b9 2f           mov     r27, r25
3968     1568:       99 27           eor     r25, r25
3969     156a:       b7 51           subi    r27, 0x17       ; 23
3970     156c:       a0 f0           brcs    .+40            ; 0x1596 <__fixunssfsi+0x38>
3971     156e:       d1 f0           breq    .+52            ; 0x15a4 <__fixunssfsi+0x46>
3972     1570:       66 0f           add     r22, r22
3973     1572:       77 1f           adc     r23, r23
3974     1574:       88 1f           adc     r24, r24
3975     1576:       99 1f           adc     r25, r25
3976     1578:       1a f0           brmi    .+6             ; 0x1580 <__fixunssfsi+0x22>
3977     157a:       ba 95           dec     r27
3978     157c:       c9 f7           brne    .-14            ; 0x1570 <__fixunssfsi+0x12>
3979     157e:       12 c0           rjmp    .+36            ; 0x15a4 <__fixunssfsi+0x46>
3980     1580:       b1 30           cpi     r27, 0x01       ; 1
3981     1582:       81 f0           breq    .+32            ; 0x15a4 <__fixunssfsi+0x46>
3982     1584:       c3 d0           rcall   .+390           ; 0x170c <__fp_zero>
3983     1586:       b1 e0           ldi     r27, 0x01       ; 1
3984     1588:       08 95           ret
3985     158a:       c0 c0           rjmp    .+384           ; 0x170c <__fp_zero>
3986     158c:       67 2f           mov     r22, r23
3987     158e:       78 2f           mov     r23, r24
3988     1590:       88 27           eor     r24, r24
3989     1592:       b8 5f           subi    r27, 0xF8       ; 248
3990     1594:       39 f0           breq    .+14            ; 0x15a4 <__fixunssfsi+0x46>
3991     1596:       b9 3f           cpi     r27, 0xF9       ; 249
3992     1598:       cc f3           brlt    .-14            ; 0x158c <__fixunssfsi+0x2e>
3993     159a:       86 95           lsr     r24
3994     159c:       77 95           ror     r23
3995     159e:       67 95           ror     r22
3996     15a0:       b3 95           inc     r27
3997     15a2:       d9 f7           brne    .-10            ; 0x159a <__fixunssfsi+0x3c>
3998     15a4:       3e f4           brtc    .+14            ; 0x15b4 <__fixunssfsi+0x56>
3999     15a6:       90 95           com     r25
4000     15a8:       80 95           com     r24
4001     15aa:       70 95           com     r23
4002     15ac:       61 95           neg     r22
4003     15ae:       7f 4f           sbci    r23, 0xFF       ; 255
4004     15b0:       8f 4f           sbci    r24, 0xFF       ; 255
4005     15b2:       9f 4f           sbci    r25, 0xFF       ; 255
4006     15b4:       08 95           ret
4007
4008 000015b6 <__floatunsisf>:
4009     15b6:       e8 94           clt
4010     15b8:       09 c0           rjmp    .+18            ; 0x15cc <__floatsisf+0x12>
4011
4012 000015ba <__floatsisf>:
4013     15ba:       97 fb           bst     r25, 7
4014     15bc:       3e f4           brtc    .+14            ; 0x15cc <__floatsisf+0x12>
4015     15be:       90 95           com     r25
4016     15c0:       80 95           com     r24
4017     15c2:       70 95           com     r23
4018     15c4:       61 95           neg     r22
4019     15c6:       7f 4f           sbci    r23, 0xFF       ; 255
4020     15c8:       8f 4f           sbci    r24, 0xFF       ; 255
4021     15ca:       9f 4f           sbci    r25, 0xFF       ; 255
4022     15cc:       99 23           and     r25, r25
4023     15ce:       a9 f0           breq    .+42            ; 0x15fa <__floatsisf+0x40>
4024     15d0:       f9 2f           mov     r31, r25
4025     15d2:       96 e9           ldi     r25, 0x96       ; 150
4026     15d4:       bb 27           eor     r27, r27
4027     15d6:       93 95           inc     r25
4028     15d8:       f6 95           lsr     r31
4029     15da:       87 95           ror     r24
4030     15dc:       77 95           ror     r23
4031     15de:       67 95           ror     r22
4032     15e0:       b7 95           ror     r27
4033     15e2:       f1 11           cpse    r31, r1
4034     15e4:       f8 cf           rjmp    .-16            ; 0x15d6 <__floatsisf+0x1c>
4035     15e6:       fa f4           brpl    .+62            ; 0x1626 <__floatsisf+0x6c>
4036     15e8:       bb 0f           add     r27, r27
4037     15ea:       11 f4           brne    .+4             ; 0x15f0 <__floatsisf+0x36>
4038     15ec:       60 ff           sbrs    r22, 0
4039     15ee:       1b c0           rjmp    .+54            ; 0x1626 <__floatsisf+0x6c>
4040     15f0:       6f 5f           subi    r22, 0xFF       ; 255
4041     15f2:       7f 4f           sbci    r23, 0xFF       ; 255
4042     15f4:       8f 4f           sbci    r24, 0xFF       ; 255
4043     15f6:       9f 4f           sbci    r25, 0xFF       ; 255
4044     15f8:       16 c0           rjmp    .+44            ; 0x1626 <__floatsisf+0x6c>
4045     15fa:       88 23           and     r24, r24
4046     15fc:       11 f0           breq    .+4             ; 0x1602 <__floatsisf+0x48>
4047     15fe:       96 e9           ldi     r25, 0x96       ; 150
4048     1600:       11 c0           rjmp    .+34            ; 0x1624 <__floatsisf+0x6a>
4049     1602:       77 23           and     r23, r23
4050     1604:       21 f0           breq    .+8             ; 0x160e <__floatsisf+0x54>
4051     1606:       9e e8           ldi     r25, 0x8E       ; 142
4052     1608:       87 2f           mov     r24, r23
4053     160a:       76 2f           mov     r23, r22
4054     160c:       05 c0           rjmp    .+10            ; 0x1618 <__floatsisf+0x5e>
4055     160e:       66 23           and     r22, r22
4056     1610:       71 f0           breq    .+28            ; 0x162e <__floatsisf+0x74>
4057     1612:       96 e8           ldi     r25, 0x86       ; 134
4058     1614:       86 2f           mov     r24, r22
4059     1616:       70 e0           ldi     r23, 0x00       ; 0
4060     1618:       60 e0           ldi     r22, 0x00       ; 0
4061     161a:       2a f0           brmi    .+10            ; 0x1626 <__floatsisf+0x6c>
4062     161c:       9a 95           dec     r25
4063     161e:       66 0f           add     r22, r22
4064     1620:       77 1f           adc     r23, r23
4065     1622:       88 1f           adc     r24, r24
4066     1624:       da f7           brpl    .-10            ; 0x161c <__floatsisf+0x62>
4067     1626:       88 0f           add     r24, r24
4068     1628:       96 95           lsr     r25
4069     162a:       87 95           ror     r24
4070     162c:       97 f9           bld     r25, 7
4071     162e:       08 95           ret
4072
4073 00001630 <__fp_cmp>:
4074     1630:       99 0f           add     r25, r25
4075     1632:       00 08           sbc     r0, r0
4076     1634:       55 0f           add     r21, r21
4077     1636:       aa 0b           sbc     r26, r26
4078     1638:       e0 e8           ldi     r30, 0x80       ; 128
4079     163a:       fe ef           ldi     r31, 0xFE       ; 254
4080     163c:       16 16           cp      r1, r22
4081     163e:       17 06           cpc     r1, r23
4082     1640:       e8 07           cpc     r30, r24
4083     1642:       f9 07           cpc     r31, r25
4084     1644:       c0 f0           brcs    .+48            ; 0x1676 <__fp_cmp+0x46>
4085     1646:       12 16           cp      r1, r18
4086     1648:       13 06           cpc     r1, r19
4087     164a:       e4 07           cpc     r30, r20
4088     164c:       f5 07           cpc     r31, r21
4089     164e:       98 f0           brcs    .+38            ; 0x1676 <__fp_cmp+0x46>
4090     1650:       62 1b           sub     r22, r18
4091     1652:       73 0b           sbc     r23, r19
4092     1654:       84 0b           sbc     r24, r20
4093     1656:       95 0b           sbc     r25, r21
4094     1658:       39 f4           brne    .+14            ; 0x1668 <__fp_cmp+0x38>
4095     165a:       0a 26           eor     r0, r26
4096     165c:       61 f0           breq    .+24            ; 0x1676 <__fp_cmp+0x46>
4097     165e:       23 2b           or      r18, r19
4098     1660:       24 2b           or      r18, r20
4099     1662:       25 2b           or      r18, r21
4100     1664:       21 f4           brne    .+8             ; 0x166e <__fp_cmp+0x3e>
4101     1666:       08 95           ret
4102     1668:       0a 26           eor     r0, r26
4103     166a:       09 f4           brne    .+2             ; 0x166e <__fp_cmp+0x3e>
4104     166c:       a1 40           sbci    r26, 0x01       ; 1
4105     166e:       a6 95           lsr     r26
4106     1670:       8f ef           ldi     r24, 0xFF       ; 255
4107     1672:       81 1d           adc     r24, r1
4108     1674:       81 1d           adc     r24, r1
4109     1676:       08 95           ret
4110
4111 00001678 <__fp_inf>:
4112     1678:       97 f9           bld     r25, 7
4113     167a:       9f 67           ori     r25, 0x7F       ; 127
4114     167c:       80 e8           ldi     r24, 0x80       ; 128
4115     167e:       70 e0           ldi     r23, 0x00       ; 0
4116     1680:       60 e0           ldi     r22, 0x00       ; 0
4117     1682:       08 95           ret
4118
4119 00001684 <__fp_nan>:
4120     1684:       9f ef           ldi     r25, 0xFF       ; 255
4121     1686:       80 ec           ldi     r24, 0xC0       ; 192
4122     1688:       08 95           ret
4123
4124 0000168a <__fp_pscA>:
4125     168a:       00 24           eor     r0, r0
4126     168c:       0a 94           dec     r0
4127     168e:       16 16           cp      r1, r22
4128     1690:       17 06           cpc     r1, r23
4129     1692:       18 06           cpc     r1, r24
4130     1694:       09 06           cpc     r0, r25
4131     1696:       08 95           ret
4132
4133 00001698 <__fp_pscB>:
4134     1698:       00 24           eor     r0, r0
4135     169a:       0a 94           dec     r0
4136     169c:       12 16           cp      r1, r18
4137     169e:       13 06           cpc     r1, r19
4138     16a0:       14 06           cpc     r1, r20
4139     16a2:       05 06           cpc     r0, r21
4140     16a4:       08 95           ret
4141
4142 000016a6 <__fp_round>:
4143     16a6:       09 2e           mov     r0, r25
4144     16a8:       03 94           inc     r0
4145     16aa:       00 0c           add     r0, r0
4146     16ac:       11 f4           brne    .+4             ; 0x16b2 <__fp_round+0xc>
4147     16ae:       88 23           and     r24, r24
4148     16b0:       52 f0           brmi    .+20            ; 0x16c6 <__fp_round+0x20>
4149     16b2:       bb 0f           add     r27, r27
4150     16b4:       40 f4           brcc    .+16            ; 0x16c6 <__fp_round+0x20>
4151     16b6:       bf 2b           or      r27, r31
4152     16b8:       11 f4           brne    .+4             ; 0x16be <__fp_round+0x18>
4153     16ba:       60 ff           sbrs    r22, 0
4154     16bc:       04 c0           rjmp    .+8             ; 0x16c6 <__fp_round+0x20>
4155     16be:       6f 5f           subi    r22, 0xFF       ; 255
4156     16c0:       7f 4f           sbci    r23, 0xFF       ; 255
4157     16c2:       8f 4f           sbci    r24, 0xFF       ; 255
4158     16c4:       9f 4f           sbci    r25, 0xFF       ; 255
4159     16c6:       08 95           ret
4160
4161 000016c8 <__fp_split3>:
4162     16c8:       57 fd           sbrc    r21, 7
4163     16ca:       90 58           subi    r25, 0x80       ; 128
4164     16cc:       44 0f           add     r20, r20
4165     16ce:       55 1f           adc     r21, r21
4166     16d0:       59 f0           breq    .+22            ; 0x16e8 <__fp_splitA+0x10>
4167     16d2:       5f 3f           cpi     r21, 0xFF       ; 255
4168     16d4:       71 f0           breq    .+28            ; 0x16f2 <__fp_splitA+0x1a>
4169     16d6:       47 95           ror     r20
4170
4171 000016d8 <__fp_splitA>:
4172     16d8:       88 0f           add     r24, r24
4173     16da:       97 fb           bst     r25, 7
4174     16dc:       99 1f           adc     r25, r25
4175     16de:       61 f0           breq    .+24            ; 0x16f8 <__fp_splitA+0x20>
4176     16e0:       9f 3f           cpi     r25, 0xFF       ; 255
4177     16e2:       79 f0           breq    .+30            ; 0x1702 <__fp_splitA+0x2a>
4178     16e4:       87 95           ror     r24
4179     16e6:       08 95           ret
4180     16e8:       12 16           cp      r1, r18
4181     16ea:       13 06           cpc     r1, r19
4182     16ec:       14 06           cpc     r1, r20
4183     16ee:       55 1f           adc     r21, r21
4184     16f0:       f2 cf           rjmp    .-28            ; 0x16d6 <__fp_split3+0xe>
4185     16f2:       46 95           lsr     r20
4186     16f4:       f1 df           rcall   .-30            ; 0x16d8 <__fp_splitA>
4187     16f6:       08 c0           rjmp    .+16            ; 0x1708 <__fp_splitA+0x30>
4188     16f8:       16 16           cp      r1, r22
4189     16fa:       17 06           cpc     r1, r23
4190     16fc:       18 06           cpc     r1, r24
4191     16fe:       99 1f           adc     r25, r25
4192     1700:       f1 cf           rjmp    .-30            ; 0x16e4 <__fp_splitA+0xc>
4193     1702:       86 95           lsr     r24
4194     1704:       71 05           cpc     r23, r1
4195     1706:       61 05           cpc     r22, r1
4196     1708:       08 94           sec
4197     170a:       08 95           ret
4198
4199 0000170c <__fp_zero>:
4200     170c:       e8 94           clt
4201
4202 0000170e <__fp_szero>:
4203     170e:       bb 27           eor     r27, r27
4204     1710:       66 27           eor     r22, r22
4205     1712:       77 27           eor     r23, r23
4206     1714:       cb 01           movw    r24, r22
4207     1716:       97 f9           bld     r25, 7
4208     1718:       08 95           ret
4209
4210 0000171a <__mulsf3>:
4211     171a:       0b d0           rcall   .+22            ; 0x1732 <__mulsf3x>
4212     171c:       c4 cf           rjmp    .-120           ; 0x16a6 <__fp_round>
4213     171e:       b5 df           rcall   .-150           ; 0x168a <__fp_pscA>
4214     1720:       28 f0           brcs    .+10            ; 0x172c <__mulsf3+0x12>
4215     1722:       ba df           rcall   .-140           ; 0x1698 <__fp_pscB>
4216     1724:       18 f0           brcs    .+6             ; 0x172c <__mulsf3+0x12>
4217     1726:       95 23           and     r25, r21
4218     1728:       09 f0           breq    .+2             ; 0x172c <__mulsf3+0x12>
4219     172a:       a6 cf           rjmp    .-180           ; 0x1678 <__fp_inf>
4220     172c:       ab cf           rjmp    .-170           ; 0x1684 <__fp_nan>
4221     172e:       11 24           eor     r1, r1
4222     1730:       ee cf           rjmp    .-36            ; 0x170e <__fp_szero>
4223
4224 00001732 <__mulsf3x>:
4225     1732:       ca df           rcall   .-108           ; 0x16c8 <__fp_split3>
4226     1734:       a0 f3           brcs    .-24            ; 0x171e <__mulsf3+0x4>
4227
4228 00001736 <__mulsf3_pse>:
4229     1736:       95 9f           mul     r25, r21
4230     1738:       d1 f3           breq    .-12            ; 0x172e <__mulsf3+0x14>
4231     173a:       95 0f           add     r25, r21
4232     173c:       50 e0           ldi     r21, 0x00       ; 0
4233     173e:       55 1f           adc     r21, r21
4234     1740:       62 9f           mul     r22, r18
4235     1742:       f0 01           movw    r30, r0
4236     1744:       72 9f           mul     r23, r18
4237     1746:       bb 27           eor     r27, r27
4238     1748:       f0 0d           add     r31, r0
4239     174a:       b1 1d           adc     r27, r1
4240     174c:       63 9f           mul     r22, r19
4241     174e:       aa 27           eor     r26, r26
4242     1750:       f0 0d           add     r31, r0
4243     1752:       b1 1d           adc     r27, r1
4244     1754:       aa 1f           adc     r26, r26
4245     1756:       64 9f           mul     r22, r20
4246     1758:       66 27           eor     r22, r22
4247     175a:       b0 0d           add     r27, r0
4248     175c:       a1 1d           adc     r26, r1
4249     175e:       66 1f           adc     r22, r22
4250     1760:       82 9f           mul     r24, r18
4251     1762:       22 27           eor     r18, r18
4252     1764:       b0 0d           add     r27, r0
4253     1766:       a1 1d           adc     r26, r1
4254     1768:       62 1f           adc     r22, r18
4255     176a:       73 9f           mul     r23, r19
4256     176c:       b0 0d           add     r27, r0
4257     176e:       a1 1d           adc     r26, r1
4258     1770:       62 1f           adc     r22, r18
4259     1772:       83 9f           mul     r24, r19
4260     1774:       a0 0d           add     r26, r0
4261     1776:       61 1d           adc     r22, r1
4262     1778:       22 1f           adc     r18, r18
4263     177a:       74 9f           mul     r23, r20
4264     177c:       33 27           eor     r19, r19
4265     177e:       a0 0d           add     r26, r0
4266     1780:       61 1d           adc     r22, r1
4267     1782:       23 1f           adc     r18, r19
4268     1784:       84 9f           mul     r24, r20
4269     1786:       60 0d           add     r22, r0
4270     1788:       21 1d           adc     r18, r1
4271     178a:       82 2f           mov     r24, r18
4272     178c:       76 2f           mov     r23, r22
4273     178e:       6a 2f           mov     r22, r26
4274     1790:       11 24           eor     r1, r1
4275     1792:       9f 57           subi    r25, 0x7F       ; 127
4276     1794:       50 40           sbci    r21, 0x00       ; 0
4277     1796:       8a f0           brmi    .+34            ; 0x17ba <__mulsf3_pse+0x84>
4278     1798:       e1 f0           breq    .+56            ; 0x17d2 <__mulsf3_pse+0x9c>
4279     179a:       88 23           and     r24, r24
4280     179c:       4a f0           brmi    .+18            ; 0x17b0 <__mulsf3_pse+0x7a>
4281     179e:       ee 0f           add     r30, r30
4282     17a0:       ff 1f           adc     r31, r31
4283     17a2:       bb 1f           adc     r27, r27
4284     17a4:       66 1f           adc     r22, r22
4285     17a6:       77 1f           adc     r23, r23
4286     17a8:       88 1f           adc     r24, r24
4287     17aa:       91 50           subi    r25, 0x01       ; 1
4288     17ac:       50 40           sbci    r21, 0x00       ; 0
4289     17ae:       a9 f7           brne    .-22            ; 0x179a <__mulsf3_pse+0x64>
4290     17b0:       9e 3f           cpi     r25, 0xFE       ; 254
4291     17b2:       51 05           cpc     r21, r1
4292     17b4:       70 f0           brcs    .+28            ; 0x17d2 <__mulsf3_pse+0x9c>
4293     17b6:       60 cf           rjmp    .-320           ; 0x1678 <__fp_inf>
4294     17b8:       aa cf           rjmp    .-172           ; 0x170e <__fp_szero>
4295     17ba:       5f 3f           cpi     r21, 0xFF       ; 255
4296     17bc:       ec f3           brlt    .-6             ; 0x17b8 <__mulsf3_pse+0x82>
4297     17be:       98 3e           cpi     r25, 0xE8       ; 232
4298     17c0:       dc f3           brlt    .-10            ; 0x17b8 <__mulsf3_pse+0x82>
4299     17c2:       86 95           lsr     r24
4300     17c4:       77 95           ror     r23
4301     17c6:       67 95           ror     r22
4302     17c8:       b7 95           ror     r27
4303     17ca:       f7 95           ror     r31
4304     17cc:       e7 95           ror     r30
4305     17ce:       9f 5f           subi    r25, 0xFF       ; 255
4306     17d0:       c1 f7           brne    .-16            ; 0x17c2 <__mulsf3_pse+0x8c>
4307     17d2:       fe 2b           or      r31, r30
4308     17d4:       88 0f           add     r24, r24
4309     17d6:       91 1d           adc     r25, r1
4310     17d8:       96 95           lsr     r25
4311     17da:       87 95           ror     r24
4312     17dc:       97 f9           bld     r25, 7
4313     17de:       08 95           ret
4314     17e0:       11 f4           brne    .+4             ; 0x17e6 <__mulsf3_pse+0xb0>
4315     17e2:       0e f4           brtc    .+2             ; 0x17e6 <__mulsf3_pse+0xb0>
4316     17e4:       4f cf           rjmp    .-354           ; 0x1684 <__fp_nan>
4317     17e6:       3e c0           rjmp    .+124           ; 0x1864 <__fp_mpack>
4318
4319 000017e8 <sqrt>:
4320     17e8:       77 df           rcall   .-274           ; 0x16d8 <__fp_splitA>
4321     17ea:       d0 f3           brcs    .-12            ; 0x17e0 <__mulsf3_pse+0xaa>
4322     17ec:       99 23           and     r25, r25
4323     17ee:       d9 f3           breq    .-10            ; 0x17e6 <__mulsf3_pse+0xb0>
4324     17f0:       ce f3           brts    .-14            ; 0x17e4 <__mulsf3_pse+0xae>
4325     17f2:       9f 57           subi    r25, 0x7F       ; 127
4326     17f4:       55 0b           sbc     r21, r21
4327     17f6:       87 ff           sbrs    r24, 7
4328     17f8:       43 d0           rcall   .+134           ; 0x1880 <__fp_norm2>
4329     17fa:       00 24           eor     r0, r0
4330     17fc:       a0 e6           ldi     r26, 0x60       ; 96
4331     17fe:       40 ea           ldi     r20, 0xA0       ; 160
4332     1800:       90 01           movw    r18, r0
4333     1802:       80 58           subi    r24, 0x80       ; 128
4334     1804:       56 95           lsr     r21
4335     1806:       97 95           ror     r25
4336     1808:       28 f4           brcc    .+10            ; 0x1814 <sqrt+0x2c>
4337     180a:       80 5c           subi    r24, 0xC0       ; 192
4338     180c:       66 0f           add     r22, r22
4339     180e:       77 1f           adc     r23, r23
4340     1810:       88 1f           adc     r24, r24
4341     1812:       20 f0           brcs    .+8             ; 0x181c <sqrt+0x34>
4342     1814:       26 17           cp      r18, r22
4343     1816:       37 07           cpc     r19, r23
4344     1818:       48 07           cpc     r20, r24
4345     181a:       30 f4           brcc    .+12            ; 0x1828 <sqrt+0x40>
4346     181c:       62 1b           sub     r22, r18
4347     181e:       73 0b           sbc     r23, r19
4348     1820:       84 0b           sbc     r24, r20
4349     1822:       20 29           or      r18, r0
4350     1824:       31 29           or      r19, r1
4351     1826:       4a 2b           or      r20, r26
4352     1828:       a6 95           lsr     r26
4353     182a:       17 94           ror     r1
4354     182c:       07 94           ror     r0
4355     182e:       20 25           eor     r18, r0
4356     1830:       31 25           eor     r19, r1
4357     1832:       4a 27           eor     r20, r26
4358     1834:       58 f7           brcc    .-42            ; 0x180c <sqrt+0x24>
4359     1836:       66 0f           add     r22, r22
4360     1838:       77 1f           adc     r23, r23
4361     183a:       88 1f           adc     r24, r24
4362     183c:       20 f0           brcs    .+8             ; 0x1846 <sqrt+0x5e>
4363     183e:       26 17           cp      r18, r22
4364     1840:       37 07           cpc     r19, r23
4365     1842:       48 07           cpc     r20, r24
4366     1844:       30 f4           brcc    .+12            ; 0x1852 <sqrt+0x6a>
4367     1846:       62 0b           sbc     r22, r18
4368     1848:       73 0b           sbc     r23, r19
4369     184a:       84 0b           sbc     r24, r20
4370     184c:       20 0d           add     r18, r0
4371     184e:       31 1d           adc     r19, r1
4372     1850:       41 1d           adc     r20, r1
4373     1852:       a0 95           com     r26
4374     1854:       81 f7           brne    .-32            ; 0x1836 <sqrt+0x4e>
4375     1856:       b9 01           movw    r22, r18
4376     1858:       84 2f           mov     r24, r20
4377     185a:       91 58           subi    r25, 0x81       ; 129
4378     185c:       88 0f           add     r24, r24
4379     185e:       96 95           lsr     r25
4380     1860:       87 95           ror     r24
4381     1862:       08 95           ret
4382
4383 00001864 <__fp_mpack>:
4384     1864:       9f 3f           cpi     r25, 0xFF       ; 255
4385     1866:       31 f0           breq    .+12            ; 0x1874 <__fp_mpack_finite+0xc>
4386
4387 00001868 <__fp_mpack_finite>:
4388     1868:       91 50           subi    r25, 0x01       ; 1
4389     186a:       20 f4           brcc    .+8             ; 0x1874 <__fp_mpack_finite+0xc>
4390     186c:       87 95           ror     r24
4391     186e:       77 95           ror     r23
4392     1870:       67 95           ror     r22
4393     1872:       b7 95           ror     r27
4394     1874:       88 0f           add     r24, r24
4395     1876:       91 1d           adc     r25, r1
4396     1878:       96 95           lsr     r25
4397     187a:       87 95           ror     r24
4398     187c:       97 f9           bld     r25, 7
4399     187e:       08 95           ret
4400
4401 00001880 <__fp_norm2>:
4402     1880:       91 50           subi    r25, 0x01       ; 1
4403     1882:       50 40           sbci    r21, 0x00       ; 0
4404     1884:       66 0f           add     r22, r22
4405     1886:       77 1f           adc     r23, r23
4406     1888:       88 1f           adc     r24, r24
4407     188a:       d2 f7           brpl    .-12            ; 0x1880 <__fp_norm2>
4408     188c:       08 95           ret
4409
4410 0000188e <__mulsi3>:
4411     188e:       62 9f           mul     r22, r18
4412     1890:       d0 01           movw    r26, r0
4413     1892:       73 9f           mul     r23, r19
4414     1894:       f0 01           movw    r30, r0
4415     1896:       82 9f           mul     r24, r18
4416     1898:       e0 0d           add     r30, r0
4417     189a:       f1 1d           adc     r31, r1
4418     189c:       64 9f           mul     r22, r20
4419     189e:       e0 0d           add     r30, r0
4420     18a0:       f1 1d           adc     r31, r1
4421     18a2:       92 9f           mul     r25, r18
4422     18a4:       f0 0d           add     r31, r0
4423     18a6:       83 9f           mul     r24, r19
4424     18a8:       f0 0d           add     r31, r0
4425     18aa:       74 9f           mul     r23, r20
4426     18ac:       f0 0d           add     r31, r0
4427     18ae:       65 9f           mul     r22, r21
4428     18b0:       f0 0d           add     r31, r0
4429     18b2:       99 27           eor     r25, r25
4430     18b4:       72 9f           mul     r23, r18
4431     18b6:       b0 0d           add     r27, r0
4432     18b8:       e1 1d           adc     r30, r1
4433     18ba:       f9 1f           adc     r31, r25
4434     18bc:       63 9f           mul     r22, r19
4435     18be:       b0 0d           add     r27, r0
4436     18c0:       e1 1d           adc     r30, r1
4437     18c2:       f9 1f           adc     r31, r25
4438     18c4:       bd 01           movw    r22, r26
4439     18c6:       cf 01           movw    r24, r30
4440     18c8:       11 24           eor     r1, r1
4441     18ca:       08 95           ret
4442
4443 000018cc <__udivmodhi4>:
4444     18cc:       aa 1b           sub     r26, r26
4445     18ce:       bb 1b           sub     r27, r27
4446     18d0:       51 e1           ldi     r21, 0x11       ; 17
4447     18d2:       07 c0           rjmp    .+14            ; 0x18e2 <__udivmodhi4_ep>
4448
4449 000018d4 <__udivmodhi4_loop>:
4450     18d4:       aa 1f           adc     r26, r26
4451     18d6:       bb 1f           adc     r27, r27
4452     18d8:       a6 17           cp      r26, r22
4453     18da:       b7 07           cpc     r27, r23
4454     18dc:       10 f0           brcs    .+4             ; 0x18e2 <__udivmodhi4_ep>
4455     18de:       a6 1b           sub     r26, r22
4456     18e0:       b7 0b           sbc     r27, r23
4457
4458 000018e2 <__udivmodhi4_ep>:
4459     18e2:       88 1f           adc     r24, r24
4460     18e4:       99 1f           adc     r25, r25
4461     18e6:       5a 95           dec     r21
4462     18e8:       a9 f7           brne    .-22            ; 0x18d4 <__udivmodhi4_loop>
4463     18ea:       80 95           com     r24
4464     18ec:       90 95           com     r25
4465     18ee:       bc 01           movw    r22, r24
4466     18f0:       cd 01           movw    r24, r26
4467     18f2:       08 95           ret
4468
4469 000018f4 <__divmodhi4>:
4470     18f4:       97 fb           bst     r25, 7
4471     18f6:       09 2e           mov     r0, r25
4472     18f8:       07 26           eor     r0, r23
4473     18fa:       0a d0           rcall   .+20            ; 0x1910 <__divmodhi4_neg1>
4474     18fc:       77 fd           sbrc    r23, 7
4475     18fe:       04 d0           rcall   .+8             ; 0x1908 <__divmodhi4_neg2>
4476     1900:       e5 df           rcall   .-54            ; 0x18cc <__udivmodhi4>
4477     1902:       06 d0           rcall   .+12            ; 0x1910 <__divmodhi4_neg1>
4478     1904:       00 20           and     r0, r0
4479     1906:       1a f4           brpl    .+6             ; 0x190e <__divmodhi4_exit>
4480
4481 00001908 <__divmodhi4_neg2>:
4482     1908:       70 95           com     r23
4483     190a:       61 95           neg     r22
4484     190c:       7f 4f           sbci    r23, 0xFF       ; 255
4485
4486 0000190e <__divmodhi4_exit>:
4487     190e:       08 95           ret
4488
4489 00001910 <__divmodhi4_neg1>:
4490     1910:       f6 f7           brtc    .-4             ; 0x190e <__divmodhi4_exit>
4491     1912:       90 95           com     r25
4492     1914:       81 95           neg     r24
4493     1916:       9f 4f           sbci    r25, 0xFF       ; 255
4494     1918:       08 95           ret
4495
4496 0000191a <__udivmodsi4>:
4497     191a:       a1 e2           ldi     r26, 0x21       ; 33
4498     191c:       1a 2e           mov     r1, r26
4499     191e:       aa 1b           sub     r26, r26
4500     1920:       bb 1b           sub     r27, r27
4501     1922:       fd 01           movw    r30, r26
4502     1924:       0d c0           rjmp    .+26            ; 0x1940 <__udivmodsi4_ep>
4503
4504 00001926 <__udivmodsi4_loop>:
4505     1926:       aa 1f           adc     r26, r26
4506     1928:       bb 1f           adc     r27, r27
4507     192a:       ee 1f           adc     r30, r30
4508     192c:       ff 1f           adc     r31, r31
4509     192e:       a2 17           cp      r26, r18
4510     1930:       b3 07           cpc     r27, r19
4511     1932:       e4 07           cpc     r30, r20
4512     1934:       f5 07           cpc     r31, r21
4513     1936:       20 f0           brcs    .+8             ; 0x1940 <__udivmodsi4_ep>
4514     1938:       a2 1b           sub     r26, r18
4515     193a:       b3 0b           sbc     r27, r19
4516     193c:       e4 0b           sbc     r30, r20
4517     193e:       f5 0b           sbc     r31, r21
4518
4519 00001940 <__udivmodsi4_ep>:
4520     1940:       66 1f           adc     r22, r22
4521     1942:       77 1f           adc     r23, r23
4522     1944:       88 1f           adc     r24, r24
4523     1946:       99 1f           adc     r25, r25
4524     1948:       1a 94           dec     r1
4525     194a:       69 f7           brne    .-38            ; 0x1926 <__udivmodsi4_loop>
4526     194c:       60 95           com     r22
4527     194e:       70 95           com     r23
4528     1950:       80 95           com     r24
4529     1952:       90 95           com     r25
4530     1954:       9b 01           movw    r18, r22
4531     1956:       ac 01           movw    r20, r24
4532     1958:       bd 01           movw    r22, r26
4533     195a:       cf 01           movw    r24, r30
4534     195c:       08 95           ret
4535
4536 0000195e <atoi>:
4537     195e:       fc 01           movw    r30, r24
4538     1960:       88 27           eor     r24, r24
4539     1962:       99 27           eor     r25, r25
4540     1964:       e8 94           clt
4541     1966:       21 91           ld      r18, Z+
4542     1968:       20 32           cpi     r18, 0x20       ; 32
4543     196a:       e9 f3           breq    .-6             ; 0x1966 <atoi+0x8>
4544     196c:       29 30           cpi     r18, 0x09       ; 9
4545     196e:       10 f0           brcs    .+4             ; 0x1974 <atoi+0x16>
4546     1970:       2e 30           cpi     r18, 0x0E       ; 14
4547     1972:       c8 f3           brcs    .-14            ; 0x1966 <atoi+0x8>
4548     1974:       2b 32           cpi     r18, 0x2B       ; 43
4549     1976:       39 f0           breq    .+14            ; 0x1986 <atoi+0x28>
4550     1978:       2d 32           cpi     r18, 0x2D       ; 45
4551     197a:       31 f4           brne    .+12            ; 0x1988 <atoi+0x2a>
4552     197c:       68 94           set
4553     197e:       03 c0           rjmp    .+6             ; 0x1986 <atoi+0x28>
4554     1980:       0b d0           rcall   .+22            ; 0x1998 <__mulhi_const_10>
4555     1982:       82 0f           add     r24, r18
4556     1984:       91 1d           adc     r25, r1
4557     1986:       21 91           ld      r18, Z+
4558     1988:       20 53           subi    r18, 0x30       ; 48
4559     198a:       2a 30           cpi     r18, 0x0A       ; 10
4560     198c:       c8 f3           brcs    .-14            ; 0x1980 <atoi+0x22>
4561     198e:       1e f4           brtc    .+6             ; 0x1996 <atoi+0x38>
4562     1990:       90 95           com     r25
4563     1992:       81 95           neg     r24
4564     1994:       9f 4f           sbci    r25, 0xFF       ; 255
4565     1996:       08 95           ret
4566
4567 00001998 <__mulhi_const_10>:
4568     1998:       7a e0           ldi     r23, 0x0A       ; 10
4569     199a:       97 9f           mul     r25, r23
4570     199c:       90 2d           mov     r25, r0
4571     199e:       87 9f           mul     r24, r23
4572     19a0:       80 2d           mov     r24, r0
4573     19a2:       91 0d           add     r25, r1
4574     19a4:       11 24           eor     r1, r1
4575     19a6:       08 95           ret
4576
4577 000019a8 <_exit>:
4578     19a8:       f8 94           cli
4579
4580 000019aa <__stop_program>:
4581     19aa:       ff cf           rjmp    .-2             ; 0x19aa <__stop_program>

UCC git Repository :: git.ucc.asn.au