Task1.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn 0 .data 00000000 00803e00 00803e00 000000ca 2**0 CONTENTS, ALLOC, LOAD, DATA 1 .text 00000076 00000000 00000000 00000054 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .comment 00000030 00000000 00000000 000000ca 2**0 CONTENTS, READONLY 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000000fc 2**2 CONTENTS, READONLY 4 .debug_aranges 00000020 00000000 00000000 00000138 2**0 CONTENTS, READONLY, DEBUGGING 5 .debug_info 00001781 00000000 00000000 00000158 2**0 CONTENTS, READONLY, DEBUGGING 6 .debug_abbrev 000015fc 00000000 00000000 000018d9 2**0 CONTENTS, READONLY, DEBUGGING 7 .debug_line 00000223 00000000 00000000 00002ed5 2**0 CONTENTS, READONLY, DEBUGGING 8 .debug_frame 00000024 00000000 00000000 000030f8 2**2 CONTENTS, READONLY, DEBUGGING 9 .debug_str 00000af8 00000000 00000000 0000311c 2**0 CONTENTS, READONLY, DEBUGGING 10 .debug_ranges 00000010 00000000 00000000 00003c14 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 19 c0 rjmp .+50 ; 0x34 <__ctors_end> 2: 22 c0 rjmp .+68 ; 0x48 <__bad_interrupt> 4: 21 c0 rjmp .+66 ; 0x48 <__bad_interrupt> 6: 20 c0 rjmp .+64 ; 0x48 <__bad_interrupt> 8: 1f c0 rjmp .+62 ; 0x48 <__bad_interrupt> a: 1e c0 rjmp .+60 ; 0x48 <__bad_interrupt> c: 1d c0 rjmp .+58 ; 0x48 <__bad_interrupt> e: 1c c0 rjmp .+56 ; 0x48 <__bad_interrupt> 10: 1b c0 rjmp .+54 ; 0x48 <__bad_interrupt> 12: 1a c0 rjmp .+52 ; 0x48 <__bad_interrupt> 14: 19 c0 rjmp .+50 ; 0x48 <__bad_interrupt> 16: 18 c0 rjmp .+48 ; 0x48 <__bad_interrupt> 18: 17 c0 rjmp .+46 ; 0x48 <__bad_interrupt> 1a: 16 c0 rjmp .+44 ; 0x48 <__bad_interrupt> 1c: 15 c0 rjmp .+42 ; 0x48 <__bad_interrupt> 1e: 14 c0 rjmp .+40 ; 0x48 <__bad_interrupt> 20: 13 c0 rjmp .+38 ; 0x48 <__bad_interrupt> 22: 12 c0 rjmp .+36 ; 0x48 <__bad_interrupt> 24: 11 c0 rjmp .+34 ; 0x48 <__bad_interrupt> 26: 10 c0 rjmp .+32 ; 0x48 <__bad_interrupt> 28: 0f c0 rjmp .+30 ; 0x48 <__bad_interrupt> 2a: 0e c0 rjmp .+28 ; 0x48 <__bad_interrupt> 2c: 0d c0 rjmp .+26 ; 0x48 <__bad_interrupt> 2e: 0c c0 rjmp .+24 ; 0x48 <__bad_interrupt> 30: 0b c0 rjmp .+22 ; 0x48 <__bad_interrupt> 32: 0a c0 rjmp .+20 ; 0x48 <__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: cd bf out 0x3d, r28 ; 61 3c: df e3 ldi r29, 0x3F ; 63 3e: de bf out 0x3e, r29 ; 62 40: 0e 94 26 00 call 0x4c ; 0x4c
44: 0c 94 39 00 jmp 0x72 ; 0x72 <_exit> 00000048 <__bad_interrupt>: 48: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> 0000004c
: * Remember bit set logic: * Set to 1: FLAG |= ( 1 << BIT_POS ) - using 'or' so we only change the one we want and leave the others untouched * Set to 0: FLAG &= ~( 1 << BIT_POS ) - same thing here but using 'and', find paper and a logic-table, and try it out if you want to know how it works */ PORTB_DIR |= (1 << LED0); // Set LED0 as output - Using "B" in PORTx_DIR since the LED is connected to port B on the microcontroller 4c: e0 e2 ldi r30, 0x20 ; 32 4e: f4 e0 ldi r31, 0x04 ; 4 50: 80 81 ld r24, Z 52: 80 61 ori r24, 0x10 ; 16 54: 80 83 st Z, r24 * The usual way to run microcontrollers is using a simple infinite loop */ while (1) { PORTB_OUT ^= (1 << LED0); // Changes the state of LED0 by XOR-ing the last state. Check the XOR-table to find out how this works. 56: e4 e2 ldi r30, 0x24 ; 36 58: f4 e0 ldi r31, 0x04 ; 4 5a: 90 e1 ldi r25, 0x10 ; 16 5c: 80 81 ld r24, Z 5e: 89 27 eor r24, r25 60: 80 83 st Z, r24 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 62: 25 e1 ldi r18, 0x15 ; 21 64: 36 e1 ldi r19, 0x16 ; 22 66: 85 e0 ldi r24, 0x05 ; 5 68: 21 50 subi r18, 0x01 ; 1 6a: 30 40 sbci r19, 0x00 ; 0 6c: 80 40 sbci r24, 0x00 ; 0 6e: e1 f7 brne .-8 ; 0x68 70: f5 cf rjmp .-22 ; 0x5c 00000072 <_exit>: 72: f8 94 cli 00000074 <__stop_program>: 74: ff cf rjmp .-2 ; 0x74 <__stop_program>