|
我用IAR时 在c中嵌入汇编 当使用 BRCC PC+0x08 时,编译器莫名其妙的编译成BRCC PC-0x3f,
哪位高手能帮我解释并解决一下!!!!
89: asm(
90: ";if ( (wAddr & 0x0700) < 0x0200 )\n"
91: "ANDI R19,0x07 \n"
92: "CPI R19,0x02 \n" );
+00000061: 7037 ANDI R19,0x07 Logical AND with immediate
+00000062: 3032 CPI R19,0x02 Compare with immediate
94: asm( "BRCC PC+0x08 \n" );
+00000063: F600 BRCC PC-0x3F Branch if carry cleared
95: asm( ";return RAM[ wAddr & 0x07ff ] \n"
96: "NOP \n"
97: "NOP \n"
98: "MOVW R30,R18 \n"
99: "SUBI R30,0xBB \n"
100: "SBCI R31,0xFE \n"
101: "LDD R16,Z+0 \n"
102: "RET \n"
103: ";if ( (wAddr & 0x0700) > 0x02ff )\n"
104: "CPI R19,0x03 \n"
105: "BRCS PC+0x06 \n"
106: ";return RAM[ (wAddr & 0x07ff) - 0x100] \n"
107: "MOVW R30,R18 \n"
108: "SUBI R30,0xBB \n"
109: "SBCI R31,0xFF \n"
110: "LDD R16,Z+0 \n"
111: "RET \n"
112: ";else return 0 \n"
113: "LDI R16,0x00 \n"
114: "NOP \n"
115: "NOP \n"
116: "NOP \n"
117: "RET \n" );
+00000064: 0000 NOP No operation
+00000065: 0000 NOP No operation
+00000066: 01F9 MOVW R30,R18 Copy register pair
+00000067: 5BEB SUBI R30,0xBB Subtract immediate
+00000068: 4FFE SBCI R31,0xFE Subtract immediate with carry
+00000069: 8100 LDD R16,Z+0 Load indirect with displacement
+0000006A: 9508 RET Subroutine return
+0000006B: 3033 CPI R19,0x03 Compare with immediate
+0000006C: F1B0 BRCS PC+0x37 Branch if carry set
+0000006D: 01F9 MOVW R30,R18 Copy register pair
+0000006E: 5BEB SUBI R30,0xBB Subtract immediate
+0000006F: 4FFF SBCI R31,0xFF Subtract immediate with carry
+00000070: 8100 LDD R16,Z+0 Load indirect with displacement
+00000071: 9508 RET Subroutine return
+00000072: E000 LDI R16,0x00 Load immediate
+00000073: 0000 NOP No operation
+00000074: 0000 NOP No operation
+00000075: 0000 NOP No operation
+00000076: 9508 RET Subroutine return
|
|