📄 car_follow.lss
字号:
car_follow.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000001ec 00000000 00000000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .bss 00000002 00800060 00800060 00000260 2**0
ALLOC
2 .debug_aranges 00000040 00000000 00000000 00000260 2**0
CONTENTS, READONLY, DEBUGGING
3 .debug_pubnames 000000e3 00000000 00000000 000002a0 2**0
CONTENTS, READONLY, DEBUGGING
4 .debug_info 000001e9 00000000 00000000 00000383 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_abbrev 000000cd 00000000 00000000 0000056c 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_line 000002f3 00000000 00000000 00000639 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_frame 000000f0 00000000 00000000 0000092c 2**2
CONTENTS, READONLY, DEBUGGING
8 .debug_str 00000105 00000000 00000000 00000a1c 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 0c 94 2a 00 jmp 0x54 ; 0x54 <__ctors_end>
4: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
8: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
c: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
10: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
14: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
18: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
1c: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
20: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
24: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
28: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
2c: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
30: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
34: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
38: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
3c: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
40: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
44: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
48: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
4c: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
50: 0c 94 47 00 jmp 0x8e ; 0x8e <__bad_interrupt>
00000054 <__ctors_end>:
54: 11 24 eor r1, r1
56: 1f be out 0x3f, r1 ; 63
58: cf e5 ldi r28, 0x5F ; 95
5a: d4 e0 ldi r29, 0x04 ; 4
5c: de bf out 0x3e, r29 ; 62
5e: cd bf out 0x3d, r28 ; 61
00000060 <__do_copy_data>:
60: 10 e0 ldi r17, 0x00 ; 0
62: a0 e6 ldi r26, 0x60 ; 96
64: b0 e0 ldi r27, 0x00 ; 0
66: ec ee ldi r30, 0xEC ; 236
68: f1 e0 ldi r31, 0x01 ; 1
6a: 02 c0 rjmp .+4 ; 0x70 <.do_copy_data_start>
0000006c <.do_copy_data_loop>:
6c: 05 90 lpm r0, Z+
6e: 0d 92 st X+, r0
00000070 <.do_copy_data_start>:
70: a0 36 cpi r26, 0x60 ; 96
72: b1 07 cpc r27, r17
74: d9 f7 brne .-10 ; 0x6c <.do_copy_data_loop>
00000076 <__do_clear_bss>:
76: 10 e0 ldi r17, 0x00 ; 0
78: a0 e6 ldi r26, 0x60 ; 96
7a: b0 e0 ldi r27, 0x00 ; 0
7c: 01 c0 rjmp .+2 ; 0x80 <.do_clear_bss_start>
0000007e <.do_clear_bss_loop>:
7e: 1d 92 st X+, r1
00000080 <.do_clear_bss_start>:
80: a2 36 cpi r26, 0x62 ; 98
82: b1 07 cpc r27, r17
84: e1 f7 brne .-8 ; 0x7e <.do_clear_bss_loop>
86: 0e 94 97 00 call 0x12e ; 0x12e <main>
8a: 0c 94 f4 00 jmp 0x1e8 ; 0x1e8 <_exit>
0000008e <__bad_interrupt>:
8e: 0c 94 00 00 jmp 0 ; 0x0 <__vectors>
00000092 <sensor_init>:
unsigned int temp;
void sensor_init()
{
DDRA &= ~0x0F;
92: 8a b3 in r24, 0x1a ; 26
94: 80 7f andi r24, 0xF0 ; 240
96: 8a bb out 0x1a, r24 ; 26
PORTA |= 0x08;
98: db 9a sbi 0x1b, 3 ; 27
}
9a: 08 95 ret
0000009c <car_follow>:
void car_follow()
{
temp = PINA&0x07;
9c: 89 b3 in r24, 0x19 ; 25
9e: 90 e0 ldi r25, 0x00 ; 0
a0: 87 70 andi r24, 0x07 ; 7
a2: 90 70 andi r25, 0x00 ; 0
a4: 90 93 61 00 sts 0x0061, r25
a8: 80 93 60 00 sts 0x0060, r24
switch(temp)
ac: 83 30 cpi r24, 0x03 ; 3
ae: 91 05 cpc r25, r1
b0: 19 f1 breq .+70 ; 0xf8 <car_follow+0x5c>
b2: 84 30 cpi r24, 0x04 ; 4
b4: 91 05 cpc r25, r1
b6: 30 f4 brcc .+12 ; 0xc4 <car_follow+0x28>
b8: 81 30 cpi r24, 0x01 ; 1
ba: 91 05 cpc r25, r1
bc: b1 f0 breq .+44 ; 0xea <car_follow+0x4e>
be: 02 97 sbiw r24, 0x02 ; 2
c0: 48 f5 brcc .+82 ; 0x114 <car_follow+0x78>
c2: 0c c0 rjmp .+24 ; 0xdc <car_follow+0x40>
c4: 85 30 cpi r24, 0x05 ; 5
c6: 91 05 cpc r25, r1
c8: 29 f1 breq .+74 ; 0x114 <car_follow+0x78>
ca: 85 30 cpi r24, 0x05 ; 5
cc: 91 05 cpc r25, r1
ce: d8 f0 brcs .+54 ; 0x106 <car_follow+0x6a>
d0: 86 30 cpi r24, 0x06 ; 6
d2: 91 05 cpc r25, r1
d4: 11 f1 breq .+68 ; 0x11a <car_follow+0x7e>
d6: 07 97 sbiw r24, 0x07 ; 7
d8: 49 f5 brne .+82 ; 0x12c <car_follow+0x90>
da: 26 c0 rjmp .+76 ; 0x128 <car_follow+0x8c>
{
case 0x00: // 全部压线,原转
car_right1();
dc: 0e 94 e3 00 call 0x1c6 ; 0x1c6 <car_right1>
while((PINA&0x07) != 0x05);
e0: 89 b3 in r24, 0x19 ; 25
e2: 87 70 andi r24, 0x07 ; 7
e4: 85 30 cpi r24, 0x05 ; 5
e6: e1 f7 brne .-8 ; 0xe0 <car_follow+0x44>
e8: 08 95 ret
break;
case 0x01: // 右中压线,右转
car_right1();
ea: 0e 94 e3 00 call 0x1c6 ; 0x1c6 <car_right1>
while((PINA&0x07) != 0x05);
ee: 89 b3 in r24, 0x19 ; 25
f0: 87 70 andi r24, 0x07 ; 7
f2: 85 30 cpi r24, 0x05 ; 5
f4: e1 f7 brne .-8 ; 0xee <car_follow+0x52>
f6: 08 95 ret
break;
case 0x02: // 左右压线,直走
car_ahead();
break;
case 0x03: // 右压线, 右转
car_right1();
f8: 0e 94 e3 00 call 0x1c6 ; 0x1c6 <car_right1>
while((PINA&0x07) != 0x05);
fc: 89 b3 in r24, 0x19 ; 25
fe: 87 70 andi r24, 0x07 ; 7
100: 85 30 cpi r24, 0x05 ; 5
102: e1 f7 brne .-8 ; 0xfc <car_follow+0x60>
104: 08 95 ret
break;
case 0x04: // 左中压线,左转
car_left1();
106: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <car_left1>
while((PINA&0x07) != 0x05);
10a: 89 b3 in r24, 0x19 ; 25
10c: 87 70 andi r24, 0x07 ; 7
10e: 85 30 cpi r24, 0x05 ; 5
110: e1 f7 brne .-8 ; 0x10a <car_follow+0x6e>
112: 08 95 ret
break;
case 0x05: // 中间压线,直行
car_ahead();
114: 0e 94 c0 00 call 0x180 ; 0x180 <car_ahead>
118: 08 95 ret
break;
case 0x06: // 左压线, 左转
car_left1();
11a: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <car_left1>
while((PINA&0x07) != 0x05);
11e: 89 b3 in r24, 0x19 ; 25
120: 87 70 andi r24, 0x07 ; 7
122: 85 30 cpi r24, 0x05 ; 5
124: e1 f7 brne .-8 ; 0x11e <car_follow+0x82>
126: 08 95 ret
break;
case 0x07: // 全不压线,直行
car_ahead();
128: 0e 94 c0 00 call 0x180 ; 0x180 <car_ahead>
12c: 08 95 ret
0000012e <main>:
}
}
void main()
{
car_init();
12e: 0e 94 b8 00 call 0x170 ; 0x170 <car_init>
car_ahead();
132: 0e 94 c0 00 call 0x180 ; 0x180 <car_ahead>
car_init();
136: 0e 94 b8 00 call 0x170 ; 0x170 <car_init>
car_ahead();
13a: 0e 94 c0 00 call 0x180 ; 0x180 <car_ahead>
car_backward();
13e: 0e 94 c7 00 call 0x18e ; 0x18e <car_backward>
car_left();
142: 0e 94 ce 00 call 0x19c ; 0x19c <car_left>
car_right();
146: 0e 94 d5 00 call 0x1aa ; 0x1aa <car_right>
car_left1();
14a: 0e 94 dc 00 call 0x1b8 ; 0x1b8 <car_left1>
car_right1();
14e: 0e 94 e3 00 call 0x1c6 ; 0x1c6 <car_right1>
car_left2();
152: 0e 94 ea 00 call 0x1d4 ; 0x1d4 <car_left2>
car_right2();
156: 0e 94 ef 00 call 0x1de ; 0x1de <car_right2>
car_stop();
15a: 0e 94 bc 00 call 0x178 ; 0x178 <car_stop>
unsigned int temp;
void sensor_init()
{
DDRA &= ~0x0F;
15e: 8a b3 in r24, 0x1a ; 26
160: 80 7f andi r24, 0xF0 ; 240
162: 8a bb out 0x1a, r24 ; 26
PORTA |= 0x08;
164: db 9a sbi 0x1b, 3 ; 27
car_left2();
car_right2();
car_stop();
sensor_init();
while((PINA&0x08)==0x08);
166: cb 99 sbic 0x19, 3 ; 25
168: fe cf rjmp .-4 ; 0x166 <main+0x38>
while(1)
{
car_follow();
16a: 0e 94 4e 00 call 0x9c ; 0x9c <car_follow>
16e: fd cf rjmp .-6 ; 0x16a <main+0x3c>
00000170 <car_init>:
#include "avr/io.h"
#include "util/delay.h"
void car_init(void)
{
DDRD |= _BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5);
170: 81 b3 in r24, 0x11 ; 17
172: 8c 63 ori r24, 0x3C ; 60
174: 81 bb out 0x11, r24 ; 17
}
176: 08 95 ret
00000178 <car_stop>:
void car_stop(void)
{
PORTD |= _BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5);
178: 82 b3 in r24, 0x12 ; 18
17a: 8c 63 ori r24, 0x3C ; 60
17c: 82 bb out 0x12, r24 ; 18
}
17e: 08 95 ret
00000180 <car_ahead>:
void car_ahead(void)
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
180: 82 b3 in r24, 0x12 ; 18
182: 83 7c andi r24, 0xC3 ; 195
184: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD2) | _BV(PD4);
186: 82 b3 in r24, 0x12 ; 18
188: 84 61 ori r24, 0x14 ; 20
18a: 82 bb out 0x12, r24 ; 18
}
18c: 08 95 ret
0000018e <car_backward>:
void car_backward(void)
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
18e: 82 b3 in r24, 0x12 ; 18
190: 83 7c andi r24, 0xC3 ; 195
192: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD3) | _BV(PD5);
194: 82 b3 in r24, 0x12 ; 18
196: 88 62 ori r24, 0x28 ; 40
198: 82 bb out 0x12, r24 ; 18
}
19a: 08 95 ret
0000019c <car_left>:
void car_left(void) // 急右转
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
19c: 82 b3 in r24, 0x12 ; 18
19e: 83 7c andi r24, 0xC3 ; 195
1a0: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD3) | _BV(PD4);
1a2: 82 b3 in r24, 0x12 ; 18
1a4: 88 61 ori r24, 0x18 ; 24
1a6: 82 bb out 0x12, r24 ; 18
}
1a8: 08 95 ret
000001aa <car_right>:
void car_right(void) // 急右转
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
1aa: 82 b3 in r24, 0x12 ; 18
1ac: 83 7c andi r24, 0xC3 ; 195
1ae: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD2) | _BV(PD5);
1b0: 82 b3 in r24, 0x12 ; 18
1b2: 84 62 ori r24, 0x24 ; 36
1b4: 82 bb out 0x12, r24 ; 18
}
1b6: 08 95 ret
000001b8 <car_left1>:
void car_left1(void) // 自由+左转
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
1b8: 82 b3 in r24, 0x12 ; 18
1ba: 83 7c andi r24, 0xC3 ; 195
1bc: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD2) | _BV(PD3) | _BV(PD4);
1be: 82 b3 in r24, 0x12 ; 18
1c0: 8c 61 ori r24, 0x1C ; 28
1c2: 82 bb out 0x12, r24 ; 18
}
1c4: 08 95 ret
000001c6 <car_right1>:
void car_right1(void) // 刹车+右转
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
1c6: 82 b3 in r24, 0x12 ; 18
1c8: 83 7c andi r24, 0xC3 ; 195
1ca: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD2) | _BV(PD4) | _BV(PD5);
1cc: 82 b3 in r24, 0x12 ; 18
1ce: 84 63 ori r24, 0x34 ; 52
1d0: 82 bb out 0x12, r24 ; 18
}
1d2: 08 95 ret
000001d4 <car_left2>:
void car_left2(void) // 自由+左转
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
1d4: 82 b3 in r24, 0x12 ; 18
1d6: 83 7c andi r24, 0xC3 ; 195
1d8: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD4);
1da: 94 9a sbi 0x12, 4 ; 18
}
1dc: 08 95 ret
000001de <car_right2>:
void car_right2(void) // 自由+右转
{
PORTD &= ~(_BV(PD2) | _BV(PD3) | _BV(PD4) | _BV(PD5));
1de: 82 b3 in r24, 0x12 ; 18
1e0: 83 7c andi r24, 0xC3 ; 195
1e2: 82 bb out 0x12, r24 ; 18
PORTD |= _BV(PD5);
1e4: 95 9a sbi 0x12, 5 ; 18
}
1e6: 08 95 ret
000001e8 <_exit>:
1e8: f8 94 cli
000001ea <__stop_program>:
1ea: ff cf rjmp .-2 ; 0x1ea <__stop_program>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -