main.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn 0 .text 000002fe 00000000 00000000 00000074 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .bss 00000012 00800100 000002fe 00000372 2**0 ALLOC 2 .stab 00000d08 00000000 00000000 00000374 2**2 CONTENTS, READONLY, DEBUGGING 3 .stabstr 000008b1 00000000 00000000 0000107c 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 19 c0 rjmp .+50 ; 0x34 <__CCP__> 2: 33 c0 rjmp .+102 ; 0x6a <__bad_interrupt> 4: 32 c0 rjmp .+100 ; 0x6a <__bad_interrupt> 6: 31 c0 rjmp .+98 ; 0x6a <__bad_interrupt> 8: 30 c0 rjmp .+96 ; 0x6a <__bad_interrupt> a: 2f c0 rjmp .+94 ; 0x6a <__bad_interrupt> c: 2e c0 rjmp .+92 ; 0x6a <__bad_interrupt> e: 2d c0 rjmp .+90 ; 0x6a <__bad_interrupt> 10: 2c c0 rjmp .+88 ; 0x6a <__bad_interrupt> 12: 2b c0 rjmp .+86 ; 0x6a <__bad_interrupt> 14: 2a c0 rjmp .+84 ; 0x6a <__bad_interrupt> 16: 29 c0 rjmp .+82 ; 0x6a <__bad_interrupt> 18: 28 c0 rjmp .+80 ; 0x6a <__bad_interrupt> 1a: 27 c0 rjmp .+78 ; 0x6a <__bad_interrupt> 1c: 26 c0 rjmp .+76 ; 0x6a <__bad_interrupt> 1e: 32 c1 rjmp .+612 ; 0x284 <__vector_15> 20: 24 c0 rjmp .+72 ; 0x6a <__bad_interrupt> 22: 23 c0 rjmp .+70 ; 0x6a <__bad_interrupt> 24: 47 c1 rjmp .+654 ; 0x2b4 <__vector_18> 26: 21 c0 rjmp .+66 ; 0x6a <__bad_interrupt> 28: 20 c0 rjmp .+64 ; 0x6a <__bad_interrupt> 2a: 1f c0 rjmp .+62 ; 0x6a <__bad_interrupt> 2c: 1e c0 rjmp .+60 ; 0x6a <__bad_interrupt> 2e: 1d c0 rjmp .+58 ; 0x6a <__bad_interrupt> 30: 1c c0 rjmp .+56 ; 0x6a <__bad_interrupt> 32: 1b c0 rjmp .+54 ; 0x6a <__bad_interrupt> 00000034 <__ctors_end>: 34: 11 24 eor r1, r1 36: 1f be out 0x3f, r1 ; 63 38: cf ef ldi r28, 0xFF ; 255 3a: d2 e0 ldi r29, 0x02 ; 2 3c: de bf out 0x3e, r29 ; 62 3e: cd bf out 0x3d, r28 ; 61 00000040 <__do_copy_data>: 40: 11 e0 ldi r17, 0x01 ; 1 42: a0 e0 ldi r26, 0x00 ; 0 44: b1 e0 ldi r27, 0x01 ; 1 46: ee ef ldi r30, 0xFE ; 254 48: f2 e0 ldi r31, 0x02 ; 2 4a: 02 c0 rjmp .+4 ; 0x50 <.do_copy_data_start> 0000004c <.do_copy_data_loop>: 4c: 05 90 lpm r0, Z+ 4e: 0d 92 st X+, r0 00000050 <.do_copy_data_start>: 50: a0 30 cpi r26, 0x00 ; 0 52: b1 07 cpc r27, r17 54: d9 f7 brne .-10 ; 0x4c <.do_copy_data_loop> 00000056 <__do_clear_bss>: 56: 11 e0 ldi r17, 0x01 ; 1 58: a0 e0 ldi r26, 0x00 ; 0 5a: b1 e0 ldi r27, 0x01 ; 1 5c: 01 c0 rjmp .+2 ; 0x60 <.do_clear_bss_start> 0000005e <.do_clear_bss_loop>: 5e: 1d 92 st X+, r1 00000060 <.do_clear_bss_start>: 60: a2 31 cpi r26, 0x12 ; 18 62: b1 07 cpc r27, r17 64: e1 f7 brne .-8 ; 0x5e <.do_clear_bss_loop> 66: 02 d0 rcall .+4 ; 0x6c
68: 48 c1 rjmp .+656 ; 0x2fa <_exit> 0000006a <__bad_interrupt>: 6a: ca cf rjmp .-108 ; 0x0 <__heap_end> 0000006c
: }; volatile uint8_t g_infoptr = 0; int main(void) { 6c: af 92 push r10 6e: bf 92 push r11 70: cf 92 push r12 72: df 92 push r13 74: ff 92 push r15 76: 0f 93 push r16 78: 1f 93 push r17 7a: df 93 push r29 7c: cf 93 push r28 7e: 00 d0 rcall .+0 ; 0x80 80: 00 d0 rcall .+0 ; 0x82 82: 00 d0 rcall .+0 ; 0x84 84: cd b7 in r28, 0x3d ; 61 86: de b7 in r29, 0x3e ; 62 // I/O ports DDRB = 0x00; 88: 14 b8 out 0x04, r1 ; 4 PORTB = 0x00; 8a: 15 b8 out 0x05, r1 ; 5 DDRC = 0x01; //DEBUG: pin1 output 8c: 81 e0 ldi r24, 0x01 ; 1 8e: 87 b9 out 0x07, r24 ; 7 PORTC = 0x00; 90: 18 b8 out 0x08, r1 ; 8 DDRD = 0x20; 92: 80 e2 ldi r24, 0x20 ; 32 94: 8a b9 out 0x0a, r24 ; 10 PORTD = 0x00; 96: 1b b8 out 0x0b, r1 ; 11 DDRB |= (1<<4); //DEBUG 98: 24 9a sbi 0x04, 4 ; 4 //timer0 (pwm) //set fast pwm mode TCCR0A |= (1<>8))>>8); } lp0 = (((0xff-g_info.lowpass)*lp0) >> 8) + ((g_info.lowpass*oscs)>>8) e8: 3f ef ldi r19, 0xFF ; 255 ea: c3 2e mov r12, r19 ec: d1 2c mov r13, r1 uint16_t osc[3]; int8_t lp0=0, lp1=0, lp2=0; for(;;){ PORTC |= (1<<0); ee: 40 9a sbi 0x08, 0 ; 8 while(g_sample_flag == 0); f0: 80 91 00 01 lds r24, 0x0100 f4: 88 23 and r24, r24 f6: e1 f3 breq .-8 ; 0xf0 g_sample_flag = 0; f8: 10 92 00 01 sts 0x0100, r1 PORTC &= ~(1<<0); fc: 40 98 cbi 0x08, 0 ; 8 fe: d5 01 movw r26, r10 100: 70 e0 ldi r23, 0x00 ; 0 102: 40 e0 ldi r20, 0x00 ; 0 104: 50 e0 ldi r21, 0x00 ; 0 int8_t oscs = 0; uint8_t i; for(i=0; i<3; i++){ osc[i] += g_info.oscfreq[i]; 106: fa 01 movw r30, r20 108: ee 0f add r30, r30 10a: ff 1f adc r31, r31 10c: ef 5f subi r30, 0xFF ; 255 10e: fe 4f sbci r31, 0xFE ; 254 110: 23 81 ldd r18, Z+3 ; 0x03 112: 34 81 ldd r19, Z+4 ; 0x04 114: 8d 91 ld r24, X+ 116: 9c 91 ld r25, X 118: 11 97 sbiw r26, 0x01 ; 1 11a: 28 0f add r18, r24 11c: 39 1f adc r19, r25 11e: 2d 93 st X+, r18 120: 3d 93 st X+, r19 oscs += ((g_info.oscamp[i]*(osc[i]>>8))>>8); 122: fa 01 movw r30, r20 124: ef 5f subi r30, 0xFF ; 255 126: fe 4f sbci r31, 0xFE ; 254 128: 84 85 ldd r24, Z+12 ; 0x0c 12a: 23 2f mov r18, r19 12c: 33 27 eor r19, r19 12e: 90 e0 ldi r25, 0x00 ; 0 130: fc 01 movw r30, r24 132: 2e 9f mul r18, r30 134: c0 01 movw r24, r0 136: 2f 9f mul r18, r31 138: 90 0d add r25, r0 13a: 3e 9f mul r19, r30 13c: 90 0d add r25, r0 13e: 11 24 eor r1, r1 140: 79 0f add r23, r25 142: 4f 5f subi r20, 0xFF ; 255 144: 5f 4f sbci r21, 0xFF ; 255 g_sample_flag = 0; PORTC &= ~(1<<0); int8_t oscs = 0; uint8_t i; for(i=0; i<3; i++){ 146: 43 30 cpi r20, 0x03 ; 3 148: 51 05 cpc r21, r1 14a: e9 f6 brne .-70 ; 0x106 osc[i] += g_info.oscfreq[i]; oscs += ((g_info.oscamp[i]*(osc[i]>>8))>>8); } lp0 = (((0xff-g_info.lowpass)*lp0) >> 8) + ((g_info.lowpass*oscs)>>8) 14c: 80 91 01 01 lds r24, 0x0101 150: 60 91 01 01 lds r22, 0x0101 154: 40 91 03 01 lds r20, 0x0103 158: e1 2f mov r30, r17 15a: ff 27 eor r31, r31 15c: e7 fd sbrc r30, 7 15e: f0 95 com r31 160: 20 2f mov r18, r16 162: 33 27 eor r19, r19 164: 27 fd sbrc r18, 7 166: 30 95 com r19 168: d6 01 movw r26, r12 16a: a8 1b sub r26, r24 16c: b1 09 sbc r27, r1 16e: cd 01 movw r24, r26 170: d9 01 movw r26, r18 172: a8 9f mul r26, r24 174: 90 01 movw r18, r0 176: a9 9f mul r26, r25 178: 30 0d add r19, r0 17a: b8 9f mul r27, r24 17c: 30 0d add r19, r0 17e: 11 24 eor r1, r1 180: 23 2f mov r18, r19 182: 33 0f add r19, r19 184: 33 0b sbc r19, r19 186: 50 e0 ldi r21, 0x00 ; 0 188: e4 9f mul r30, r20 18a: c0 01 movw r24, r0 18c: e5 9f mul r30, r21 18e: 90 0d add r25, r0 190: f4 9f mul r31, r20 192: 90 0d add r25, r0 194: 11 24 eor r1, r1 196: 89 2f mov r24, r25 198: 99 0f add r25, r25 19a: 99 0b sbc r25, r25 19c: 02 2f mov r16, r18 19e: 08 1b sub r16, r24 1a0: 87 2f mov r24, r23 1a2: 99 27 eor r25, r25 1a4: 87 fd sbrc r24, 7 1a6: 90 95 com r25 1a8: 70 e0 ldi r23, 0x00 ; 0 1aa: 9c 01 movw r18, r24 1ac: 26 9f mul r18, r22 1ae: c0 01 movw r24, r0 1b0: 27 9f mul r18, r23 1b2: 90 0d add r25, r0 1b4: 36 9f mul r19, r22 1b6: 90 0d add r25, r0 1b8: 11 24 eor r1, r1 1ba: 89 2f mov r24, r25 1bc: 99 0f add r25, r25 1be: 99 0b sbc r25, r25 1c0: 08 0f add r16, r24 - ((g_info.resonance*lp2) >> 8); lp1 = (((0xff-g_info.lowpass)*lp1) >> 8) + ((g_info.lowpass*lp0) >> 8); 1c2: 60 91 01 01 lds r22, 0x0101 1c6: 80 91 01 01 lds r24, 0x0101 1ca: 20 2f mov r18, r16 1cc: 33 27 eor r19, r19 1ce: 27 fd sbrc r18, 7 1d0: 30 95 com r19 1d2: 90 e0 ldi r25, 0x00 ; 0 1d4: a9 01 movw r20, r18 1d6: 48 9f mul r20, r24 1d8: 90 01 movw r18, r0 1da: 49 9f mul r20, r25 1dc: 30 0d add r19, r0 1de: 58 9f mul r21, r24 1e0: 30 0d add r19, r0 1e2: 11 24 eor r1, r1 1e4: 23 2f mov r18, r19 1e6: 33 0f add r19, r19 1e8: 33 0b sbc r19, r19 1ea: 4f 2d mov r20, r15 1ec: 55 27 eor r21, r21 1ee: 47 fd sbrc r20, 7 1f0: 50 95 com r21 1f2: c6 01 movw r24, r12 1f4: 86 1b sub r24, r22 1f6: 91 09 sbc r25, r1 1f8: bc 01 movw r22, r24 1fa: 46 9f mul r20, r22 1fc: c0 01 movw r24, r0 1fe: 47 9f mul r20, r23 200: 90 0d add r25, r0 202: 56 9f mul r21, r22 204: 90 0d add r25, r0 206: 11 24 eor r1, r1 208: 89 2f mov r24, r25 20a: 99 0f add r25, r25 20c: 99 0b sbc r25, r25 20e: f2 2e mov r15, r18 210: f8 0e add r15, r24 lp2 = (((0xff-g_info.lowpass)*lp2) >> 8) + ((g_info.lowpass*lp1) >> 8); 212: 40 91 01 01 lds r20, 0x0101 216: 80 91 01 01 lds r24, 0x0101 21a: 2f 2d mov r18, r15 21c: 33 27 eor r19, r19 21e: 27 fd sbrc r18, 7 220: 30 95 com r19 222: 90 e0 ldi r25, 0x00 ; 0 224: d9 01 movw r26, r18 226: a8 9f mul r26, r24 228: 90 01 movw r18, r0 22a: a9 9f mul r26, r25 22c: 30 0d add r19, r0 22e: b8 9f mul r27, r24 230: 30 0d add r19, r0 232: 11 24 eor r1, r1 234: 23 2f mov r18, r19 236: 33 0f add r19, r19 238: 33 0b sbc r19, r19 23a: c6 01 movw r24, r12 23c: 84 1b sub r24, r20 23e: 91 09 sbc r25, r1 240: ac 01 movw r20, r24 242: e4 9f mul r30, r20 244: c0 01 movw r24, r0 246: e5 9f mul r30, r21 248: 90 0d add r25, r0 24a: f4 9f mul r31, r20 24c: 90 0d add r25, r0 24e: 11 24 eor r1, r1 250: 89 2f mov r24, r25 252: 99 0f add r25, r25 254: 99 0b sbc r25, r25 256: 12 2f mov r17, r18 258: 18 0f add r17, r24 OCR0B = (((int8_t)(lp2+0x80)*g_info.amp)>>8); 25a: 20 91 02 01 lds r18, 0x0102 25e: 81 2f mov r24, r17 260: 80 58 subi r24, 0x80 ; 128 262: 99 27 eor r25, r25 264: 87 fd sbrc r24, 7 266: 90 95 com r25 268: 30 e0 ldi r19, 0x00 ; 0 26a: bc 01 movw r22, r24 26c: 62 9f mul r22, r18 26e: c0 01 movw r24, r0 270: 63 9f mul r22, r19 272: 90 0d add r25, r0 274: 72 9f mul r23, r18 276: 90 0d add r25, r0 278: 11 24 eor r1, r1 27a: 89 2f mov r24, r25 27c: 99 0f add r25, r25 27e: 99 0b sbc r25, r25 280: 88 bd out 0x28, r24 ; 40 282: 35 cf rjmp .-406 ; 0xee 00000284 <__vector_15>: return 0; } ISR(TIMER0_COMPB_vect) { 284: 1f 92 push r1 286: 0f 92 push r0 288: 0f b6 in r0, 0x3f ; 63 28a: 0f 92 push r0 28c: 11 24 eor r1, r1 28e: 8f 93 push r24 //g_sample_flag = 1; static uint8_t c = 0; c++; 290: 80 91 11 01 lds r24, 0x0111 294: 8f 5f subi r24, 0xFF ; 255 296: 80 93 11 01 sts 0x0111, r24 if(c == 2){ 29a: 82 30 cpi r24, 0x02 ; 2 29c: 29 f4 brne .+10 ; 0x2a8 <__vector_15+0x24> c = 0; 29e: 10 92 11 01 sts 0x0111, r1 g_sample_flag = 1; 2a2: 81 e0 ldi r24, 0x01 ; 1 2a4: 80 93 00 01 sts 0x0100, r24 } } 2a8: 8f 91 pop r24 2aa: 0f 90 pop r0 2ac: 0f be out 0x3f, r0 ; 63 2ae: 0f 90 pop r0 2b0: 1f 90 pop r1 2b2: 18 95 reti 000002b4 <__vector_18>: ISR(USART_RX_vect) { 2b4: 1f 92 push r1 2b6: 0f 92 push r0 2b8: 0f b6 in r0, 0x3f ; 63 2ba: 0f 92 push r0 2bc: 11 24 eor r1, r1 2be: 8f 93 push r24 2c0: ef 93 push r30 2c2: ff 93 push r31 uint8_t data = UDR0; 2c4: 80 91 c6 00 lds r24, 0x00C6 *(uint8_t*)((uint8_t*)(&g_info) + g_infoptr) = data; 2c8: e0 91 10 01 lds r30, 0x0110 2cc: f0 e0 ldi r31, 0x00 ; 0 2ce: ef 5f subi r30, 0xFF ; 255 2d0: fe 4f sbci r31, 0xFE ; 254 2d2: 80 83 st Z, r24 g_infoptr++; 2d4: 80 91 10 01 lds r24, 0x0110 2d8: 8f 5f subi r24, 0xFF ; 255 2da: 80 93 10 01 sts 0x0110, r24 if(g_infoptr >= sizeof(g_info)) g_infoptr = 0; 2de: 80 91 10 01 lds r24, 0x0110 2e2: 8f 30 cpi r24, 0x0F ; 15 2e4: 10 f0 brcs .+4 ; 0x2ea <__vector_18+0x36> 2e6: 10 92 10 01 sts 0x0110, r1 /*if(data==0xaa) g_add = (uint16_t)(150.0/(78125.0/65536.0)); else g_add = (uint16_t)(50.0/(78125.0/65536.0));*/ } 2ea: ff 91 pop r31 2ec: ef 91 pop r30 2ee: 8f 91 pop r24 2f0: 0f 90 pop r0 2f2: 0f be out 0x3f, r0 ; 63 2f4: 0f 90 pop r0 2f6: 1f 90 pop r1 2f8: 18 95 reti 000002fa <_exit>: 2fa: f8 94 cli 000002fc <__stop_program>: 2fc: ff cf rjmp .-2 ; 0x2fc <__stop_program>