|
发表于 2024-4-10 16:22:28
|
显示全部楼层
Build target 'Target 1'
compiling main.c...
MAIN.C(3): warning C265: '_addto': recursive call to non-reentrant function
linking...
Program Size: data=10.0 xdata=0 code=43
"a" - 0 Error(s), 1 Warning(s).
用reentrant则
193.5us ~ 324.0us = 130.5- C:0x0000 02001F LJMP C:001F 2: char addto(char i)reentrant { C:0x0003 1508 DEC ?C_IBP(0x08)C:0x0005 A808 MOV R0,?C_IBP(0x08)C:0x0007 A607 MOV @R0,0x07 3: return i?addto(i-1)+i:0; C:0x0009 A808 MOV R0,?C_IBP(0x08)C:0x000B E6 MOV A,@R0C:0x000C 600C JZ C:001AC:0x000E 14 DEC AC:0x000F FF MOV R7,AC:0x0010 120003 LCALL addto(C:0003)C:0x0013 A808 MOV R0,?C_IBP(0x08)C:0x0015 E6 MOV A,@R0C:0x0016 2F ADD A,R7C:0x0017 FF MOV R7,AC:0x0018 8002 SJMP C:001CC:0x001A 7F00 MOV R7,#0x00 4: } C:0x001C 0508 INC ?C_IBP(0x08)C:0x001E 22 RET C:0x001F 787F MOV R0,#0x7FC:0x0021 E4 CLR AC:0x0022 F6 MOV @R0,AC:0x0023 D8FD DJNZ R0,C:0022C:0x0025 758108 MOV SP(0x81),#?C_IBP(0x08)C:0x0028 02002B LJMP main(C:002B) 5: void main(){ 6: P1=addto(10); C:0x002B 7F0A MOV R7,#0x0AC:0x002D 120003 LCALL addto(C:0003)C:0x0030 8F90 MOV P1(0x90),R7 7: }C:0x0032 22 RET
复制代码 |
|