我用IAR时 在c中嵌入汇编 当使用 BRCC PC+0x08 时,编译器莫名其妙的编译成BRCC PC-0x3f,
哪位高手能帮我解释并解决一下!!!!
89: asm(
90: ";if ( (wAddr & 0x0700) < 0x0200 )
"
91: "ANDI R19,0x07
"
92: "CPI R19,0x02
" );
+00000061: 7037 ANDI R19,0x07 Logical AND with immediate
+00000062: 3032 CPI R19,0x02 Compare with immediate
94:
asm( "BRCC PC+0x08
" );
+00000063: F600 BRCC PC-0x3F Branch if carry cleared
95: asm( ";return RAM[ wAddr & 0x07ff ]
"
96: "NOP
"
97: "NOP
"
98: "MOVW R30,R18
"
99: "SUBI R30,0xBB
"
100: "SBCI R31,0xFE
"
101: "LDD R16,Z+0
"
102: "RET
"
103: ";if ( (wAddr & 0x0700) > 0x02ff )
"
104: "CPI R19,0x03
"
105: "BRCS PC+0x06
"
106: ";return RAM[ (wAddr & 0x07ff) - 0x100]
"
107: "MOVW R30,R18
"
108: "SUBI R30,0xBB
"
109: "SBCI R31,0xFF
"
110: "LDD R16,Z+0
"
111: "RET
"
112: ";else return 0
"
113: "LDI R16,0x00
"
114: "NOP
"
115: "NOP
"
116: "NOP
"
117: "RET
" );
+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
此帖出自
小平头技术问答
一周热门 更多>