|
发表于 2009-5-13 20:31:38
|
显示全部楼层
【11楼】 yyccaa
呵呵,没往下看,还要求参数必须是常量的,优化后外面那层全没了:
000001ae <DelayMS>:
1ae: 00 97 sbiw r24, 0x00 ; 0
1b0: 39 f0 breq .+14 ; 0x1c0 <DelayMS+0x12>
1b2: 3f ef ldi r19, 0xFF ; 255
1b4: 23 2f mov r18, r19
1b6: 00 00 nop
1b8: 21 50 subi r18, 0x01 ; 1
1ba: e9 f7 brne .-6 ; 0x1b6 <DelayMS+0x8>
1bc: 01 97 sbiw r24, 0x01 ; 1
1be: d1 f7 brne .-12 ; 0x1b4 <DelayMS+0x6>
1c0: 08 95 ret
000001c2 <DelayUS>:
1c2: 88 23 and r24, r24
1c4: 19 f0 breq .+6 ; 0x1cc <DelayUS+0xa>
1c6: 00 00 nop
1c8: 81 50 subi r24, 0x01 ; 1
1ca: e9 f7 brne .-6 ; 0x1c6 <DelayUS+0x4>
1cc: 08 95 ret
000001ce <main>:
DelayMS(500);
1ce: 84 ef ldi r24, 0xF4 ; 244
1d0: 91 e0 ldi r25, 0x01 ; 1
1d2: 0e 94 d7 00 call 0x1ae ; 0x1ae <DelayMS>
_delay_ms(1);
1d6: 80 ed ldi r24, 0xD0 ; 208
1d8: 97 e0 ldi r25, 0x07 ; 7
1da: 01 97 sbiw r24, 0x01 ; 1
1dc: f1 f7 brne .-4 ; 0x1da <main+0xc> |
|