看看本人的测试程序:
#include "avr/io.h"
int main(void) {
long x,y;
while (1) {
x = OCR1A; y = ICR1;
if (x>y) PORTD++;
}
}
下面是编译结果:
0000005c <main>:
#include "avr/io.h"
int main(void) {
5c: cf e5 ldi r28, 0x5F ; 95
5e: d4 e0 ldi r29, 0x04 ; 4
60: de bf out 0x3e, r29 ; 62
62: cd bf out 0x3d, r28 ; 61
long x,y;
while (1) {
x = OCR1A; y = ICR1;
64: 8a b5 in r24, 0x2a ; 42
66: 9b b5 in r25, 0x2b ; 43
68: 9c 01 movw r18, r24
6a: 44 27 eor r20, r20
6c: 55 27 eor r21, r21
6e: 86 b5 in r24, 0x26 ; 38
70: 97 b5 in r25, 0x27 ; 39
72: aa 27 eor r26, r26
74: bb 27 eor r27, r27
if (x>y) PORTD++;
76: 82 17 cp r24, r18
78: 93 07 cpc r25, r19
7a: a4 07 cpc r26, r20
7c: b5 07 cpc r27, r21
7e: 94 f7 brge .-28 ; 0x64 <main+0x8>
80: 82 b3 in r24, 0x12 ; 18
82: 8f 5f subi r24, 0xFF ; 255
84: 82 bb out 0x12, r24 ; 18
86: ee cf rjmp .-36 ; 0x64 <main+0x8> |