完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
这是我的代码:非常简单。我的代码字,但文件寄存器Windows DIFF0永远不会更新?其他人都这么做。我也尝试添加一个手表的IDF0,它是AlrFead 0,但我的PROFAM工作如预期。我确实检查了项目设置中的框,“内置的绝对模式”。任何帮助都会得到极大的赞赏。产品版本:MPLAB X IDE V3.50Java:1.8 091;Java热点(TM)64位服务器VM 25.91-B14Runtime:Java(TM)SE运行时环境1.80Y91-B14Stase:Windows 7版本6.1在AMD64上运行。CP1252;EN(MPLAB)
以上来自于百度翻译 以下为原文 Here is my code: radix HEX list p=16f1827 #include "p16f1827.inc" org 000 movlw 26 movwf FSR0 START movwf INDF0 movf FSR0,INDF0 incf FSR0,1 goto START END Quite simple. My code words, but the File Register window INDF0 never updates?? All the others do. I also tried to add a watch for INDF0, it is allway 0, but my progam works as expected. I did check the box in the project settings, "Build in absolute mode". Any help would be greatly appreciated. Product Version: MPLAB X IDE v3.50 Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b14 Runtime: Java(TM) SE Runtime Environment 1.8.0_91-b14 System: Windows 7 version 6.1 running on amd64; Cp1252; en (mplab) |
|
相关推荐
19个回答
|
|
|
这是什么照片?是否真的存在这样的指令:
以上来自于百度翻译 以下为原文 Which PIC is it? Does it really exist such an instruction: movf FSR0,INDF0 ? ! |
|
|
|
|
|
事实上,是的,语法:[标签] MOVF F,DPIC16(L)F1826/27数据表,第33页,寄存器F的内容根据D的状态移动到目的地,如果D=0,目的地是W寄存器。如果d=1,目的地是文件寄存器F本身。D=有助于测试文件寄存器IsStestAutoSt Z受影响。Update:以上不完整,请阅读以下内容:并从下面的QHB回复。
以上来自于百度翻译 以下为原文 Actually Yes, Syntax: [ label ] MOVF f,d PIC16(L)F1826/27 Data Sheet, page 333 The contents of register f is moved to a destination dependent upon the status of d. If d = 0, destination is W register. If d = 1, the destination is file register f itself. d = 1 is useful to test a file register since status flag Z is affected. Update: the above is incomplete, please read this: and a reply from qhb below. |
|
|
|
|
|
是的,我知道它存在,但它不可能做你所想的:即它不会移动一个寄存器或位置的内容到另一个-它只会移动一个寄存器的内容为W(因为“IDF0”作为一个标签应该等于零)。所以,回到你的代码…
以上来自于百度翻译 以下为原文 Well yes I know it exists I.e. it will not move the content of one register or location to another - it will just move one register's content into W (since "INDF0" as a label should equal zero). So, back to your code... |
|
|
|
|
|
谢谢你注意到辛吉亚。我们努力让NDF0总是读回0,尽管它实际上在模拟器中有一个地址。格林先生:
以上来自于百度翻译 以下为原文 Thank you for noticing Cinzia. We worked hard on having INDF0 always read back 0, despite the fact that it actually has an address in it in the simulator. mr green: |
|
|
|
|
|
|
|
|
|
|
|
“Iffx”是“伪寄存器”,用于“间接访问其他地址在相应的“FSRX”寄存器中的寄存器。读OP发布的代码,它看起来像是在执行一个双间接的操作,在C中,它将类似于一个指针指针。说“FSRX”是指针,只是我的2分钱。
以上来自于百度翻译 以下为原文 Hi AFAIK the "INDFx" are pseudo registers, used for "INDirect access to some other register whose address is in the corresponding "FSRx" register. Reading the code the OP posted it looks like he is trying to perform a double indirection, in "C" it would be something like a "pointer to pointer" (considering that"FSRx" are pointers. Just my 2 cents.... Best regards Jorge |
|
|
|
|
|
是的,豪尔赫-看起来我们正在“兜圈子”,我是说,这是原始代码:
以上来自于百度翻译 以下为原文 Yeah, Jorge - looks like we're "going in circles" I mean, this was original code: movlw 26 movwf FSR0 START movwf INDF0 movf FSR0,w incf FSR0,f goto START I'm wondering about these statements: "My code words, but the File Register window INDF0 never updates?? All the others do. I also tried to add a watch for INDF0, it is allway 0, but my progam works as expected. " How is it "working"? FSR points to location 26 in RAM... (suppose there is RAM at that address on this PIC), 26 is written to location 26, then 26 goes to W and FSR0 points to 27... then we restart the loop (which never ends i.e. something will be overwritten in the end) So... the point is that INDF0 is not showing those numbers? |
|
|
|
|
|
我认为CinziaG第一次做对了。MOVF指令的“D”字段不能在运行时进行评估,Idf0是一个常数,由汇编程序替换为0,因此不会在汇编程序中引发错误。在OP消息1中编码的指令无论如何都不起作用。指令代码为8。位PIC,只有1个寄存器参数的寄存器地址字段,以及一个寄存器选项位,所以MOVF指令可以将字节从FSR0移到W,或者从FSR0移到FSR0,这两个操作对Idf0的内容都没有任何影响。对Idf0有一定影响,但这取决于内存位置27和以下内容。
以上来自于百度翻译 以下为原文 I think CinziaG got it right the first time. The 'd' field of movf instruction cannot be evaluated in runtime, INDF0 is a constant that is replaced with 0 by the assembler, so doesn't provoke an error in the assembler. The instruction coded in OP message #1 doesnt work anyway. Instruction codes for 8 bit PIC, have register address field for 1 register argument only, and a single register option bit, so MOVF instruction may either move the byte from FSR0 to W, or from FSR0 to FSR0. Neither of these operations have any effect on the content of INDF0. The next instruction INCF FSR0, 1 might possibly have some effect on INDF0, but that depend upon content of memory location 27 and following. Regards, Mysil |
|
|
|
|
|
对于记录,地址26是在TMR0和更多…第一个RAM地址是地址20HAH,没有抱歉,现在我发现一个“基数十六进制”在顶部,至少部分是好的“足够”。
以上来自于百度翻译 以下为原文 For the records, address 26 is among TMR0 and more... first RAM location is at address 20h Ah no sorry, now I spot a "RADIX HEX" at top So at least that part is good "enough". |
|
|
|
|
|
我希望“我的代码”是“我的代码工作”。你从来没有解释这个程序的目的是什么,或者你知道它是如何工作的。正如Cinzia指出的,“MOVF FSR0,NDF0”的指令是无稽之谈。它将被解释为“MOVF FSR0,W”。模拟器文档告诉你它将永远是B。如果你试着去看它,你还没有解释这意味着什么。注意,在PIC16F1XXX设备中有一个指令将W写入到FSR指向的位置,并增加FSR。你没有用它。
以上来自于百度翻译 以下为原文 I expect "My code words" was meant to be "my code works". You never explained what this program was meant to do, or how you know it works. As Cinzia pointed out, the instruction "movf FSR0,INDF0" is nonsense. It will be interpreted as "movf FSR0,w" The simulator documentation tells you it will always be zero if you try to watch it. Which you still haven't explained what this means. Note, there is a single instruction in PIC16F1xxx devices to write W to the location pointed to by FSR, and increment FSR. You're not using it. |
|
|
|
|
|
好的点关于模拟器0显示当观看印度盾-也许这是乔治的意思以上,是的,可能有更好的方式来存储/增量,但因为这似乎只是一个演示程序…也许没关系。
以上来自于百度翻译 以下为原文 Good point about SIMulator showing 0 when WATCHing INDF - maybe this is what George meant above And yes there could be a better way to store/increment, but since this just seems to be a demo program... it may not matter. |
|
|
|
|
|
对。请记住,为了实现监视窗口,调试代码必须使用FSR和Idf来访问所有其他位置。数据表具体地说,如果FSR包含0(指向Idf),则总是会得到零。显然,模拟器被设计为模仿在调试模式下PIC所做的,所以它是DOE。就是这样。
以上来自于百度翻译 以下为原文 Yes. Remember that to implement the watch window, the debug code has to use FSR and INDF to access all the other locations. The datasheet specifically says, if FSR contains 0 (to point at INDF), you will always get zero. Plainly the simulator is designed to mimic what the PIC does in debug mode, so it does that same. |
|
|
|
|
|
我认为乔治说他必须写额外的代码来确保它会像PIC一样。这与ChanZig的期望相匹配,而不是OPS的预期。
以上来自于百度翻译 以下为原文 I think George was saying he had to write extra code to insure that it would behave as a PIC would. Which matches CinziaG's expectations, Not the OPs expectations. |
|
|
|
|
|
谢谢,但我现在有点困惑了。是文件寄存器吗????多好的一分钟…好吧,我确实读过,我确实读过了,但还不够透彻。两个人说了同样的话,我一定错过了一些东西。所以回到数据表,嗯…低,见第3.5章间接寻址,在第39页的PIC16(L)F1826/27数据表中,它说了这一切。但是对于NoB,它(ASM)有点混乱,但这并不是不能仔细阅读的借口。“Idfn寄存器不是物理寄存器。”(前额掴……没有比这更清楚的了!)此外,我认为现在,你只能给出0或1的D参数的MOVF。我确实看到一些W’被使用,而且我似乎找不到W=0和F=1。也许在MPASM手册中,但不管怎样感谢这2倍的学习经验。再次感谢大家的帮助!干杯,埃里克
以上来自于百度翻译 以下为原文 Thanks alot, but I now a bit confused. INDF0 is a file register ??? What a minute .... Ok I did read, really i did, but not quite thorough enough. After two people say the same thing I must have miss some thing. So back to the datasheet, and well ... low and behold in chapter 3.5 Indirect Addressing, on page 39 in the PIC16(L)F1826/27 Data Sheet, it says it all. But for a noob, it (asm) is a bit confusing, but that is no excuse not to READ CAREFULLY. "The INDFn registers are not physical registers." (forehead slap....it don't get any plainer than that!) Also, me thinks now, you can only give in a 0 or 1 for the d parameter of MOVF. I do see some times 'W' is used, and I can't seem to find there W = 0 and F = 1. Maybe in the MPASM manual, but any how thanks for this 2 fold learning experience. Again thanks again for the help! Cheers, Eric |
|
|
|
|
|
这是正确的。当你读到MOVF指令的描述时,它表示:D“[0,1]”只能是“0”或“1”。它们被定义为与所有寄存器名相同,所以可以说,所有这些寄存器名都在P16F1827.IN中定义,在文件的开头附近,YO。你会看到:
以上来自于百度翻译 以下为原文 That is correct. When you read the description of the MOVF instruction, it states: d ϵ [0,1] which means "d" can only be "0" or "1". They are defined the same as all the register names, so you can type movf FSR0L, w rather than movf 04h, 0 All those register names are defined in p16f1827.inc. Right near the start of that file, you will see: ;========================================================================== ; ; Register Definitions ; ;========================================================================== W EQU H'0000' F EQU H'0001' |
|
|
|
|
|
|
|
|
|
|
|
嗨,QHB,我想学习ASM。在尝试中,我试图理解间接寻址。我的新代码是:现在我认为是正确的。
以上来自于百度翻译 以下为原文 Hi qhb, I an trying to learn asm. And in the try, I was trying to understand indirect addressing. My new code is: radix HEX list p=16f1827 #include "p16f1827.inc" org 000 movlw 26 movwf FSR0 movlw 0xAA START movwf INDF0 ; incf FSR0,1 ; or moviw INDF0++ goto START END which now I think is correct. |
|
|
|
|
|
代替MOVWF,FSR0i建议使用它来提醒自己,它只写入较低的8位。最新的一种方法是确保下一位全部为零。然后要么有用,要么注意到第一个版本只增加了FSR0的较低的8位,而第二个版本则递增T。他满16位的价值。也请注意,你的代码循环永远。当FSR经过0x7f时,您将开始在BANK-1开始时写入特殊变量。你也应该有一个循环计数器。DEFSZ指令是非常有用的。
以上来自于百度翻译 以下为原文 Instead of movwf FSR0 I'd recommend using movwf FSR0L to remind yourself it is only writing to the lower 8 bits. It would be safest to add clrf FSR0H next to ensure the upper bits are all zero. then either use movwf INDF0 incf FSR0L,f or moviw INDF0++ however note that the first version only increments the lower 8 bits of FSR0, whereas the second version increments the full 16 bit value. also note, your code loops forever. When FSR goes past 0x7F, you will start writing to special variables at the start of bank-1. You should have a loop counter as well. The DECFSZ instruction is very useful for that. |
|
|
|
|
|
谢谢你的提示,我找到了MODIVIDEF0++指令。我在代码中做了一步,看看如果我经过0x7f会发生什么。这对我来说只是为了理解间接的爱抚。
以上来自于百度翻译 以下为原文 Thanks for the tips, I did find the moviw INDF0++ instruction. And I did step throught the code to see what would happen if i went past 0x7f. Again this is for me just to trying to understand indirect adressing. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5808 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3543 浏览 3 评论
1155浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1119浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
887浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 05:07 , Processed in 3.010669 second(s), Total 109, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2693