- 注册时间
- 2014-6-29
- 最后登录
- 1970-1-1
- 威望
- 星
- 金币
- 枚
- 贡献
- 分
- 经验
- 点
- 鲜花
- 朵
- 魅力
- 点
- 上传
- 次
- 下载
- 次
- 积分
- 812
- 在线时间
- 小时
|
楼主 |
发表于 2014-7-3 23:14:37
|
显示全部楼层
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,@R0
- C:0x000C 600C JZ C:001A
- C:0x000E 14 DEC A
- C:0x000F FF MOV R7,A
- C:0x0010 120003 LCALL addto(C:0003)
- C:0x0013 A808 MOV R0,?C_IBP(0x08)
- C:0x0015 E6 MOV A,@R0
- C:0x0016 2F ADD A,R7
- C:0x0017 FF MOV R7,A
- C:0x0018 8002 SJMP C:001C
- C:0x001A 7F00 MOV R7,#0x00
- 4: }
- C:0x001C 0508 INC ?C_IBP(0x08)
- C:0x001E 22 RET
- C:0x001F 787F MOV R0,#0x7F
- C:0x0021 E4 CLR A
- C:0x0022 F6 MOV @R0,A
- C:0x0023 D8FD DJNZ R0,C:0022
- C: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,#0x0A
- C:0x002D 120003 LCALL addto(C:0003)
- C:0x0030 8F90 MOV P1(0x90),R7
- 7: }
- C:0x0032 22 RET
复制代码 |
|