: void delay(unsigned int t)
+00000095: 934A ST -Y,R20 Store indirect and predecrement
+00000096: 935A ST -Y,R21 Store indirect and predecrement
9: for(i=0;i<t;i++)NOP();
+00000097: 2744 CLR R20 Clear Register
+00000098: 2755 CLR R21 Clear Register
+00000099: C003 RJMP PC+0x0004 Relative jump
9: for(i=0;i<t;i++)NOP();
+0000009A: 0000 NOP No operation
9: for(i=0;i<t;i++)NOP();
+0000009B: 5F4F SUBI R20,0xFF Subtract immediate
+0000009C: 4F5F SBCI R21,0xFF Subtract immediate with carry
9: for(i=0;i<t;i++)NOP();
+0000009D: 1740 CP R20,R16 Compare
+0000009E: 0751 CPC R21,R17 Compare with carry
+0000009F: F3D0 BRCS PC-0x05 Branch if carry set
+000000A0: 9159 LD R21,Y+ Load indirect and postincrement
为什么有那么多个for(i=0;i<t;i++)NOP();啊,
ICC里是这样
void delay(unsigned int t)
{
unsigned int i;
for(i=0;i<t;i++)NOP();
}
这个delay函数非常奇怪,进到for里面就出不来了,所以我才看他的汇编代码的,一看,为什么会有那么多个for啊,求指点 |