📄 pran.lst
字号:
1 .file "pran.c"
2 .arch atmega8535
3 __SREG__ = 0x3f
4 __SP_H__ = 0x3e
5 __SP_L__ = 0x3d
6 __tmp_reg__ = 0
7 __zero_reg__ = 1
8 .global __do_copy_data
9 .global __do_clear_bss
12 .text
13 .Ltext0:
88 .global count
89 .global count
90 .section .bss
93 count:
94 0000 0000 .skip 2,0
95 .global timer_count
96 .global timer_count
99 timer_count:
100 0002 0000 .skip 2,0
101 .global buzzer
102 .global buzzer
105 buzzer:
106 0004 0000 .skip 2,0
107 .global buzzer_setting
108 .global buzzer_setting
111 buzzer_setting:
112 0006 0000 .skip 2,0
113 .global ontime
114 .global ontime
117 ontime:
118 0008 0000 .skip 2,0
119 .global offtime
120 .data
123 offtime:
124 0000 0300 .word 3
125 .global offtimetemp
128 offtimetemp:
129 0002 0300 .word 3
130 .global setting
133 setting:
134 0004 0100 .word 1
135 .text
138 io_init:
1:pran.c **** //Pran.c : source file for the Kapalbharti Prnayam project
2:pran.c ****
3:pran.c ****
4:pran.c **** #include <Interrupt.h>
5:pran.c **** #include <delay.h>
6:pran.c ****
7:pran.c **** int count = 0; //for actual timer count on seven segment display
8:pran.c **** int timer_count=0; //used to calculate the time in seconds. for sevend segment display
9:pran.c **** int buzzer = 0; // 0 - buzzer off , 1 - buzzer on
10:pran.c **** int buzzer_setting = 0; //0 - timer0, 1 - timer1, 2 - timer2
11:pran.c ****
12:pran.c **** int ontime = 0;
13:pran.c **** int offtime = 3,offtimetemp = 3; // = 4 for timer1 (1.5 sec), and = 5 for timer2(2sec). These are c
14:pran.c ****
15:pran.c **** int setting = 1; // this setting makes the count of 1 second in case when off time of timer is 1se
16:pran.c ****
17:pran.c **** void decode_count(int);
18:pran.c **** void decode_buzzer_count(int);
19:pran.c **** static void io_init(void);
20:pran.c **** void extint_init(void);
21:pran.c **** void timers_init(void);
22:pran.c **** uint8_t send_data_to_decoder_high(int);
23:pran.c **** uint8_t send_data_to_decoder_low(int);
24:pran.c **** void temp(int);
25:pran.c ****
26:pran.c **** static void io_init(void)
27:pran.c **** {
140 .LM1:
141 /* prologue: frame size=0 */
142 /* prologue end (size=0) */
28:pran.c **** // PortB //output port
29:pran.c **** PORTB = 0xff;
144 .LM2:
145 0000 8FEF ldi r24,lo8(-1)
146 0002 88BB out 56-0x20,r24
30:pran.c **** DDRB = 0xff;
148 .LM3:
149 0004 87BB out 55-0x20,r24
31:pran.c **** // PortC //output port
32:pran.c **** PORTC = 0xff;
151 .LM4:
152 0006 85BB out 53-0x20,r24
33:pran.c **** DDRC = 0xff;
154 .LM5:
155 0008 84BB out 52-0x20,r24
34:pran.c **** // PortA //input port
35:pran.c **** PORTA = 0xff;
157 .LM6:
158 000a 8BBB out 59-0x20,r24
36:pran.c **** DDRA = 0x0;
160 .LM7:
161 000c 1ABA out 58-0x20,__zero_reg__
37:pran.c **** // PortD //output port(PORTD2) and input port as interrupt is to be recieved
38:pran.c **** PORTD = 0x0;
163 .LM8:
164 000e 12BA out 50-0x20,__zero_reg__
39:pran.c **** DDRD = 0xfb;
166 .LM9:
167 0010 8BEF ldi r24,lo8(-5)
168 0012 81BB out 49-0x20,r24
40:pran.c **** }
170 .LM10:
171 /* epilogue: frame size=0 */
172 0014 0895 ret
173 /* epilogue end (size=1) */
174 /* function io_init size 11 (10) */
176 .Lscope0:
179 .global extint_init
181 extint_init:
41:pran.c ****
42:pran.c **** void extint_init(void)
43:pran.c **** {
183 .LM11:
184 /* prologue: frame size=0 */
185 /* prologue end (size=0) */
44:pran.c **** // INT0 Enabled, Mode: Falling Edge
45:pran.c **** MCUCR = 0x02;
187 .LM12:
188 0016 82E0 ldi r24,lo8(2)
189 0018 85BF out 85-0x20,r24
46:pran.c **** GICR = 0x40;
191 .LM13:
192 001a 80E4 ldi r24,lo8(64)
193 001c 8BBF out 91-0x20,r24
47:pran.c **** }
195 .LM14:
196 /* epilogue: frame size=0 */
197 001e 0895 ret
198 /* epilogue end (size=1) */
199 /* function extint_init size 5 (4) */
201 .Lscope1:
204 .global __vector_1
206 __vector_1:
48:pran.c ****
49:pran.c **** ISR(SIG_INTERRUPT0)
50:pran.c **** {
208 .LM15:
209 /* prologue: frame size=0 */
210 0020 1F92 push __zero_reg__
211 0022 0F92 push __tmp_reg__
212 0024 0FB6 in __tmp_reg__,__SREG__
213 0026 0F92 push __tmp_reg__
214 0028 1124 clr __zero_reg__
215 002a 2F93 push r18
216 002c 3F93 push r19
217 002e 4F93 push r20
218 0030 5F93 push r21
219 0032 6F93 push r22
220 0034 7F93 push r23
221 0036 8F93 push r24
222 0038 9F93 push r25
223 003a AF93 push r26
224 003c BF93 push r27
225 003e CF93 push r28
226 0040 DF93 push r29
227 0042 EF93 push r30
228 0044 FF93 push r31
229 /* prologue end (size=19) */
51:pran.c **** int led;
52:pran.c ****
53:pran.c **** /*
54:pran.c **** All input switches will connected to their corresponding port lines, and also all
55:pran.c **** switches will be connnected to PORTD2 (pin no. 16).
56:pran.c **** */
57:pran.c ****
58:pran.c **** // INT0 Enabled, Mode: Falling Edge
59:pran.c **** led = PINA;
231 .LM16:
232 .LBB2:
233 0046 89B3 in r24,57-0x20
234 0048 C82F mov r28,r24
235 004a DD27 clr r29
60:pran.c **** MCUCR = 0x02;
237 .LM17:
238 004c 82E0 ldi r24,lo8(2)
239 004e 85BF out 85-0x20,r24
61:pran.c **** GICR = 0x40;
241 .LM18:
242 0050 80E4 ldi r24,lo8(64)
243 0052 8BBF out 91-0x20,r24
62:pran.c ****
63:pran.c **** if(led == 254) //if switch to 'increase the count' is pressed, PORTA0 (pin no. 40)
245 .LM19:
246 0054 CE3F cpi r28,254
247 0056 D105 cpc r29,__zero_reg__
248 0058 01F4 brne .L4
64:pran.c **** {
65:pran.c **** if(count != 9) {
250 .LM20:
251 005a 8091 0000 lds r24,count
252 005e 9091 0000 lds r25,(count)+1
253 0062 8930 cpi r24,9
254 0064 9105 cpc r25,__zero_reg__
255 0066 01F0 breq .L5
66:pran.c **** count++;
257 .LM21:
258 0068 0196 adiw r24,1
259 006a 9093 0000 sts (count)+1,r25
260 006e 8093 0000 sts count,r24
67:pran.c **** decode_count(count);
262 .LM22:
263 0072 00D0 rcall decode_count
264 .L5:
68:pran.c **** }
69:pran.c **** sei();
266 .LM23:
267 /* #APP */
268 0074 7894 sei
70:pran.c **** PORTA = 0xff;
270 .LM24:
271 /* #NOAPP */
272 0076 8FEF ldi r24,lo8(-1)
273 0078 8BBB out 59-0x20,r24
274 .L4:
71:pran.c **** }
72:pran.c ****
73:pran.c **** if(led == 253) //if switch to 'decrease the count' is pressed, PORTA1 (pin no. 39)
276 .LM25:
277 007a CD3F cpi r28,253
278 007c D105 cpc r29,__zero_reg__
279 007e 01F4 brne .L6
74:pran.c **** {
75:pran.c **** if(count != 0) {
281 .LM26:
282 0080 8091 0000 lds r24,count
283 0084 9091 0000 lds r25,(count)+1
284 0088 0097 sbiw r24,0
285 008a 01F0 breq .L7
76:pran.c **** count--;
287 .LM27:
288 008c 0197 sbiw r24,1
289 008e 9093 0000 sts (count)+1,r25
290 0092 8093 0000 sts count,r24
77:pran.c **** decode_count(count);
292 .LM28:
293 0096 00D0 rcall decode_count
294 .L7:
78:pran.c **** }
79:pran.c **** sei();
296 .LM29:
297 /* #APP */
298 0098 7894 sei
80:pran.c **** PORTA = 0xff;
300 .LM30:
301 /* #NOAPP */
302 009a 8FEF ldi r24,lo8(-1)
303 009c 8BBB out 59-0x20,r24
304 .L6:
81:pran.c **** }
82:pran.c ****
83:pran.c **** if(led == 251) //if switch to 'start the timer' is pressed, PORTA2 (pin no. 38)
306 .LM31:
307 009e CB3F cpi r28,251
308 00a0 D105 cpc r29,__zero_reg__
309 00a2 01F4 brne .L8
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -