完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我使用MPLAB XIDE版本= 3.51 xC16版本=1.30,但是,我发现MPLAB XIDE Bug MPLAB XIDE不能处理BTSC和BTSS指令。请参阅WQ1.JPG和WQ2.JPG文件。WQ3.JPG和WQ4.JPG,对Asm的C编译器也是无效的。
以上来自于百度翻译 以下为原文 I use MPLAB XIDE version=3.51 XC16 version=1.30 But, I find MPLAB XIDE big bug. MPLAB XIDE can not process BTSC and BTSS instruction. Please see wq1.jpg and wq2.jpg files. wq3.jpg and wq4.jpg, The C Compiler to Asm is also inefficiency. Attached Image(s) |
|
相关推荐
19个回答
|
|
|
用更多的话来描述你的问题。图片没有清楚地解释你的问题是什么。关于效率,你是使用免费的还是PRO模式的编译器?
以上来自于百度翻译 以下为原文 Describe your problem in more words. The pictures do not clearly explain what your problem is. Regarding the efficiency, are you using the compiler in Free, or Pro mode? |
|
|
|
|
|
关于效率,我使用免费版本。对于图片WQ2.jpg1),RB12引脚是LoO2)设置光标到“ASM(MOV,α0x1000,W0));“3”总是按下F8(步骤4)。RB12引脚是HI(然后按下键F8)5)Basas-LATB12= HI,所以Next“NOP())不能运行。游标跳转到这里==&>;“ASM(“BTSC,O-LATB,γ12”);然后按下F8键)跳转到这里==&>;“ASM(“NOP”)”;//跳2,它是错误的,光标应该跳转到“ASM(“NOP”)”;//跳转1“BasasBTSC是位测试F,跳过如果清除,RB12是HI,不是Low。
以上来自于百度翻译 以下为原文 Regarding the efficiency, I use free version. For picture wq2.jpg 1) RB12 pin is Low 2) set cursor to "asm ("MOV, #0x1000 ,W0 ");" 3) always press the F8 (step over) 4) RB12 pin is Hi (and then press key F8) 5) Becase _LATB12 = Hi, So next "NOP()" can not run. Cursor jump to here ==> "asm ("BTSC, _LATB ,#12 ");" 6) and then press key F8 7) Cursor jump to here ==> "asm ("NOP "); // jump 2" , it is Wrong, Cursor should jump to "asm ("NOP "); // jump 1" Becase BTSC is Bit Test f, Skip if Clear, The RB12 is Hi, not Low. Attached Image(s) |
|
|
|
|
|
是的,免费编译器比你必须支付的效率要低得多。你用的是哪一张照片?你用的是真正的PIC还是模拟器?
以上来自于百度翻译 以下为原文 Yes the Free compiler is much less efficient than the one you have to pay for. Which pic are you using? Are you using a real pic or the simulator? |
|
|
|
|
|
工具:PICTIT3&ICD3PIC:DSPIC33 FJ16GS502
以上来自于百度翻译 以下为原文 Tool : PICkit3 & ICD3 pic : dsPIC33FJ16GS502 |
|
|
|
|
|
如果要提供BTSC和BTSS,C编译器就应该使用它,不应该是免费的或PRO。
以上来自于百度翻译 以下为原文 If there is to provide BTSC and BTSS, C compiler should use it fishes. Should not be Free or Pro respectively. |
|
|
|
|
|
抱歉,你无法解释你想说什么。你在评论C编译器如何高效地为IF-语句生成代码吗?在这个论坛上已经讨论了这个问题。编译器生成代码来处理IFE()的所有可能性,否则,编译器的PRO版本就清除了不需要的比特。
以上来自于百度翻译 以下为原文 Sorry, cannot work out what you are trying to say. Are you commenting on how efficiently the C compiler generates code for if() statements? That has been discussed to death on this forum. The compiler generates code to handle all possibilities of if(), else ,,, then the PRO version of the compiler cleans up the unneeded bits. You have to accept that the free version is not going to be as efficient. |
|
|
|
|
|
在猜测中,原始海报可能会看到断点打滑的副作用。OP应该使用模拟器来尝试一个简单的程序,以查看比特测试和跳过指令是否有效,以及在使用真实硬件时使用ICD时会发生什么。
以上来自于百度翻译 以下为原文 At a guess the Original Poster may be seeing a side effect of break point skidding. The OP should try a simple program using the simulator to see that the bit test and skip instruction do work and what to expect when using the ICD with real hardware. |
|
|
|
|
|
在模拟器中工作得很好。它可以执行第一和第三个NOP的(RB12=0),或第二和第三(RB12=1),正如预期的那样。PRO模式使用BTST的IF。完全可以接受的,你得到你所支付的。编辑:-忘记添加,如果你想看到一些奇怪的优化,编译在-O2或-O3。似乎试图打开while(1)循环。或者你至少得到2份以上的复印件。混淆地狱的拆卸视图:-D
以上来自于百度翻译 以下为原文 Works perfectly well in the simulator. It either executes the first & third NOP's (RB12=0), or the second and third (RB12=1), as expected. Also, code output from Pro mode -Os ! while(1) ! { ! LATB=LATB^0x1000; 0x2D2: BTG 0x2CD, #4 ! if (_LATB12==0) 0x2D4: BTST 0x2CD, #4 0x2D6: BRA NZ, 0x2DA ! Nop(); 0x2D8: NOP ! asm ("BTSC,_LATB,#12"); 0x2DA: BTSC 0x2CD, #4 ! asm ("NOP"); 0x2DC: NOP ! asm ("NOP"); 0x2DE: NOP ! i++; 0x2E0: INC W0, W0 ! r=i; 0x2E2: MOV W0, [W15-2] ! } 0x2E4: BRA 0x2D2 Perfectly reasonable code. Pro mode uses BTST for the if. Perfectly acceptable, you gets what you pays for. Edit:- Forgot to add, if you want to see some weird optimisation, compile at -O2 or -O3. Seems to try to unroll the while(1) loop. Or you at least get 2 consecutive copies of the above. Confuses the hell out of the disassembly view :-D |
|
|
|
|
|
我的大错误组合是:XIDE(V3.51)+XC16(V1.30)+ Reli-DSPIC33 FJ16GS502,这不是模拟器的使用。我不得不说,在免费编译器中有一个bug。
以上来自于百度翻译 以下为原文 My Big BUG combination is: XIDE (v3.51)+ XC16 (V1.30) + RELA-IC dsPIC33FJ16GS502 It's not the use of the simulator. I have to say that there is a bug in the FREE-Compiler. |
|
|
|
|
|
你的大错误是你不理解。不要用C编译器,如果你想要100%,使用汇编程序。它和你编写的代码一样有效。你是说有bug吗?在MPLAX中,是的,很多。您的ASM语句也应该是不稳定的。
以上来自于百度翻译 以下为原文 Your BIG BUG is you not understanding. Don't use the C Compiler for asm if you want 100%, use the assembler. It is only efficient as the code you write. Are you saying there are bugs? in mplab x, yes, many. Also your asm statements should be volatile. |
|
|
|
|
|
嗨,你的代码中有一些奇怪的东西…你正在测试输出信号的水平:如果({LATB12==0),输出电平由你的软件控制,所以不需要测试它…一般来说,一个测试输入信号的水平:如果(yRB12==0)
以上来自于百度翻译 以下为原文 Hi, There is something "strange" in your code... You are testing the level of an output signal : if (_LATB12 == 0) The output level is controlled by your software so there is no need to test it.... In general one tests the level of input signals : if (_RB12 == 0) Regards |
|
|
|
|
|
在XIDE汇编器调试模式下,如果使用BTSC命令,则会出现错误。请参阅我所附的图像。BTSC-YLTAB,Y=12=0或BTSC-LITAB,Y=12=1,它将跳转错误。
以上来自于百度翻译 以下为原文 In XIDE assembler debug mode, if use BTSC command, there will be error. Please see my Attached Image. BTSC _LTAB,#12 ==0 or BTSC _LTAB,#12 ==1, it will jump wrong. |
|
|
|
|
|
我已经说过,你的ASM语句应该是不稳定的。
以上来自于百度翻译 以下为原文 I've already said that your asm statements should be volatile. |
|
|
|
|
|
在汇编代码中,它不需要是易失性的,只需要正确执行,但是BTSC为什么不能正确执行。这是一个XIDE或XC16错误。
以上来自于百度翻译 以下为原文 In assembler CODE, It does not need to be volatile. It only needs to be executed correctly. However, BTSC why can't be properly executed. This is a XIDE or XC16 bug. |
|
|
|
|
|
当你不能得到一个简单的比特测试指令时,我就不会开始讲道。你没有使用汇编程序。你已经使用了内联汇编程序,问问其他人,他们也会告诉你。
以上来自于百度翻译 以下为原文 I wouldn't start preaching when you can't get a simple bit test instruction working. You've not using the assembler. You've using the inline assembler. Ask anyone else on here and they will tell you the same. |
|
|
|
|
|
为什么要使用内联汇编程序?因为C的自由编译存在问题,所以它是一个大的无bug编译器。如果(αLATB12=0)0x2F0:MOV LATB,W50X2F2:MOVα0x1000,W40X2F4:和W5,W4,W40X2F6:子W4,α0x0,[W15] 0x2F8:BRA NZ,0x2FC.为什么它不使用BTSC?ASM(“BTSC,LATB,α12”),//(如果LATB12==0)为什么???????
以上来自于百度翻译 以下为原文 Why do I use the inline assembler? Because there is a problem with the free compilation for C. It is a Big Bug Free-Compiler. ! if(_LATB12 == 0) 0x2F0: MOV LATB, W5 0x2F2: MOV #0x1000, W4 0x2F4: AND W5, W4, W4 0x2F6: SUB W4, #0x0, [W15] 0x2F8: BRA NZ, 0x2FC Why doesn't it use BTSC ? asm ("BTSC, _LATB ,#12 "); // if(_LATB12 == 0) Why????? |
|
|
|
|
|
|
|
|
|
|
|
事实上,如果你尝试编写一个C编译器,你会发现当你对表达式进行评估时,你首先进入一个非常通用的路径,适用于所有类型的表达式;只有在以后,你可以尽可能多地使用CPU特定的结构来进行优化。当你支付“:”时,做“后”-gt;
以上来自于百度翻译 以下为原文 This pops up quite often: actually, if you try and write a C compiler, you'll find out that when evaluating expression you FIRST go to a very generic path, suitable for ALL TYPES of expressions; only LATER you optimize as much as you can, using CPU-specific constructs etc... In this case, they choose to make "later" -> "when you pay" :) |
|
|
|
|
|
第三次。你似乎听不进去。易失性ASM语句。
以上来自于百度翻译 以下为原文 Third time. You don't seem to listen. Volatile asm statements. int x=0,test=1; asm volatile("btsc %0,#0":"+r"(test)); asm volatile("setm %0":"+r"(x)); printf("x=%ir",x); |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1097浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 07:44 , Processed in 0.980753 second(s), Total 108, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1513