Files
ARBKVS/P3/P3/Debug/P3.lss
2023-11-27 19:09:24 +01:00

255 lines
9.0 KiB
Plaintext

P3.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000000 00800100 00800100 00000208 2**0
CONTENTS, ALLOC, LOAD, DATA
1 .text 00000194 00000000 00000000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .bss 00000004 00800100 00800100 00000208 2**0
ALLOC
3 .comment 00000030 00000000 00000000 00000208 2**0
CONTENTS, READONLY
4 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 00000238 2**2
CONTENTS, READONLY
5 .debug_aranges 00000050 00000000 00000000 00000278 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_info 000007d8 00000000 00000000 000002c8 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_abbrev 000006b6 00000000 00000000 00000aa0 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_line 000002b4 00000000 00000000 00001156 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_frame 000000b0 00000000 00000000 0000140c 2**2
CONTENTS, READONLY, DEBUGGING
10 .debug_str 000003c7 00000000 00000000 000014bc 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_loc 00000092 00000000 00000000 00001883 2**0
CONTENTS, READONLY, DEBUGGING
12 .debug_ranges 00000040 00000000 00000000 00001915 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 34 00 jmp 0x68 ; 0x68 <__ctors_end>
4: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
8: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
c: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
10: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
14: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
18: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
1c: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
20: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
24: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
28: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
2c: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
30: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
34: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
38: 0c 94 56 00 jmp 0xac ; 0xac <__vector_14>
3c: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
40: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
44: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
48: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
4c: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
50: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
54: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
58: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
5c: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
60: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
64: 0c 94 46 00 jmp 0x8c ; 0x8c <__bad_interrupt>
00000068 <__ctors_end>:
68: 11 24 eor r1, r1
6a: 1f be out 0x3f, r1 ; 63
6c: cf ef ldi r28, 0xFF ; 255
6e: d8 e0 ldi r29, 0x08 ; 8
70: de bf out 0x3e, r29 ; 62
72: cd bf out 0x3d, r28 ; 61
00000074 <__do_clear_bss>:
74: 21 e0 ldi r18, 0x01 ; 1
76: a0 e0 ldi r26, 0x00 ; 0
78: b1 e0 ldi r27, 0x01 ; 1
7a: 01 c0 rjmp .+2 ; 0x7e <.do_clear_bss_start>
0000007c <.do_clear_bss_loop>:
7c: 1d 92 st X+, r1
0000007e <.do_clear_bss_start>:
7e: a4 30 cpi r26, 0x04 ; 4
80: b2 07 cpc r27, r18
82: e1 f7 brne .-8 ; 0x7c <.do_clear_bss_loop>
84: 0e 94 b2 00 call 0x164 ; 0x164 <main>
88: 0c 94 c8 00 jmp 0x190 ; 0x190 <_exit>
0000008c <__bad_interrupt>:
8c: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
00000090 <setupTimer0>:
volatile uint32_t systemClock = 0;
void setupTimer0() {
// Configure Timer0 for CTC mode
TCCR0A |= (1 << WGM01); // Set Waveform Generation Mode bits for CTC
90: 84 b5 in r24, 0x24 ; 36
92: 82 60 ori r24, 0x02 ; 2
94: 84 bd out 0x24, r24 ; 36
TCCR0B |= (1 << CS01) | (1 << CS00); // Set prescaler to 64
96: 85 b5 in r24, 0x25 ; 37
98: 83 60 ori r24, 0x03 ; 3
9a: 85 bd out 0x25, r24 ; 37
OCR0A = 249; // Set Output Compare Register to 249 for ~1ms interrupt
9c: 89 ef ldi r24, 0xF9 ; 249
9e: 87 bd out 0x27, r24 ; 39
TIMSK0 |= (1 << OCIE0A); // Enable Timer0 Output Compare A Match interrupt
a0: ee e6 ldi r30, 0x6E ; 110
a2: f0 e0 ldi r31, 0x00 ; 0
a4: 80 81 ld r24, Z
a6: 82 60 ori r24, 0x02 ; 2
a8: 80 83 st Z, r24
aa: 08 95 ret
000000ac <__vector_14>:
}
// Timer0 Output Compare A Match Interrupt Service Routine
ISR(TIMER0_COMPA_vect) {
ac: 1f 92 push r1
ae: 0f 92 push r0
b0: 0f b6 in r0, 0x3f ; 63
b2: 0f 92 push r0
b4: 11 24 eor r1, r1
b6: 8f 93 push r24
b8: 9f 93 push r25
ba: af 93 push r26
bc: bf 93 push r27
systemClock++; // Increment the milliseconds counter
be: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <_edata>
c2: 90 91 01 01 lds r25, 0x0101 ; 0x800101 <_edata+0x1>
c6: a0 91 02 01 lds r26, 0x0102 ; 0x800102 <_edata+0x2>
ca: b0 91 03 01 lds r27, 0x0103 ; 0x800103 <_edata+0x3>
ce: 01 96 adiw r24, 0x01 ; 1
d0: a1 1d adc r26, r1
d2: b1 1d adc r27, r1
d4: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <_edata>
d8: 90 93 01 01 sts 0x0101, r25 ; 0x800101 <_edata+0x1>
dc: a0 93 02 01 sts 0x0102, r26 ; 0x800102 <_edata+0x2>
e0: b0 93 03 01 sts 0x0103, r27 ; 0x800103 <_edata+0x3>
}
e4: bf 91 pop r27
e6: af 91 pop r26
e8: 9f 91 pop r25
ea: 8f 91 pop r24
ec: 0f 90 pop r0
ee: 0f be out 0x3f, r0 ; 63
f0: 0f 90 pop r0
f2: 1f 90 pop r1
f4: 18 95 reti
000000f6 <waitFor>:
void waitFor(uint32_t ms) {
f6: 0f 93 push r16
f8: 1f 93 push r17
uint32_t endTime = systemClock + ms;
fa: 00 91 00 01 lds r16, 0x0100 ; 0x800100 <_edata>
fe: 10 91 01 01 lds r17, 0x0101 ; 0x800101 <_edata+0x1>
102: 20 91 02 01 lds r18, 0x0102 ; 0x800102 <_edata+0x2>
106: 30 91 03 01 lds r19, 0x0103 ; 0x800103 <_edata+0x3>
10a: ab 01 movw r20, r22
10c: bc 01 movw r22, r24
10e: 40 0f add r20, r16
110: 51 1f adc r21, r17
112: 62 1f adc r22, r18
114: 73 1f adc r23, r19
while (systemClock < endTime);
116: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <_edata>
11a: 90 91 01 01 lds r25, 0x0101 ; 0x800101 <_edata+0x1>
11e: a0 91 02 01 lds r26, 0x0102 ; 0x800102 <_edata+0x2>
122: b0 91 03 01 lds r27, 0x0103 ; 0x800103 <_edata+0x3>
126: 84 17 cp r24, r20
128: 95 07 cpc r25, r21
12a: a6 07 cpc r26, r22
12c: b7 07 cpc r27, r23
12e: 98 f3 brcs .-26 ; 0x116 <waitFor+0x20>
}
130: 1f 91 pop r17
132: 0f 91 pop r16
134: 08 95 ret
00000136 <waitUntil>:
void waitUntil(uint32_t ms) {
136: ab 01 movw r20, r22
138: bc 01 movw r22, r24
while (systemClock < ms);
13a: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <_edata>
13e: 90 91 01 01 lds r25, 0x0101 ; 0x800101 <_edata+0x1>
142: a0 91 02 01 lds r26, 0x0102 ; 0x800102 <_edata+0x2>
146: b0 91 03 01 lds r27, 0x0103 ; 0x800103 <_edata+0x3>
14a: 84 17 cp r24, r20
14c: 95 07 cpc r25, r21
14e: a6 07 cpc r26, r22
150: b7 07 cpc r27, r23
152: 98 f3 brcs .-26 ; 0x13a <waitUntil+0x4>
}
154: 08 95 ret
00000156 <initializeLED>:
void initializeLED() {
DDRD |= (1 << LED_PIN); // Set LED_PIN as an output
156: 50 9a sbi 0x0a, 0 ; 10
158: 08 95 ret
0000015a <toggleLED>:
}
void toggleLED() {
PORTD ^= (1 << LED_PIN); // Toggle the LED
15a: 9b b1 in r25, 0x0b ; 11
15c: 81 e0 ldi r24, 0x01 ; 1
15e: 89 27 eor r24, r25
160: 8b b9 out 0x0b, r24 ; 11
162: 08 95 ret
00000164 <main>:
}
int main(void) {
initializeLED(); // Initialize the LED pin
164: 0e 94 ab 00 call 0x156 ; 0x156 <initializeLED>
setupTimer0(); // Setup Timer0
168: 0e 94 48 00 call 0x90 ; 0x90 <setupTimer0>
sei(); // Enable global interrupts
16c: 78 94 sei
waitUntil(500); // Wait until 500 ms have passed
16e: 64 ef ldi r22, 0xF4 ; 244
170: 71 e0 ldi r23, 0x01 ; 1
172: 80 e0 ldi r24, 0x00 ; 0
174: 90 e0 ldi r25, 0x00 ; 0
176: 0e 94 9b 00 call 0x136 ; 0x136 <waitUntil>
toggleLED(); // Toggle the LED to turn it on
17a: 0e 94 ad 00 call 0x15a ; 0x15a <toggleLED>
while (1) {
waitFor(500); // Wait for 500 ms
17e: 64 ef ldi r22, 0xF4 ; 244
180: 71 e0 ldi r23, 0x01 ; 1
182: 80 e0 ldi r24, 0x00 ; 0
184: 90 e0 ldi r25, 0x00 ; 0
186: 0e 94 7b 00 call 0xf6 ; 0xf6 <waitFor>
toggleLED(); // Toggle the LED
18a: 0e 94 ad 00 call 0x15a ; 0x15a <toggleLED>
18e: f7 cf rjmp .-18 ; 0x17e <main+0x1a>
00000190 <_exit>:
190: f8 94 cli
00000192 <__stop_program>:
192: ff cf rjmp .-2 ; 0x192 <__stop_program>