玩AVR不久,发现一条空的程序,但是汇编代码里面还是有不知名的代码,求教。
C程序:
void main(void)
{
;
}
汇编结果:
+00000000: 940C002A JMP 0x0000002A Jump
.......
.......(这里没有用到,省略N行)
+0000002A: E5CF LDI R28,0x5F Load immediate
+0000002B: E0D8 LDI R29,0x08 Load immediate
+0000002C: BFCD OUT 0x3D,R28 Out to I/O location
+0000002D: BFDE OUT 0x3E,R29 Out to I/O location
+0000002E: 51C0 SUBI R28,0x10 Subtract immediate
+0000002F: 40D0 SBCI R29,0x00 Subtract immediate with carry
+00000030: EA0A LDI R16,0xAA Load immediate
+00000031: 8308 STD Y+0,R16 Store indirect with displacement
+00000032: 2400 CLR R0 Clear Register
+00000033: E6E0 LDI R30,0x60 Load immediate
+00000034: E0F0 LDI R31,0x00 Load immediate
+00000035: E010 LDI R17,0x00 Load immediate
+00000036: 36E0 CPI R30,0x60 Compare with immediate
+00000037: 07F1 CPC R31,R17 Compare with carry
+00000038: F011 BREQ PC+0x03 Branch if equal
+00000039: 9201 ST Z+,R0 Store indirect and postincrement
+0000003A: CFFB RJMP PC-0x0004 Relative jump
+0000003B: 8300 STD Z+0,R16 Store indirect with displacement
+0000003C: E5E4 LDI R30,0x54 Load immediate
+0000003D: E0F0 LDI R31,0x00 Load immediate
+0000003E: E6A0 LDI R26,0x60 Load immediate
+0000003F: E0B0 LDI R27,0x00 Load immediate
+00000040: E010 LDI R17,0x00 Load immediate
+00000041: 35E4 CPI R30,0x54 Compare with immediate
+00000042: 07F1 CPC R31,R17 Compare with carry
+00000043: F021 BREQ PC+0x05 Branch if equal
+00000044: 95C8 LPM Load program memory
+00000045: 9631 ADIW R30,0x01 Add immediate to word
+00000046: 920D ST X+,R0 Store indirect and postincrement
+00000047: CFF9 RJMP PC-0x0006 Relative jump
+00000048: 940E004B CALL 0x0000004B Call subroutine
+0000004A: CFFF RJMP PC-0x0000 Relative jump
@0000004B: main
---- main.c ---------------------------------------------------------------------------------------
5: ;
+0000004B: 9508 RET Subroutine return
C用ICC写,汇编用AVRstudio4看。请问那堆代码什么意思?当中还有LPM指令 |