Although functional, the limited read/write memory is needless used to redundantly store static read-only initialization data/strings effectively eliminates this memory from having any useful purpose. main.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn 0 .data 00000062 00800100 00000afc 00000b90 2**0 CONTENTS, ALLOC, LOAD, DATA 1 .text 00000afc 00000000 00000000 00000094 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .bss 0000000a 00800162 00800162 00000bf2 2**0 ALLOC 3 .noinit 00000000 0080016c 0080016c 00000bf2 2**0 CONTENTS 4 .eeprom 00000000 00810000 00810000 00000bf2 2**0 CONTENTS 5 .stab 00001c80 00000000 00000000 00000bf4 2**2 CONTENTS, READONLY, DEBUGGING 6 .stabstr 00000daa 00000000 00000000 00002874 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 46 00 jmp 0x8c <__ctors_end> 4: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 8: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 10: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 14: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 18: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 1c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 20: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 24: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 28: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 2c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 30: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 34: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 38: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 3c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 40: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 44: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 48: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 4c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 50: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 54: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 58: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 5c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 60: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 64: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 68: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 6c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 70: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 74: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 78: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 7c: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 80: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 84: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 88: 0c 94 61 00 jmp 0xc2 <__bad_interrupt> 0000008c <__ctors_end>: 8c: 11 24 eor r1, r1 8e: 1f be out 0x3f, r1 ; 63 90: cf ef ldi r28, 0xFF ; 255 92: d0 e1 ldi r29, 0x10 ; 16 94: de bf out 0x3e, r29 ; 62 96: cd bf out 0x3d, r28 ; 61 00000098 <__do_copy_data>: 98: 11 e0 ldi r17, 0x01 ; 1 9a: a0 e0 ldi r26, 0x00 ; 0 9c: b1 e0 ldi r27, 0x01 ; 1 9e: ec ef ldi r30, 0xFC ; 252 a0: fa e0 ldi r31, 0x0A ; 10 a2: 02 c0 rjmp .+4 ; 0xa8 <.do_copy_data_start> 000000a4 <.do_copy_data_loop>: [copies data in read-only-memory to ram needlessly] a4: 05 90 lpm r0, Z+ a6: 0d 92 st X+, r0 000000a8 <.do_copy_data_start>: a8: a2 36 cpi r26, 0x62 ; 98 aa: b1 07 cpc r27, r17 ac: d9 f7 brne .-10 ; 0xa4 <.do_copy_data_loop> 000000ae <__do_clear_bss>: ae: 11 e0 ldi r17, 0x01 ; 1 b0: a2 e6 ldi r26, 0x62 ; 98 b2: b1 e0 ldi r27, 0x01 ; 1 b4: 01 c0 rjmp .+2 ; 0xb8 <.do_clear_bss_start> 000000b6 <.do_clear_bss_loop>: b6: 1d 92 st X+, r1 000000b8 <.do_clear_bss_start>: b8: ac 36 cpi r26, 0x6C ; 108 ba: b1 07 cpc r27, r17 bc: e1 f7 brne .-8 ; 0xb6 <.do_clear_bss_loop> be: 0c 94 63 00 jmp 0xc6 <main> 000000c2 <__bad_interrupt>: c2: 0c 94 00 00 jmp 0x0 <__heap_end> 000000c6 <main>: int main (void){ c6: cf ef ldi r28, 0xFF ; 255 c8: d0 e1 ldi r29, 0x10 ; 16 ca: de bf out 0x3e, r29 ; 62 cc: cd bf out 0x3d, r28 ; 61 printf (" asjdfljaslkdjfkalsjdfklasdkf asldkjf;klasdjd aslkdjflkasjfklas alksjdflkjasf alsjdfklsadf"); ce: 80 e0 ldi r24, 0x00 ; 0 d0: 91 e0 ldi r25, 0x01 ; 1 d2: 9f 93 push r25 d4: 8f 93 push r24 d6: 0e 94 73 00 call 0xe6 <printf> da: 0f 90 pop r0 dc: 0f 90 pop r0 } de: 80 e0 ldi r24, 0x00 ; 0 e0: 90 e0 ldi r25, 0x00 ; 0 e2: 0c 94 7d 05 jmp 0xafa <_exit> 000000e6 <printf>: #include <stdio.h> int printf(const char *fmt, ...) { e6: cf 93 push r28 e8: df 93 push r29 ea: cd b7 in r28, 0x3d ; 61 ec: de b7 in r29, 0x3e ; 62 ee: 22 97 sbiw r28, 0x02 ; 2 f0: 0f b6 in r0, 0x3f ; 63 f2: f8 94 cli f4: de bf out 0x3e, r29 ; 62 f6: 0f be out 0x3f, r0 ; 63 f8: cd bf out 0x3d, r28 ; 61 fa: e7 e0 ldi r30, 0x07 ; 7 fc: f0 e0 ldi r31, 0x00 ; 0 fe: ec 0f add r30, r28 100: fd 1f adc r31, r29 102: 61 91 ld r22, Z+ 104: 71 91 ld r23, Z+ va_list ap; int i; va_start(ap, fmt); 106: e9 83 std Y+1, r30 ; 0x01 108: fa 83 std Y+2, r31 ; 0x02 i = vfprintf(stdout, fmt, ap); 10a: af 01 movw r20, r30 10c: 80 91 64 01 lds r24, 0x0164 110: 90 91 65 01 lds r25, 0x0165 114: 0e 94 95 00 call 0x12a <vfprintf> 118: 22 96 adiw r28, 0x02 ; 2 11a: 0f b6 in r0, 0x3f ; 63 11c: f8 94 cli 11e: de bf out 0x3e, r29 ; 62 120: 0f be out 0x3f, r0 ; 63 122: cd bf out 0x3d, r28 ; 61 124: df 91 pop r29 126: cf 91 pop r28 128: 08 95 ret 0000012a <vfprintf>: va_end(ap); return i; } 12a: 2f 92 push r2 12c: 3f 92 push r3 12e: 4f 92 push r4 130: 5f 92 push r5 132: 6f 92 push r6 134: 7f 92 push r7 136: 8f 92 push r8 138: 9f 92 push r9 13a: af 92 push r10 13c: bf 92 push r11 13e: cf 92 push r12 140: df 92 push r13 142: ef 92 push r14 144: ff 92 push r15 146: 0f 93 push r16 148: 1f 93 push r17 14a: cf 93 push r28 14c: df 93 push r29 14e: cd b7 in r28, 0x3d ; 61 150: de b7 in r29, 0x3e ; 62 152: 62 97 sbiw r28, 0x12 ; 18 154: 0f b6 in r0, 0x3f ; 63 156: f8 94 cli 158: de bf out 0x3e, r29 ; 62 15a: 0f be out 0x3f, r0 ; 63 15c: cd bf out 0x3d, r28 ; 61 15e: 88 24 eor r8, r8 160: 99 24 eor r9, r9 162: 54 01 movw r10, r8 164: 2c 01 movw r4, r24 166: 69 8b std Y+17, r22 ; 0x11 168: 7a 8b std Y+18, r23 ; 0x12 16a: 3a 01 movw r6, r20 16c: fc 01 movw r30, r24 16e: 16 82 std Z+6, r1 ; 0x06 170: 17 82 std Z+7, r1 ; 0x07 172: 83 81 ldd r24, Z+3 ; 0x03 174: 81 fd sbrc r24, 1 176: 6e c2 rjmp .+1244 ; 0x654 <vfprintf+0x52a> 178: 8f ef ldi r24, 0xFF ; 255 17a: 9f ef ldi r25, 0xFF ; 255 17c: 91 c2 rjmp .+1314 ; 0x6a0 <vfprintf+0x576> 17e: 29 89 ldd r18, Y+17 ; 0x11 180: 3a 89 ldd r19, Y+18 ; 0x12 182: 2f 5f subi r18, 0xFF ; 255 184: 3f 4f sbci r19, 0xFF ; 255 186: 29 8b std Y+17, r18 ; 0x11 188: 3a 8b std Y+18, r19 ; 0x12 18a: c0 fe sbrs r12, 0 18c: 66 c2 rjmp .+1228 ; 0x65a <vfprintf+0x530> 18e: 83 2d mov r24, r3 190: 80 53 subi r24, 0x30 ; 48 192: 8a 30 cpi r24, 0x0A ; 10 194: e0 f4 brcc .+56 ; 0x1ce <vfprintf+0xa4> 196: 30 e3 ldi r19, 0x30 ; 48 198: 33 16 cp r3, r19 19a: 41 f4 brne .+16 ; 0x1ac <vfprintf+0x82> 19c: 8d 85 ldd r24, Y+13 ; 0x0d 19e: 88 23 and r24, r24 1a0: 29 f4 brne .+10 ; 0x1ac <vfprintf+0x82> 1a2: c3 fc sbrc r12, 3 1a4: 03 c0 rjmp .+6 ; 0x1ac <vfprintf+0x82> 1a6: e0 e0 ldi r30, 0x00 ; 0 1a8: f1 e0 ldi r31, 0x01 ; 1 1aa: 7b c0 rjmp .+246 ; 0x2a2 <vfprintf+0x178> 1ac: 8a e0 ldi r24, 0x0A ; 10 1ae: fd 85 ldd r31, Y+13 ; 0x0d 1b0: f8 02 muls r31, r24 1b2: c0 01 movw r24, r0 1b4: 11 24 eor r1, r1 1b6: 38 0e add r3, r24 1b8: 23 2d mov r18, r3 1ba: 20 53 subi r18, 0x30 ; 48 1bc: 2d 87 std Y+13, r18 ; 0x0d 1be: 27 ff sbrs r18, 7 1c0: 02 c0 rjmp .+4 ; 0x1c6 <vfprintf+0x9c> 1c2: 3f e7 ldi r19, 0x7F ; 127 1c4: 3d 87 std Y+13, r19 ; 0x0d 1c6: c3 fc sbrc r12, 3 1c8: 5a c2 rjmp .+1204 ; 0x67e <vfprintf+0x554> 1ca: 2d 84 ldd r2, Y+13 ; 0x0d 1cc: 58 c2 rjmp .+1200 ; 0x67e <vfprintf+0x554> 1ce: c6 01 movw r24, r12 1d0: b3 e0 ldi r27, 0x03 ; 3 1d2: 96 95 lsr r25 1d4: 87 95 ror r24 1d6: ba 95 dec r27 1d8: e1 f7 brne .-8 ; 0x1d2 <vfprintf+0xa8> 1da: 81 70 andi r24, 0x01 ; 1 1dc: 90 70 andi r25, 0x00 ; 0 1de: 28 2f mov r18, r24 1e0: 88 23 and r24, r24 1e2: 29 f0 breq .+10 ; 0x1ee <vfprintf+0xc4> 1e4: 8d 85 ldd r24, Y+13 ; 0x0d 1e6: 88 23 and r24, r24 1e8: 11 f4 brne .+4 ; 0x1ee <vfprintf+0xc4> 1ea: 91 e0 ldi r25, 0x01 ; 1 1ec: 9d 87 std Y+13, r25 ; 0x0d 1ee: 83 2d mov r24, r3 1f0: 99 27 eor r25, r25 1f2: 87 fd sbrc r24, 7 1f4: 90 95 com r25 1f6: e7 e6 ldi r30, 0x67 ; 103 1f8: e3 15 cp r30, r3 1fa: 64 f1 brlt .+88 ; 0x254 <vfprintf+0x12a> 1fc: f5 e6 ldi r31, 0x65 ; 101 1fe: 3f 16 cp r3, r31 200: 0c f0 brlt .+2 ; 0x204 <vfprintf+0xda> 202: 65 c0 rjmp .+202 ; 0x2ce <vfprintf+0x1a4> 204: 33 e5 ldi r19, 0x53 ; 83 206: 33 16 cp r3, r19 208: 09 f4 brne .+2 ; 0x20c <vfprintf+0xe2> 20a: 8f c0 rjmp .+286 ; 0x32a <vfprintf+0x200> 20c: 33 15 cp r19, r3 20e: b4 f0 brlt .+44 ; 0x23c <vfprintf+0x112> 210: eb e2 ldi r30, 0x2B ; 43 212: 3e 16 cp r3, r30 214: 09 f4 brne .+2 ; 0x218 <vfprintf+0xee> 216: 3f c0 rjmp .+126 ; 0x296 <vfprintf+0x16c> 218: e3 15 cp r30, r3 21a: 44 f0 brlt .+16 ; 0x22c <vfprintf+0x102> 21c: f0 e2 ldi r31, 0x20 ; 32 21e: 3f 16 cp r3, r31 220: f1 f1 breq .+124 ; 0x29e <vfprintf+0x174> 222: 23 e2 ldi r18, 0x23 ; 35 224: 32 16 cp r3, r18 226: 09 f0 breq .+2 ; 0x22a <vfprintf+0x100> 228: 12 c2 rjmp .+1060 ; 0x64e <vfprintf+0x524> 22a: 41 c0 rjmp .+130 ; 0x2ae <vfprintf+0x184> 22c: 3d e2 ldi r19, 0x2D ; 45 22e: 33 16 cp r3, r19 230: d9 f1 breq .+118 ; 0x2a8 <vfprintf+0x17e> 232: ee e2 ldi r30, 0x2E ; 46 234: 3e 16 cp r3, r30 236: 09 f0 breq .+2 ; 0x23a <vfprintf+0x110> 238: 0a c2 rjmp .+1044 ; 0x64e <vfprintf+0x524> 23a: 3e c0 rjmp .+124 ; 0x2b8 <vfprintf+0x18e> 23c: f3 e6 ldi r31, 0x63 ; 99 23e: 3f 16 cp r3, r31 240: 09 f4 brne .+2 ; 0x244 <vfprintf+0x11a> 242: 4b c0 rjmp .+150 ; 0x2da <vfprintf+0x1b0> 244: f3 15 cp r31, r3 246: 0c f4 brge .+2 ; 0x24a <vfprintf+0x120> 248: 8a c0 rjmp .+276 ; 0x35e <vfprintf+0x234> 24a: 28 e5 ldi r18, 0x58 ; 88 24c: 32 16 cp r3, r18 24e: 09 f0 breq .+2 ; 0x252 <vfprintf+0x128> 250: fe c1 rjmp .+1020 ; 0x64e <vfprintf+0x524> 252: b5 c0 rjmp .+362 ; 0x3be <vfprintf+0x294> 254: 30 e7 ldi r19, 0x70 ; 112 256: 33 16 cp r3, r19 258: 09 f4 brne .+2 ; 0x25c <vfprintf+0x132> 25a: ab c0 rjmp .+342 ; 0x3b2 <vfprintf+0x288> 25c: 33 15 cp r19, r3 25e: 5c f0 brlt .+22 ; 0x276 <vfprintf+0x14c> 260: ec e6 ldi r30, 0x6C ; 108 262: 3e 16 cp r3, r30 264: 79 f1 breq .+94 ; 0x2c4 <vfprintf+0x19a> 266: ff e6 ldi r31, 0x6F ; 111 268: 3f 16 cp r3, r31 26a: 91 f0 breq .+36 ; 0x290 <vfprintf+0x166> 26c: 29 e6 ldi r18, 0x69 ; 105 26e: 32 16 cp r3, r18 270: 09 f0 breq .+2 ; 0x274 <vfprintf+0x14a> 272: ed c1 rjmp .+986 ; 0x64e <vfprintf+0x524> 274: 74 c0 rjmp .+232 ; 0x35e <vfprintf+0x234> 276: 35 e7 ldi r19, 0x75 ; 117 278: 33 16 cp r3, r19 27a: 09 f4 brne .+2 ; 0x27e <vfprintf+0x154> 27c: a2 c0 rjmp .+324 ; 0x3c2 <vfprintf+0x298> 27e: e8 e7 ldi r30, 0x78 ; 120 280: 3e 16 cp r3, r30 282: 09 f4 brne .+2 ; 0x286 <vfprintf+0x15c> 284: 9c c0 rjmp .+312 ; 0x3be <vfprintf+0x294> 286: f3 e7 ldi r31, 0x73 ; 115 288: 3f 16 cp r3, r31 28a: 09 f0 breq .+2 ; 0x28e <vfprintf+0x164> 28c: e0 c1 rjmp .+960 ; 0x64e <vfprintf+0x524> 28e: 2d c0 rjmp .+90 ; 0x2ea <vfprintf+0x1c0> 290: 28 e0 ldi r18, 0x08 ; 8 292: 28 8b std Y+16, r18 ; 0x10 294: 96 c0 rjmp .+300 ; 0x3c2 <vfprintf+0x298> 296: 80 e1 ldi r24, 0x10 ; 16 298: 90 e0 ldi r25, 0x00 ; 0 29a: c8 2a or r12, r24 29c: d9 2a or r13, r25 29e: e0 e2 ldi r30, 0x20 ; 32 2a0: f0 e0 ldi r31, 0x00 ; 0 2a2: ce 2a or r12, r30 2a4: df 2a or r13, r31 2a6: eb c1 rjmp .+982 ; 0x67e <vfprintf+0x554> 2a8: 20 e8 ldi r18, 0x80 ; 128 2aa: 30 e0 ldi r19, 0x00 ; 0 2ac: 0d c0 rjmp .+26 ; 0x2c8 <vfprintf+0x19e> 2ae: 80 e4 ldi r24, 0x40 ; 64 2b0: 90 e0 ldi r25, 0x00 ; 0 2b2: c8 2a or r12, r24 2b4: d9 2a or r13, r25 2b6: e3 c1 rjmp .+966 ; 0x67e <vfprintf+0x554> 2b8: e8 e0 ldi r30, 0x08 ; 8 2ba: f0 e0 ldi r31, 0x00 ; 0 2bc: ce 2a or r12, r30 2be: df 2a or r13, r31 2c0: 1d 86 std Y+13, r1 ; 0x0d 2c2: dd c1 rjmp .+954 ; 0x67e <vfprintf+0x554> 2c4: 24 e0 ldi r18, 0x04 ; 4 2c6: 30 e0 ldi r19, 0x00 ; 0 2c8: c2 2a or r12, r18 2ca: d3 2a or r13, r19 2cc: d8 c1 rjmp .+944 ; 0x67e <vfprintf+0x554> 2ce: af e3 ldi r26, 0x3F ; 63 2d0: 8a 2e mov r8, r26 2d2: 2a 94 dec r2 2d4: f3 e6 ldi r31, 0x63 ; 99 2d6: 3f 2e mov r3, r31 2d8: 44 c1 rjmp .+648 ; 0x562 <vfprintf+0x438> 2da: f3 01 movw r30, r6 2dc: 80 80 ld r8, Z 2de: 2a 94 dec r2 2e0: 22 e0 ldi r18, 0x02 ; 2 2e2: 30 e0 ldi r19, 0x00 ; 0 2e4: 62 0e add r6, r18 2e6: 73 1e adc r7, r19 2e8: 3c c1 rjmp .+632 ; 0x562 <vfprintf+0x438> 2ea: 83 01 movw r16, r6 2ec: 0e 5f subi r16, 0xFE ; 254 2ee: 1f 4f sbci r17, 0xFF ; 255 2f0: f3 01 movw r30, r6 2f2: a0 81 ld r26, Z 2f4: b1 81 ldd r27, Z+1 ; 0x01 2f6: 4d 01 movw r8, r26 2f8: 22 23 and r18, r18 2fa: 51 f0 breq .+20 ; 0x310 <vfprintf+0x1e6> 2fc: fd 85 ldd r31, Y+13 ; 0x0d 2fe: 6f 2f mov r22, r31 300: 77 27 eor r23, r23 302: 67 fd sbrc r22, 7 304: 70 95 com r23 306: cd 01 movw r24, r26 308: 0e 94 f1 03 call 0x7e2 <strnlen> 30c: 88 8b std Y+16, r24 ; 0x10 30e: 07 c0 rjmp .+14 ; 0x31e <vfprintf+0x1f4> 310: fd 01 movw r30, r26 312: 01 90 ld r0, Z+ 314: 00 20 and r0, r0 316: e9 f7 brne .-6 ; 0x312 <vfprintf+0x1e8> 318: 31 97 sbiw r30, 0x01 ; 1 31a: ea 1b sub r30, r26 31c: e8 8b std Y+16, r30 ; 0x10 31e: 28 89 ldd r18, Y+16 ; 0x10 320: 22 1a sub r2, r18 322: 38 01 movw r6, r16 324: e3 e7 ldi r30, 0x73 ; 115 326: 3e 2e mov r3, r30 328: 1c c1 rjmp .+568 ; 0x562 <vfprintf+0x438> 32a: 83 01 movw r16, r6 32c: 0e 5f subi r16, 0xFE ; 254 32e: 1f 4f sbci r17, 0xFF ; 255 330: f3 01 movw r30, r6 332: 80 81 ld r24, Z 334: 91 81 ldd r25, Z+1 ; 0x01 336: 4c 01 movw r8, r24 338: 22 23 and r18, r18 33a: 41 f0 breq .+16 ; 0x34c <vfprintf+0x222> 33c: fd 85 ldd r31, Y+13 ; 0x0d 33e: 6f 2f mov r22, r31 340: 77 27 eor r23, r23 342: 67 fd sbrc r22, 7 344: 70 95 com r23 346: 0e 94 fc 03 call 0x7f8 <strnlen_P> 34a: 02 c0 rjmp .+4 ; 0x350 <vfprintf+0x226> 34c: 0e 94 e8 03 call 0x7d0 <strlen_P> 350: 88 8b std Y+16, r24 ; 0x10 352: 28 89 ldd r18, Y+16 ; 0x10 354: 22 1a sub r2, r18 356: 38 01 movw r6, r16 358: 73 e5 ldi r23, 0x53 ; 83 35a: 37 2e mov r3, r23 35c: 02 c1 rjmp .+516 ; 0x562 <vfprintf+0x438> 35e: c2 fe sbrs r12, 2 360: 08 c0 rjmp .+16 ; 0x372 <vfprintf+0x248> 362: f3 01 movw r30, r6 364: 80 81 ld r24, Z 366: 91 81 ldd r25, Z+1 ; 0x01 368: a2 81 ldd r26, Z+2 ; 0x02 36a: b3 81 ldd r27, Z+3 ; 0x03 36c: 24 e0 ldi r18, 0x04 ; 4 36e: 30 e0 ldi r19, 0x00 ; 0 370: 09 c0 rjmp .+18 ; 0x384 <vfprintf+0x25a> 372: f3 01 movw r30, r6 374: 80 81 ld r24, Z 376: 91 81 ldd r25, Z+1 ; 0x01 378: aa 27 eor r26, r26 37a: 97 fd sbrc r25, 7 37c: a0 95 com r26 37e: ba 2f mov r27, r26 380: 22 e0 ldi r18, 0x02 ; 2 382: 30 e0 ldi r19, 0x00 ; 0 384: 62 0e add r6, r18 386: 73 1e adc r7, r19 388: 4c 01 movw r8, r24 38a: 5d 01 movw r10, r26 38c: b7 ff sbrs r27, 7 38e: 0c c0 rjmp .+24 ; 0x3a8 <vfprintf+0x27e> 390: 82 e0 ldi r24, 0x02 ; 2 392: 90 e0 ldi r25, 0x00 ; 0 394: c8 2a or r12, r24 396: d9 2a or r13, r25 398: b0 94 com r11 39a: a0 94 com r10 39c: 90 94 com r9 39e: 80 94 com r8 3a0: 81 1c adc r8, r1 3a2: 91 1c adc r9, r1 3a4: a1 1c adc r10, r1 3a6: b1 1c adc r11, r1 3a8: ef eb ldi r30, 0xBF ; 191 3aa: ff ef ldi r31, 0xFF ; 255 3ac: ce 22 and r12, r30 3ae: df 22 and r13, r31 3b0: 21 c0 rjmp .+66 ; 0x3f4 <vfprintf+0x2ca> 3b2: 20 e4 ldi r18, 0x40 ; 64 3b4: 30 e0 ldi r19, 0x00 ; 0 3b6: c2 2a or r12, r18 3b8: d3 2a or r13, r19 3ba: 68 e7 ldi r22, 0x78 ; 120 3bc: 36 2e mov r3, r22 3be: 30 e1 ldi r19, 0x10 ; 16 3c0: 38 8b std Y+16, r19 ; 0x10 3c2: c2 fe sbrs r12, 2 3c4: 08 c0 rjmp .+16 ; 0x3d6 <vfprintf+0x2ac> 3c6: f3 01 movw r30, r6 3c8: 80 81 ld r24, Z 3ca: 91 81 ldd r25, Z+1 ; 0x01 3cc: a2 81 ldd r26, Z+2 ; 0x02 3ce: b3 81 ldd r27, Z+3 ; 0x03 3d0: 24 e0 ldi r18, 0x04 ; 4 3d2: 30 e0 ldi r19, 0x00 ; 0 3d4: 07 c0 rjmp .+14 ; 0x3e4 <vfprintf+0x2ba> 3d6: f3 01 movw r30, r6 3d8: 80 81 ld r24, Z 3da: 91 81 ldd r25, Z+1 ; 0x01 3dc: aa 27 eor r26, r26 3de: bb 27 eor r27, r27 3e0: 22 e0 ldi r18, 0x02 ; 2 3e2: 30 e0 ldi r19, 0x00 ; 0 3e4: 62 0e add r6, r18 3e6: 73 1e adc r7, r19 3e8: 4c 01 movw r8, r24 3ea: 5d 01 movw r10, r26 3ec: 8f ec ldi r24, 0xCF ; 207 3ee: 9f ef ldi r25, 0xFF ; 255 3f0: c8 22 and r12, r24 3f2: d9 22 and r13, r25 3f4: 85 01 movw r16, r10 3f6: 74 01 movw r14, r8 3f8: fe 01 movw r30, r28 3fa: 31 96 adiw r30, 0x01 ; 1 3fc: ee 87 std Y+14, r30 ; 0x0e 3fe: ff 87 std Y+15, r31 ; 0x0f 400: f8 89 ldd r31, Y+16 ; 0x10 402: 8f 2e mov r8, r31 404: 99 24 eor r9, r9 406: aa 24 eor r10, r10 408: bb 24 eor r11, r11 40a: c8 01 movw r24, r16 40c: b7 01 movw r22, r14 40e: a5 01 movw r20, r10 410: 94 01 movw r18, r8 412: 0e 94 5b 05 call 0xab6 <__udivmodsi4> 416: 6a 30 cpi r22, 0x0A ; 10 418: 1c f0 brlt .+6 ; 0x420 <vfprintf+0x2f6> 41a: 63 0d add r22, r3 41c: 61 52 subi r22, 0x21 ; 33 41e: 01 c0 rjmp .+2 ; 0x422 <vfprintf+0x2f8> 420: 60 5d subi r22, 0xD0 ; 208 422: ee 85 ldd r30, Y+14 ; 0x0e 424: ff 85 ldd r31, Y+15 ; 0x0f 426: 61 93 st Z+, r22 428: ee 87 std Y+14, r30 ; 0x0e 42a: ff 87 std Y+15, r31 ; 0x0f 42c: c8 01 movw r24, r16 42e: b7 01 movw r22, r14 430: a5 01 movw r20, r10 432: 94 01 movw r18, r8 434: 0e 94 5b 05 call 0xab6 <__udivmodsi4> 438: 79 01 movw r14, r18 43a: 8a 01 movw r16, r20 43c: 21 15 cp r18, r1 43e: 31 05 cpc r19, r1 440: 41 05 cpc r20, r1 442: 51 05 cpc r21, r1 444: 11 f7 brne .-60 ; 0x40a <vfprintf+0x2e0> 446: 88 24 eor r8, r8 448: 99 24 eor r9, r9 44a: 54 01 movw r10, r8 44c: ce 01 movw r24, r28 44e: 01 96 adiw r24, 0x01 ; 1 450: 4e 85 ldd r20, Y+14 ; 0x0e 452: 48 1b sub r20, r24 454: 84 2e mov r8, r20 456: c6 01 movw r24, r12 458: 82 73 andi r24, 0x32 ; 50 45a: 90 70 andi r25, 0x00 ; 0 45c: 89 2b or r24, r25 45e: 09 f0 breq .+2 ; 0x462 <vfprintf+0x338> 460: 2a 94 dec r2 462: c6 fe sbrs r12, 6 464: 07 c0 rjmp .+14 ; 0x474 <vfprintf+0x34a> 466: f8 89 ldd r31, Y+16 ; 0x10 468: f0 31 cpi r31, 0x10 ; 16 46a: 11 f4 brne .+4 ; 0x470 <vfprintf+0x346> 46c: 82 e0 ldi r24, 0x02 ; 2 46e: 01 c0 rjmp .+2 ; 0x472 <vfprintf+0x348> 470: 81 e0 ldi r24, 0x01 ; 1 472: 28 1a sub r2, r24 474: c3 fe sbrs r12, 3 476: 12 c0 rjmp .+36 ; 0x49c <vfprintf+0x372> 478: 8d 85 ldd r24, Y+13 ; 0x0d 47a: 28 2f mov r18, r24 47c: 33 27 eor r19, r19 47e: 27 fd sbrc r18, 7 480: 30 95 com r19 482: 84 2f mov r24, r20 484: 99 27 eor r25, r25 486: 82 17 cp r24, r18 488: 93 07 cpc r25, r19 48a: 2c f0 brlt .+10 ; 0x496 <vfprintf+0x36c> 48c: e7 ef ldi r30, 0xF7 ; 247 48e: ff ef ldi r31, 0xFF ; 255 490: ce 22 and r12, r30 492: df 22 and r13, r31 494: 03 c0 rjmp .+6 ; 0x49c <vfprintf+0x372> 496: fd 85 ldd r31, Y+13 ; 0x0d 498: f4 1b sub r31, r20 49a: fd 87 std Y+13, r31 ; 0x0d 49c: c6 01 movw r24, r12 49e: 53 e0 ldi r21, 0x03 ; 3 4a0: 96 95 lsr r25 4a2: 87 95 ror r24 4a4: 5a 95 dec r21 4a6: e1 f7 brne .-8 ; 0x4a0 <vfprintf+0x376> 4a8: 81 70 andi r24, 0x01 ; 1 4aa: 90 70 andi r25, 0x00 ; 0 4ac: 08 2f mov r16, r24 4ae: 88 23 and r24, r24 4b0: 19 f0 breq .+6 ; 0x4b8 <vfprintf+0x38e> 4b2: 2d 85 ldd r18, Y+13 ; 0x0d 4b4: 22 1a sub r2, r18 4b6: 01 c0 rjmp .+2 ; 0x4ba <vfprintf+0x390> 4b8: 24 1a sub r2, r20 4ba: c6 01 movw r24, r12 4bc: 80 78 andi r24, 0x80 ; 128 4be: 91 70 andi r25, 0x01 ; 1 4c0: 89 2b or r24, r25 4c2: 69 f4 brne .+26 ; 0x4de <vfprintf+0x3b4> 4c4: 82 2d mov r24, r2 4c6: 06 c0 rjmp .+12 ; 0x4d4 <vfprintf+0x3aa> 4c8: b2 01 movw r22, r4 4ca: 80 e2 ldi r24, 0x20 ; 32 4cc: 90 e0 ldi r25, 0x00 ; 0 4ce: 0e 94 b4 03 call 0x768 <fputc> 4d2: 81 2f mov r24, r17 4d4: 18 2f mov r17, r24 4d6: 11 50 subi r17, 0x01 ; 1 4d8: 18 16 cp r1, r24 4da: b4 f3 brlt .-20 ; 0x4c8 <vfprintf+0x39e> 4dc: 21 2e mov r2, r17 4de: c1 fe sbrs r12, 1 4e0: 04 c0 rjmp .+8 ; 0x4ea <vfprintf+0x3c0> 4e2: b2 01 movw r22, r4 4e4: 8d e2 ldi r24, 0x2D ; 45 4e6: 90 e0 ldi r25, 0x00 ; 0 4e8: 0b c0 rjmp .+22 ; 0x500 <vfprintf+0x3d6> 4ea: c4 fe sbrs r12, 4 4ec: 04 c0 rjmp .+8 ; 0x4f6 <vfprintf+0x3cc> 4ee: b2 01 movw r22, r4 4f0: 8b e2 ldi r24, 0x2B ; 43 4f2: 90 e0 ldi r25, 0x00 ; 0 4f4: 05 c0 rjmp .+10 ; 0x500 <vfprintf+0x3d6> 4f6: c5 fe sbrs r12, 5 4f8: 05 c0 rjmp .+10 ; 0x504 <vfprintf+0x3da> 4fa: b2 01 movw r22, r4 4fc: 80 e2 ldi r24, 0x20 ; 32 4fe: 90 e0 ldi r25, 0x00 ; 0 500: 0e 94 b4 03 call 0x768 <fputc> 504: c6 fe sbrs r12, 6 506: 0f c0 rjmp .+30 ; 0x526 <vfprintf+0x3fc> 508: b2 01 movw r22, r4 50a: 80 e3 ldi r24, 0x30 ; 48 50c: 90 e0 ldi r25, 0x00 ; 0 50e: 0e 94 b4 03 call 0x768 <fputc> 512: 38 89 ldd r19, Y+16 ; 0x10 514: 30 31 cpi r19, 0x10 ; 16 516: 39 f4 brne .+14 ; 0x526 <vfprintf+0x3fc> 518: b2 01 movw r22, r4 51a: 83 2d mov r24, r3 51c: 99 27 eor r25, r25 51e: 87 fd sbrc r24, 7 520: 90 95 com r25 522: 0e 94 b4 03 call 0x768 <fputc> 526: d0 fe sbrs r13, 0 528: 0d c0 rjmp .+26 ; 0x544 <vfprintf+0x41a> 52a: 82 2d mov r24, r2 52c: 06 c0 rjmp .+12 ; 0x53a <vfprintf+0x410> 52e: b2 01 movw r22, r4 530: 80 e3 ldi r24, 0x30 ; 48 532: 90 e0 ldi r25, 0x00 ; 0 534: 0e 94 b4 03 call 0x768 <fputc> 538: 81 2f mov r24, r17 53a: 18 2f mov r17, r24 53c: 11 50 subi r17, 0x01 ; 1 53e: 18 16 cp r1, r24 540: b4 f3 brlt .-20 ; 0x52e <vfprintf+0x404> 542: 21 2e mov r2, r17 544: 00 23 and r16, r16 546: 69 f0 breq .+26 ; 0x562 <vfprintf+0x438> 548: 2d 85 ldd r18, Y+13 ; 0x0d 54a: 06 c0 rjmp .+12 ; 0x558 <vfprintf+0x42e> 54c: b2 01 movw r22, r4 54e: 80 e3 ldi r24, 0x30 ; 48 550: 90 e0 ldi r25, 0x00 ; 0 552: 0e 94 b4 03 call 0x768 <fputc> 556: 21 2f mov r18, r17 558: 12 2f mov r17, r18 55a: 11 50 subi r17, 0x01 ; 1 55c: 12 16 cp r1, r18 55e: b4 f3 brlt .-20 ; 0x54c <vfprintf+0x422> 560: 1d 87 std Y+13, r17 ; 0x0d 562: c6 01 movw r24, r12 564: 88 0f add r24, r24 566: 89 2f mov r24, r25 568: 88 1f adc r24, r24 56a: 99 0b sbc r25, r25 56c: 91 95 neg r25 56e: 21 e0 ldi r18, 0x01 ; 1 570: c2 2e mov r12, r18 572: d1 2c mov r13, r1 574: c8 22 and r12, r24 576: d9 22 and r13, r25 578: 80 fd sbrc r24, 0 57a: 0d c0 rjmp .+26 ; 0x596 <vfprintf+0x46c> 57c: 82 2d mov r24, r2 57e: 06 c0 rjmp .+12 ; 0x58c <vfprintf+0x462> 580: b2 01 movw r22, r4 582: 80 e2 ldi r24, 0x20 ; 32 584: 90 e0 ldi r25, 0x00 ; 0 586: 0e 94 b4 03 call 0x768 <fputc> 58a: 81 2f mov r24, r17 58c: 18 2f mov r17, r24 58e: 11 50 subi r17, 0x01 ; 1 590: 18 16 cp r1, r24 592: b4 f3 brlt .-20 ; 0x580 <vfprintf+0x456> 594: 21 2e mov r2, r17 596: 83 e6 ldi r24, 0x63 ; 99 598: 38 16 cp r3, r24 59a: 41 f4 brne .+16 ; 0x5ac <vfprintf+0x482> 59c: b2 01 movw r22, r4 59e: 88 2d mov r24, r8 5a0: 99 27 eor r25, r25 5a2: 87 fd sbrc r24, 7 5a4: 90 95 com r25 5a6: 0e 94 b4 03 call 0x768 <fputc> 5aa: 41 c0 rjmp .+130 ; 0x62e <vfprintf+0x504> 5ac: 93 e7 ldi r25, 0x73 ; 115 5ae: 39 16 cp r3, r25 5b0: 91 f4 brne .+36 ; 0x5d6 <vfprintf+0x4ac> 5b2: 84 01 movw r16, r8 5b4: ff 24 eor r15, r15 5b6: 0a c0 rjmp .+20 ; 0x5cc <vfprintf+0x4a2> 5b8: f8 01 movw r30, r16 5ba: 81 91 ld r24, Z+ 5bc: 8f 01 movw r16, r30 5be: b2 01 movw r22, r4 5c0: 99 27 eor r25, r25 5c2: 87 fd sbrc r24, 7 5c4: 90 95 com r25 5c6: 0e 94 b4 03 call 0x768 <fputc> 5ca: fa 94 dec r15 5cc: 88 89 ldd r24, Y+16 ; 0x10 5ce: 81 95 neg r24 5d0: f8 16 cp r15, r24 5d2: 91 f7 brne .-28 ; 0x5b8 <vfprintf+0x48e> 5d4: 16 c0 rjmp .+44 ; 0x602 <vfprintf+0x4d8> 5d6: 23 e5 ldi r18, 0x53 ; 83 5d8: 32 16 cp r3, r18 5da: 19 f0 breq .+6 ; 0x5e2 <vfprintf+0x4b8> 5dc: 0e 85 ldd r16, Y+14 ; 0x0e 5de: 1f 85 ldd r17, Y+15 ; 0x0f 5e0: 1f c0 rjmp .+62 ; 0x620 <vfprintf+0x4f6> 5e2: 84 01 movw r16, r8 5e4: ff 24 eor r15, r15 5e6: 09 c0 rjmp .+18 ; 0x5fa <vfprintf+0x4d0> 5e8: f8 01 movw r30, r16 5ea: 84 91 lpm r24, Z 5ec: b2 01 movw r22, r4 5ee: 99 27 eor r25, r25 5f0: 0e 94 b4 03 call 0x768 <fputc> 5f4: 0f 5f subi r16, 0xFF ; 255 5f6: 1f 4f sbci r17, 0xFF ; 255 5f8: fa 94 dec r15 5fa: 88 89 ldd r24, Y+16 ; 0x10 5fc: 81 95 neg r24 5fe: f8 16 cp r15, r24 600: 99 f7 brne .-26 ; 0x5e8 <vfprintf+0x4be> 602: f8 89 ldd r31, Y+16 ; 0x10 604: ff 0d add r31, r15 606: f1 50 subi r31, 0x01 ; 1 608: f8 8b std Y+16, r31 ; 0x10 60a: 48 01 movw r8, r16 60c: 10 c0 rjmp .+32 ; 0x62e <vfprintf+0x504> 60e: f8 01 movw r30, r16 610: 82 91 ld r24, -Z 612: 8f 01 movw r16, r30 614: b2 01 movw r22, r4 616: 99 27 eor r25, r25 618: 87 fd sbrc r24, 7 61a: 90 95 com r25 61c: 0e 94 b4 03 call 0x768 <fputc> 620: ce 01 movw r24, r28 622: 01 96 adiw r24, 0x01 ; 1 624: 08 17 cp r16, r24 626: 19 07 cpc r17, r25 628: 91 f7 brne .-28 ; 0x60e <vfprintf+0x4e4> 62a: 0e 87 std Y+14, r16 ; 0x0e 62c: 1f 87 std Y+15, r17 ; 0x0f 62e: cd 28 or r12, r13 630: 89 f0 breq .+34 ; 0x654 <vfprintf+0x52a> 632: 82 2d mov r24, r2 634: 06 c0 rjmp .+12 ; 0x642 <vfprintf+0x518> 636: b2 01 movw r22, r4 638: 80 e2 ldi r24, 0x20 ; 32 63a: 90 e0 ldi r25, 0x00 ; 0 63c: 0e 94 b4 03 call 0x768 <fputc> 640: 81 2f mov r24, r17 642: 18 2f mov r17, r24 644: 11 50 subi r17, 0x01 ; 1 646: 18 16 cp r1, r24 648: b4 f3 brlt .-20 ; 0x636 <vfprintf+0x50c> 64a: 21 2e mov r2, r17 64c: 03 c0 rjmp .+6 ; 0x654 <vfprintf+0x52a> 64e: b2 01 movw r22, r4 650: 0e 94 b4 03 call 0x768 <fputc> 654: cc 24 eor r12, r12 656: dd 24 eor r13, r13 658: 12 c0 rjmp .+36 ; 0x67e <vfprintf+0x554> 65a: f5 e2 ldi r31, 0x25 ; 37 65c: 3f 16 cp r3, r31 65e: 41 f4 brne .+16 ; 0x670 <vfprintf+0x546> 660: 81 e0 ldi r24, 0x01 ; 1 662: c8 2e mov r12, r24 664: d1 2c mov r13, r1 666: 1d 86 std Y+13, r1 ; 0x0d 668: 22 24 eor r2, r2 66a: 2a e0 ldi r18, 0x0A ; 10 66c: 28 8b std Y+16, r18 ; 0x10 66e: 07 c0 rjmp .+14 ; 0x67e <vfprintf+0x554> 670: b2 01 movw r22, r4 672: 83 2d mov r24, r3 674: 99 27 eor r25, r25 676: 87 fd sbrc r24, 7 678: 90 95 com r25 67a: 0e 94 b4 03 call 0x768 <fputc> 67e: f2 01 movw r30, r4 680: 83 81 ldd r24, Z+3 ; 0x03 682: 83 ff sbrs r24, 3 684: 04 c0 rjmp .+8 ; 0x68e <vfprintf+0x564> 686: e9 89 ldd r30, Y+17 ; 0x11 688: fa 89 ldd r31, Y+18 ; 0x12 68a: 34 90 lpm r3, Z 68c: 03 c0 rjmp .+6 ; 0x694 <vfprintf+0x56a> 68e: e9 89 ldd r30, Y+17 ; 0x11 690: fa 89 ldd r31, Y+18 ; 0x12 692: 30 80 ld r3, Z 694: 33 20 and r3, r3 696: 09 f0 breq .+2 ; 0x69a <vfprintf+0x570> 698: 72 cd rjmp .-1308 ; 0x17e <vfprintf+0x54> 69a: f2 01 movw r30, r4 69c: 86 81 ldd r24, Z+6 ; 0x06 69e: 97 81 ldd r25, Z+7 ; 0x07 6a0: 62 96 adiw r28, 0x12 ; 18 6a2: 0f b6 in r0, 0x3f ; 63 6a4: f8 94 cli 6a6: de bf out 0x3e, r29 ; 62 6a8: 0f be out 0x3f, r0 ; 63 6aa: cd bf out 0x3d, r28 ; 61 6ac: df 91 pop r29 6ae: cf 91 pop r28 6b0: 1f 91 pop r17 6b2: 0f 91 pop r16 6b4: ff 90 pop r15 6b6: ef 90 pop r14 6b8: df 90 pop r13 6ba: cf 90 pop r12 6bc: bf 90 pop r11 6be: af 90 pop r10 6c0: 9f 90 pop r9 6c2: 8f 90 pop r8 6c4: 7f 90 pop r7 6c6: 6f 90 pop r6 6c8: 5f 90 pop r5 6ca: 4f 90 pop r4 6cc: 3f 90 pop r3 6ce: 2f 90 pop r2 6d0: 08 95 ret 000006d2 <fdevopen>: 6d2: 0f 93 push r16 6d4: 1f 93 push r17 6d6: cf 93 push r28 6d8: df 93 push r29 6da: 8c 01 movw r16, r24 6dc: eb 01 movw r28, r22 6de: 89 2b or r24, r25 6e0: 21 f1 breq .+72 ; 0x72a <fdevopen+0x58> 6e2: 6c e0 ldi r22, 0x0C ; 12 6e4: 70 e0 ldi r23, 0x00 ; 0 6e6: 81 e0 ldi r24, 0x01 ; 1 6e8: 90 e0 ldi r25, 0x00 ; 0 6ea: 0e 94 07 04 call 0x80e <calloc> 6ee: fc 01 movw r30, r24 6f0: 89 2b or r24, r25 6f2: e9 f0 breq .+58 ; 0x72e <fdevopen+0x5c> 6f4: 20 97 sbiw r28, 0x00 ; 0 6f6: 51 f0 breq .+20 ; 0x70c <fdevopen+0x3a> 6f8: c2 87 std Z+10, r28 ; 0x0a 6fa: d3 87 std Z+11, r29 ; 0x0b 6fc: 81 e0 ldi r24, 0x01 ; 1 6fe: 83 83 std Z+3, r24 ; 0x03 700: 80 91 62 01 lds r24, 0x0162 704: 90 91 63 01 lds r25, 0x0163 708: 89 2b or r24, r25 70a: 19 f1 breq .+70 ; 0x752 <fdevopen+0x80> 70c: 01 15 cp r16, r1 70e: 11 05 cpc r17, r1 710: 29 f1 breq .+74 ; 0x75c <fdevopen+0x8a> 712: 00 87 std Z+8, r16 ; 0x08 714: 11 87 std Z+9, r17 ; 0x09 716: 83 81 ldd r24, Z+3 ; 0x03 718: 82 60 ori r24, 0x02 ; 2 71a: 83 83 std Z+3, r24 ; 0x03 71c: 80 91 64 01 lds r24, 0x0164 720: 90 91 65 01 lds r25, 0x0165 724: 89 2b or r24, r25 726: d1 f4 brne .+52 ; 0x75c <fdevopen+0x8a> 728: 05 c0 rjmp .+10 ; 0x734 <fdevopen+0x62> 72a: 67 2b or r22, r23 72c: d1 f6 brne .-76 ; 0x6e2 <fdevopen+0x10> 72e: e0 e0 ldi r30, 0x00 ; 0 730: f0 e0 ldi r31, 0x00 ; 0 732: 14 c0 rjmp .+40 ; 0x75c <fdevopen+0x8a> 734: f0 93 65 01 sts 0x0165, r31 738: e0 93 64 01 sts 0x0164, r30 73c: 80 91 66 01 lds r24, 0x0166 740: 90 91 67 01 lds r25, 0x0167 744: 89 2b or r24, r25 746: 51 f4 brne .+20 ; 0x75c <fdevopen+0x8a> 748: f0 93 67 01 sts 0x0167, r31 74c: e0 93 66 01 sts 0x0166, r30 750: 05 c0 rjmp .+10 ; 0x75c <fdevopen+0x8a> 752: f0 93 63 01 sts 0x0163, r31 756: e0 93 62 01 sts 0x0162, r30 75a: d8 cf rjmp .-80 ; 0x70c <fdevopen+0x3a> 75c: cf 01 movw r24, r30 75e: df 91 pop r29 760: cf 91 pop r28 762: 1f 91 pop r17 764: 0f 91 pop r16 766: 08 95 ret 00000768 <fputc>: #include "stdio_private.h" int fputc(int c, FILE *stream) { 768: 0f 93 push r16 76a: 1f 93 push r17 76c: cf 93 push r28 76e: df 93 push r29 770: 8c 01 movw r16, r24 772: eb 01 movw r28, r22 if ((stream->flags & __SWR) == 0) 774: 8b 81 ldd r24, Y+3 ; 0x03 776: 99 27 eor r25, r25 778: 81 ff sbrs r24, 1 77a: 16 c0 rjmp .+44 ; 0x7a8 <fputc+0x40> return EOF; if (stream->flags & __SSTR) { 77c: 82 ff sbrs r24, 2 77e: 17 c0 rjmp .+46 ; 0x7ae <fputc+0x46> if (stream->len < stream->size) 780: 2e 81 ldd r18, Y+6 ; 0x06 782: 3f 81 ldd r19, Y+7 ; 0x07 784: 8c 81 ldd r24, Y+4 ; 0x04 786: 9d 81 ldd r25, Y+5 ; 0x05 788: 28 17 cp r18, r24 78a: 39 07 cpc r19, r25 78c: 2c f0 brlt .+10 ; 0x798 <fputc+0x30> *stream->buf++ = c; stream->len++; 78e: 2f 5f subi r18, 0xFF ; 255 790: 3f 4f sbci r19, 0xFF ; 255 792: 2e 83 std Y+6, r18 ; 0x06 794: 3f 83 std Y+7, r19 ; 0x07 796: 16 c0 rjmp .+44 ; 0x7c4 <fputc+0x5c> 798: e8 81 ld r30, Y 79a: f9 81 ldd r31, Y+1 ; 0x01 79c: 01 93 st Z+, r16 79e: e8 83 st Y, r30 7a0: f9 83 std Y+1, r31 ; 0x01 7a2: 2e 81 ldd r18, Y+6 ; 0x06 7a4: 3f 81 ldd r19, Y+7 ; 0x07 7a6: f3 cf rjmp .-26 ; 0x78e <fputc+0x26> return c; } else { if (stream->put(c) == 0) { stream->len++; return c; 7a8: 0f ef ldi r16, 0xFF ; 255 7aa: 1f ef ldi r17, 0xFF ; 255 7ac: 0b c0 rjmp .+22 ; 0x7c4 <fputc+0x5c> 7ae: e8 85 ldd r30, Y+8 ; 0x08 7b0: f9 85 ldd r31, Y+9 ; 0x09 7b2: 80 2f mov r24, r16 7b4: 09 95 icall 7b6: 89 2b or r24, r25 7b8: b9 f7 brne .-18 ; 0x7a8 <fputc+0x40> 7ba: 8e 81 ldd r24, Y+6 ; 0x06 7bc: 9f 81 ldd r25, Y+7 ; 0x07 7be: 01 96 adiw r24, 0x01 ; 1 7c0: 8e 83 std Y+6, r24 ; 0x06 7c2: 9f 83 std Y+7, r25 ; 0x07 } else return EOF; } } 7c4: c8 01 movw r24, r16 7c6: df 91 pop r29 7c8: cf 91 pop r28 7ca: 1f 91 pop r17 7cc: 0f 91 pop r16 7ce: 08 95 ret 000007d0 <strlen_P>: 7d0: fc 01 movw r30, r24 000007d2 <.strlen_P_loop>: 7d2: 05 90 lpm r0, Z+ 7d4: 00 20 and r0, r0 7d6: e9 f7 brne .-6 ; 0x7d2 <.strlen_P_loop> 7d8: 80 95 com r24 7da: 90 95 com r25 7dc: 8e 0f add r24, r30 7de: 9f 1f adc r25, r31 7e0: 08 95 ret 000007e2 <strnlen>: 7e2: fc 01 movw r30, r24 000007e4 <.strnlen_loop>: 7e4: 61 50 subi r22, 0x01 ; 1 7e6: 70 40 sbci r23, 0x00 ; 0 7e8: 01 90 ld r0, Z+ 7ea: 01 10 cpse r0, r1 7ec: d8 f7 brcc .-10 ; 0x7e4 <.strnlen_loop> 7ee: 80 95 com r24 7f0: 90 95 com r25 7f2: 8e 0f add r24, r30 7f4: 9f 1f adc r25, r31 7f6: 08 95 ret 000007f8 <strnlen_P>: 7f8: fc 01 movw r30, r24 7fa: 61 50 subi r22, 0x01 ; 1 7fc: 70 40 sbci r23, 0x00 ; 0 7fe: 05 90 lpm r0, Z+ 800: 01 10 cpse r0, r1 802: d8 f7 brcc .-10 ; 0x7fa <strnlen_P+0x2> 804: 80 95 com r24 806: 90 95 com r25 808: 8e 0f add r24, r30 80a: 9f 1f adc r25, r31 80c: 08 95 ret 0000080e <calloc>: 80e: 0f 93 push r16 810: 1f 93 push r17 812: cf 93 push r28 814: df 93 push r29 816: 86 9f mul r24, r22 818: 80 01 movw r16, r0 81a: 87 9f mul r24, r23 81c: 10 0d add r17, r0 81e: 96 9f mul r25, r22 820: 10 0d add r17, r0 822: 11 24 eor r1, r1 824: c8 01 movw r24, r16 826: 0e 94 23 04 call 0x846 <malloc> 82a: ec 01 movw r28, r24 82c: 00 97 sbiw r24, 0x00 ; 0 82e: 29 f0 breq .+10 ; 0x83a <calloc+0x2c> 830: a8 01 movw r20, r16 832: 60 e0 ldi r22, 0x00 ; 0 834: 70 e0 ldi r23, 0x00 ; 0 836: 0e 94 54 05 call 0xaa8 <memset> 83a: ce 01 movw r24, r28 83c: df 91 pop r29 83e: cf 91 pop r28 840: 1f 91 pop r17 842: 0f 91 pop r16 844: 08 95 ret 00000846 <malloc>: 846: 0f 93 push r16 848: 1f 93 push r17 84a: cf 93 push r28 84c: df 93 push r29 84e: ac 01 movw r20, r24 850: 02 97 sbiw r24, 0x02 ; 2 852: 08 f4 brcc .+2 ; 0x856 <malloc+0x10> 854: 82 c0 rjmp .+260 ; 0x95a <malloc+0x114> 856: 00 91 6a 01 lds r16, 0x016A 85a: 10 91 6b 01 lds r17, 0x016B 85e: 01 15 cp r16, r1 860: 11 05 cpc r17, r1 862: 09 f4 brne .+2 ; 0x866 <malloc+0x20> 864: 63 c0 rjmp .+198 ; 0x92c <malloc+0xe6> 866: f8 01 movw r30, r16 868: 60 81 ld r22, Z 86a: 71 81 ldd r23, Z+1 ; 0x01 86c: 46 17 cp r20, r22 86e: 57 07 cpc r21, r23 870: 09 f4 brne .+2 ; 0x874 <malloc+0x2e> 872: 53 c0 rjmp .+166 ; 0x91a <malloc+0xd4> 874: d8 01 movw r26, r16 876: cb 01 movw r24, r22 878: 20 e0 ldi r18, 0x00 ; 0 87a: 30 e0 ldi r19, 0x00 ; 0 87c: 48 17 cp r20, r24 87e: 59 07 cpc r21, r25 880: 30 f4 brcc .+12 ; 0x88e <malloc+0x48> 882: 21 15 cp r18, r1 884: 31 05 cpc r19, r1 886: 79 f0 breq .+30 ; 0x8a6 <malloc+0x60> 888: 82 17 cp r24, r18 88a: 93 07 cpc r25, r19 88c: 60 f0 brcs .+24 ; 0x8a6 <malloc+0x60> 88e: ed 01 movw r28, r26 890: ea 81 ldd r30, Y+2 ; 0x02 892: fb 81 ldd r31, Y+3 ; 0x03 894: 30 97 sbiw r30, 0x00 ; 0 896: 69 f0 breq .+26 ; 0x8b2 <malloc+0x6c> 898: 80 81 ld r24, Z 89a: 91 81 ldd r25, Z+1 ; 0x01 89c: 48 17 cp r20, r24 89e: 59 07 cpc r21, r25 8a0: a1 f1 breq .+104 ; 0x90a <malloc+0xc4> 8a2: df 01 movw r26, r30 8a4: eb cf rjmp .-42 ; 0x87c <malloc+0x36> 8a6: 9c 01 movw r18, r24 8a8: ed 01 movw r28, r26 8aa: ea 81 ldd r30, Y+2 ; 0x02 8ac: fb 81 ldd r31, Y+3 ; 0x03 8ae: 30 97 sbiw r30, 0x00 ; 0 8b0: 99 f7 brne .-26 ; 0x898 <malloc+0x52> 8b2: 21 15 cp r18, r1 8b4: 31 05 cpc r19, r1 8b6: d1 f1 breq .+116 ; 0x92c <malloc+0xe6> 8b8: c9 01 movw r24, r18 8ba: 84 1b sub r24, r20 8bc: 95 0b sbc r25, r21 8be: 04 97 sbiw r24, 0x04 ; 4 8c0: 08 f4 brcc .+2 ; 0x8c4 <malloc+0x7e> 8c2: a9 01 movw r20, r18 8c4: 62 17 cp r22, r18 8c6: 73 07 cpc r23, r19 8c8: 11 f4 brne .+4 ; 0x8ce <malloc+0x88> 8ca: 4a c0 rjmp .+148 ; 0x960 <malloc+0x11a> 8cc: 8f 01 movw r16, r30 8ce: e8 01 movw r28, r16 8d0: ea 81 ldd r30, Y+2 ; 0x02 8d2: fb 81 ldd r31, Y+3 ; 0x03 8d4: 30 97 sbiw r30, 0x00 ; 0 8d6: 51 f1 breq .+84 ; 0x92c <malloc+0xe6> 8d8: 80 81 ld r24, Z 8da: 91 81 ldd r25, Z+1 ; 0x01 8dc: 28 17 cp r18, r24 8de: 39 07 cpc r19, r25 8e0: a9 f7 brne .-22 ; 0x8cc <malloc+0x86> 8e2: d8 01 movw r26, r16 8e4: 8f 01 movw r16, r30 8e6: 42 17 cp r20, r18 8e8: 53 07 cpc r21, r19 8ea: 09 f4 brne .+2 ; 0x8ee <malloc+0xa8> 8ec: 5f c0 rjmp .+190 ; 0x9ac <malloc+0x166> 8ee: c9 01 movw r24, r18 8f0: 84 1b sub r24, r20 8f2: 95 0b sbc r25, r21 8f4: f8 01 movw r30, r16 8f6: e8 0f add r30, r24 8f8: f9 1f adc r31, r25 8fa: 41 93 st Z+, r20 8fc: 51 93 st Z+, r21 8fe: 02 97 sbiw r24, 0x02 ; 2 900: d8 01 movw r26, r16 902: 8d 93 st X+, r24 904: 9c 93 st X, r25 906: cf 01 movw r24, r30 908: 65 c0 rjmp .+202 ; 0x9d4 <malloc+0x18e> 90a: 82 81 ldd r24, Z+2 ; 0x02 90c: 93 81 ldd r25, Z+3 ; 0x03 90e: ed 01 movw r28, r26 910: 8a 83 std Y+2, r24 ; 0x02 912: 9b 83 std Y+3, r25 ; 0x03 914: cf 01 movw r24, r30 916: 02 96 adiw r24, 0x02 ; 2 918: 5d c0 rjmp .+186 ; 0x9d4 <malloc+0x18e> 91a: e8 01 movw r28, r16 91c: 8a 81 ldd r24, Y+2 ; 0x02 91e: 9b 81 ldd r25, Y+3 ; 0x03 920: 90 93 6b 01 sts 0x016B, r25 924: 80 93 6a 01 sts 0x016A, r24 928: f8 01 movw r30, r16 92a: f4 cf rjmp .-24 ; 0x914 <malloc+0xce> 92c: 60 91 68 01 lds r22, 0x0168 930: 70 91 69 01 lds r23, 0x0169 934: 61 15 cp r22, r1 936: 71 05 cpc r23, r1 938: f9 f0 breq .+62 ; 0x978 <malloc+0x132> 93a: 20 91 5b 01 lds r18, 0x015B 93e: 30 91 5c 01 lds r19, 0x015C 942: 21 15 cp r18, r1 944: 31 05 cpc r19, r1 946: 79 f0 breq .+30 ; 0x966 <malloc+0x120> 948: fb 01 movw r30, r22 94a: 26 1b sub r18, r22 94c: 37 0b sbc r19, r23 94e: 24 17 cp r18, r20 950: 35 07 cpc r19, r21 952: d8 f4 brcc .+54 ; 0x98a <malloc+0x144> 954: 80 e0 ldi r24, 0x00 ; 0 956: 90 e0 ldi r25, 0x00 ; 0 958: 3d c0 rjmp .+122 ; 0x9d4 <malloc+0x18e> 95a: 42 e0 ldi r20, 0x02 ; 2 95c: 50 e0 ldi r21, 0x00 ; 0 95e: 7b cf rjmp .-266 ; 0x856 <malloc+0x10> 960: a0 e0 ldi r26, 0x00 ; 0 962: b0 e0 ldi r27, 0x00 ; 0 964: c0 cf rjmp .-128 ; 0x8e6 <malloc+0xa0> 966: 2d b7 in r18, 0x3d ; 61 968: 3e b7 in r19, 0x3e ; 62 96a: 80 91 5f 01 lds r24, 0x015F 96e: 90 91 60 01 lds r25, 0x0160 972: 28 1b sub r18, r24 974: 39 0b sbc r19, r25 976: e8 cf rjmp .-48 ; 0x948 <malloc+0x102> 978: 60 91 5d 01 lds r22, 0x015D 97c: 70 91 5e 01 lds r23, 0x015E 980: 70 93 69 01 sts 0x0169, r23 984: 60 93 68 01 sts 0x0168, r22 988: d8 cf rjmp .-80 ; 0x93a <malloc+0xf4> 98a: ca 01 movw r24, r20 98c: 02 96 adiw r24, 0x02 ; 2 98e: 28 17 cp r18, r24 990: 39 07 cpc r19, r25 992: 00 f3 brcs .-64 ; 0x954 <malloc+0x10e> 994: 64 0f add r22, r20 996: 75 1f adc r23, r21 998: 6e 5f subi r22, 0xFE ; 254 99a: 7f 4f sbci r23, 0xFF ; 255 99c: 70 93 69 01 sts 0x0169, r23 9a0: 60 93 68 01 sts 0x0168, r22 9a4: 41 93 st Z+, r20 9a6: 51 93 st Z+, r21 9a8: cf 01 movw r24, r30 9aa: 14 c0 rjmp .+40 ; 0x9d4 <malloc+0x18e> 9ac: 10 97 sbiw r26, 0x00 ; 0 9ae: 49 f0 breq .+18 ; 0x9c2 <malloc+0x17c> 9b0: f8 01 movw r30, r16 9b2: 82 81 ldd r24, Z+2 ; 0x02 9b4: 93 81 ldd r25, Z+3 ; 0x03 9b6: ed 01 movw r28, r26 9b8: 8a 83 std Y+2, r24 ; 0x02 9ba: 9b 83 std Y+3, r25 ; 0x03 9bc: c8 01 movw r24, r16 9be: 02 96 adiw r24, 0x02 ; 2 9c0: 09 c0 rjmp .+18 ; 0x9d4 <malloc+0x18e> 9c2: f8 01 movw r30, r16 9c4: 82 81 ldd r24, Z+2 ; 0x02 9c6: 93 81 ldd r25, Z+3 ; 0x03 9c8: 90 93 6b 01 sts 0x016B, r25 9cc: 80 93 6a 01 sts 0x016A, r24 9d0: c8 01 movw r24, r16 9d2: 02 96 adiw r24, 0x02 ; 2 9d4: df 91 pop r29 9d6: cf 91 pop r28 9d8: 1f 91 pop r17 9da: 0f 91 pop r16 9dc: 08 95 ret 000009de <free>: 9de: cf 93 push r28 9e0: df 93 push r29 9e2: 00 97 sbiw r24, 0x00 ; 0 9e4: 09 f4 brne .+2 ; 0x9e8 <free+0xa> 9e6: 5d c0 rjmp .+186 ; 0xaa2 <free+0xc4> 9e8: ec 01 movw r28, r24 9ea: 22 97 sbiw r28, 0x02 ; 2 9ec: 1a 82 std Y+2, r1 ; 0x02 9ee: 1b 82 std Y+3, r1 ; 0x03 9f0: e0 91 6a 01 lds r30, 0x016A 9f4: f0 91 6b 01 lds r31, 0x016B 9f8: 30 97 sbiw r30, 0x00 ; 0 9fa: d9 f1 breq .+118 ; 0xa72 <free+0x94> 9fc: ec 17 cp r30, r28 9fe: fd 07 cpc r31, r29 a00: 40 f1 brcs .+80 ; 0xa52 <free+0x74> a02: df 01 movw r26, r30 a04: 40 e0 ldi r20, 0x00 ; 0 a06: 50 e0 ldi r21, 0x00 ; 0 a08: aa 83 std Y+2, r26 ; 0x02 a0a: bb 83 std Y+3, r27 ; 0x03 a0c: fe 01 movw r30, r28 a0e: 21 91 ld r18, Z+ a10: 31 91 ld r19, Z+ a12: e2 0f add r30, r18 a14: f3 1f adc r31, r19 a16: ae 17 cp r26, r30 a18: bf 07 cpc r27, r31 a1a: 91 f1 breq .+100 ; 0xa80 <free+0xa2> a1c: 41 15 cp r20, r1 a1e: 51 05 cpc r21, r1 a20: 41 f1 breq .+80 ; 0xa72 <free+0x94> a22: fa 01 movw r30, r20 a24: c2 83 std Z+2, r28 ; 0x02 a26: d3 83 std Z+3, r29 ; 0x03 a28: 21 91 ld r18, Z+ a2a: 31 91 ld r19, Z+ a2c: e2 0f add r30, r18 a2e: f3 1f adc r31, r19 a30: ce 17 cp r28, r30 a32: df 07 cpc r29, r31 a34: b1 f5 brne .+108 ; 0xaa2 <free+0xc4> a36: 88 81 ld r24, Y a38: 99 81 ldd r25, Y+1 ; 0x01 a3a: 28 0f add r18, r24 a3c: 39 1f adc r19, r25 a3e: 2e 5f subi r18, 0xFE ; 254 a40: 3f 4f sbci r19, 0xFF ; 255 a42: fa 01 movw r30, r20 a44: 20 83 st Z, r18 a46: 31 83 std Z+1, r19 ; 0x01 a48: 8a 81 ldd r24, Y+2 ; 0x02 a4a: 9b 81 ldd r25, Y+3 ; 0x03 a4c: 82 83 std Z+2, r24 ; 0x02 a4e: 93 83 std Z+3, r25 ; 0x03 a50: 28 c0 rjmp .+80 ; 0xaa2 <free+0xc4> a52: a2 81 ldd r26, Z+2 ; 0x02 a54: b3 81 ldd r27, Z+3 ; 0x03 a56: 10 97 sbiw r26, 0x00 ; 0 a58: 11 f4 brne .+4 ; 0xa5e <free+0x80> a5a: 21 c0 rjmp .+66 ; 0xa9e <free+0xc0> a5c: dc 01 movw r26, r24 a5e: ac 17 cp r26, r28 a60: bd 07 cpc r27, r29 a62: 60 f4 brcc .+24 ; 0xa7c <free+0x9e> a64: fd 01 movw r30, r26 a66: 82 81 ldd r24, Z+2 ; 0x02 a68: 93 81 ldd r25, Z+3 ; 0x03 a6a: 00 97 sbiw r24, 0x00 ; 0 a6c: b9 f7 brne .-18 ; 0xa5c <free+0x7e> a6e: ad 01 movw r20, r26 a70: d8 cf rjmp .-80 ; 0xa22 <free+0x44> a72: d0 93 6b 01 sts 0x016B, r29 a76: c0 93 6a 01 sts 0x016A, r28 a7a: 13 c0 rjmp .+38 ; 0xaa2 <free+0xc4> a7c: af 01 movw r20, r30 a7e: c4 cf rjmp .-120 ; 0xa08 <free+0x2a> a80: 8d 91 ld r24, X+ a82: 9c 91 ld r25, X a84: 11 97 sbiw r26, 0x01 ; 1 a86: 28 0f add r18, r24 a88: 39 1f adc r19, r25 a8a: 2e 5f subi r18, 0xFE ; 254 a8c: 3f 4f sbci r19, 0xFF ; 255 a8e: 28 83 st Y, r18 a90: 39 83 std Y+1, r19 ; 0x01 a92: fd 01 movw r30, r26 a94: 82 81 ldd r24, Z+2 ; 0x02 a96: 93 81 ldd r25, Z+3 ; 0x03 a98: 8a 83 std Y+2, r24 ; 0x02 a9a: 9b 83 std Y+3, r25 ; 0x03 a9c: bf cf rjmp .-130 ; 0xa1c <free+0x3e> a9e: af 01 movw r20, r30 aa0: c0 cf rjmp .-128 ; 0xa22 <free+0x44> aa2: df 91 pop r29 aa4: cf 91 pop r28 aa6: 08 95 ret 00000aa8 <memset>: aa8: dc 01 movw r26, r24 aaa: 01 c0 rjmp .+2 ; 0xaae <.memset_start> 00000aac <.memset_loop>: aac: 6d 93 st X+, r22 00000aae <.memset_start>: aae: 41 50 subi r20, 0x01 ; 1 ab0: 50 40 sbci r21, 0x00 ; 0 ab2: e0 f7 brcc .-8 ; 0xaac <.memset_loop> ab4: 08 95 ret 00000ab6 <__udivmodsi4>: ab6: a1 e2 ldi r26, 0x21 ; 33 ab8: 1a 2e mov r1, r26 aba: aa 1b sub r26, r26 abc: bb 1b sub r27, r27 abe: fd 01 movw r30, r26 ac0: 0d c0 rjmp .+26 ; 0xadc <__udivmodsi4_ep> 00000ac2 <__udivmodsi4_loop>: ac2: aa 1f adc r26, r26 ac4: bb 1f adc r27, r27 ac6: ee 1f adc r30, r30 ac8: ff 1f adc r31, r31 aca: a2 17 cp r26, r18 acc: b3 07 cpc r27, r19 ace: e4 07 cpc r30, r20 ad0: f5 07 cpc r31, r21 ad2: 20 f0 brcs .+8 ; 0xadc <__udivmodsi4_ep> ad4: a2 1b sub r26, r18 ad6: b3 0b sbc r27, r19 ad8: e4 0b sbc r30, r20 ada: f5 0b sbc r31, r21 00000adc <__udivmodsi4_ep>: adc: 66 1f adc r22, r22 ade: 77 1f adc r23, r23 ae0: 88 1f adc r24, r24 ae2: 99 1f adc r25, r25 ae4: 1a 94 dec r1 ae6: 69 f7 brne .-38 ; 0xac2 <__udivmodsi4_loop> ae8: 60 95 com r22 aea: 70 95 com r23 aec: 80 95 com r24 aee: 90 95 com r25 af0: 9b 01 movw r18, r22 af2: ac 01 movw r20, r24 af4: bd 01 movw r22, r26 af6: cf 01 movw r24, r30 af8: 08 95 ret 00000afa <_exit>: afa: ff cf rjmp .-2 ; 0xafa <_exit>
Huh?
I assume you are talking about the following code: /* __do_copy_data is only necessary if there is anything in .data section. Does not use RAMPZ - crt*.o provides a replacement for >64K devices. */ #ifdef L_copy_data .section .init4,"ax",@progbits .global __do_copy_data __do_copy_data: ldi r17, hi8(__data_end) ldi r26, lo8(__data_start) ldi r27, hi8(__data_start) ldi r30, lo8(__data_load_start) ldi r31, hi8(__data_load_start) rjmp .do_copy_data_start .do_copy_data_loop: #if defined (__AVR_ENHANCED__) lpm r0, Z+ #else lpm adiw r30, 1 #endif
And this fixme: /* FIXME: output these only if there is anything in the .data / .bss sections - some code size could be saved by not linking in the initialization code from libgcc if one or both sections are empty. */ fputs ("\t.global __do_copy_data\n", asm_out_file); fputs ("\t.global __do_clear_bss\n", asm_out_file); Then this is a dup of bug 18145. *** This bug has been marked as a duplicate of 18145 ***
(In reply to comment #3) > *** This bug has been marked as a duplicate of 18145 *** sorry, no. - that bug says don't copy when there's no data to copy. - this bug says, don't static read-only data even if present, as it should be read read-only data should not be copied to read-write memory to be then only copied again; as little as a few KB of such data could effectivly consume all of RAM relegating the entire RAM useless.
(In reply to comment #4) > (In reply to comment #3) > > *** This bug has been marked as a duplicate of 18145 *** > > sorry, no. oh, this is still a target bug.
> oh, this is still a target bug. Possibly (but likely of similar concern for other small embedded targets) The problem is that the initialization data which is linked in .data (stored in readable flash/rom) is first copied to RAM, prior to then being copied to the data structure which may require initialization. (resulting in a needless redundant copy chewing up precious RAM). As in for example: struct s{ long a; long b; long c; long d; }; void main (void){ volatile struct s x = {0, 1, 2, 3}; volatile struct s y = {0, 1, 2, 3}; /* etc. */ }
Yes because MOVE_RATIO is too low for avr really. But there might different issues here really, one is for an example MOVE_RATIO is too low which causes the addition of the .data stuff but the other is that target is doing the move which seems wrong because this is constant data. Both are target bugs.
Subject: Re: static initialization .data redundantly copied to ram prior to use. > From: pinskia at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org> > > ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-28 > Yes because MOVE_RATIO is too low for avr really. But there might different > issues here really, one is > for an example MOVE_RATIO is too low which causes the addition of the .data > stuff but the other is that > target is doing the move which seems wrong because this is constant data. > Both are target bugs. > -- Thank, I'll try tweaking a few things to try to affect this then.
IIUC, the issue Paul is refering to is: AVR is a Harvard architecture and C unfortunately is not well-prepared to handle different address spaces. Gcc would have to know always in advance where some data is located in order to generate correct code. Assume that you are having code fragment of the type char *ma_string_buffer_in_flash_memory = "Einen schoenen guten Tag wuensche ich!\n" PROGMEM; char *my_string_buffer_in_ram = "Hallo! \n"; my_function_that_takes_a_char_pointer (my_string_buffer_in_flash_memory); my_function_that_takes_a_char_pointer (my_string_buffer_in_ram); . GCC could either generatete code for my_function_that_takes_a_char_pointer that correctly handles pointers to char in program memory and does not handle correctly pointers to target addresses in ram or the other way round. IMHO, solution of this issue would require a language different from C that is able to handle different classes of pointers. Yours, Björn
(In reply to comment #9) > IMHO, solution of this issue would require a language different from C that is > able to handle different classes of pointers. Was hoping that any designated read access to data stored in the .data segement would be suffecient to indicate to the back-end the nessesity access is via the restricted lpm z-pointer instruction (with out having to get fancier than that).
(In reply to comment #10) > (In reply to comment #9) > > IMHO, solution of this issue would require a language different from C that is > > able to handle different classes of pointers. > > Was hoping that any designated read access to data stored in the .data segement would be > suffecient to indicate to the back-end the nessesity access is via the restricted lpm z-pointer > instruction (with out having to get fancier than that). which with a little luck would be uniquely identified as being accessed via a (static const xxxxx *) ?
I think the key problem is, that C language permits you to pass pointers to your static const data structures to other functions. Possibly functions that are not located within the same source file. While functions whithin the source file that defines the const data structures could in principle know that these data should be located in program memory and that they should be accessed by using lpm instructions, I do not see how to pass this knowledge to externally defined functions. Only solution in my opinion would be to define different classes of pointers. Yours, Björn.
Subject: Re: static initialization .data redundantly copied to ram prior to use. bjoern dot m dot haase at web dot de wrote: >------- Additional Comments From bjoern dot m dot haase at web dot de 2005-02-28 21:58 ------- >I think the key problem is, that C language permits you to pass pointers to >your static const data structures to other functions. Possibly functions that >are not located within the same source file. While functions whithin the >source file that defines the const data structures could in principle know >that these data should be located in program memory and that they should be >accessed by using lpm instructions, I do not see how to pass this knowledge to >externally defined functions. Only solution in my opinion would be to define >different classes of pointers. > > > > Which is a *known issue* for the AVR port. At one point Svein Seldal was working on a patch to allow pointers to different memory spaces, but that was some time ago and I haven't heard from him about the status of his work. Eric
Subject: Re: static initialization .data redundantly copied to ram prior to use. > ------- Additional Comments From bjoern dot m dot haase at web dot de > I think the key problem is, that C language permits you to pass pointers to > your static const data structures to other functions. Possibly functions that > are not located within the same source file. While functions whithin the > source file that defines the const data structures could in principle know > that these data should be located in program memory and that they should be > accessed by using lpm instructions, I do not see how to pass this knowledge to > externally defined functions. Only solution in my opinion would be to define > different classes of pointers. - Understood, however would seem to correspondingly require a new type and/or attribute be defined and visible from the parser through to type checking and rtl template matching; So wonder if it's sufficient to use the existing "static const" attributes to designate program-memory mapped data (which is what it is) and thereby assume that only references to "static const" are prog-mem references, and correspondingly require functions which access such data directly to explicitly identify their arguments accordingly, as otherwise the reference will be presumed to reference data-memory. However any "static const" may first be copied to a data-memory variable and then passed as reference as desired to utilize functions with more generalized arguments, and then freed, or whatever. Hopefully such attributes are already visible at the tree/rtl/template level so that memory operand templates may identify (static const *) types, and utilize program vs data memory loads as appropriate; as otherwise, it's not real clear that this has much a chance of being accomplished; and would be a shame to otherwise waist RAM on static const data already stored and accessible the program-memory.
This bug report is completely unclear. 'static const' will not be overloaded to imply that a variable is stored in flash. The relevant C language draft concerning mulitple memory spaces will have to be referred to when implementing such a feature. Closing bug as WONTFIX.