我说,新字可以集思,我写了一个简单的学习方案。 我认为,我会遇到一个“去”教学的反方案问题。 我使用一种事先知情同意10f202,我使用MPLAB诉6.15的模拟模式来推翻我的代码。 我的守则如下:
PROCESSOR 10f202
#include <xc.inc>
; CONFIG
CONFIG WDTE = OFF ; Watchdog Timer (WDT disabled)
CONFIG CP = OFF ; Code Protect (Code protection off)
CONFIG MCLRE = OFF ; Master Clear Enable (GP3/MCLR pin fuction is digital I/O, MCLR internally tied to VDD)
PSECT resetVect, class=CODE, delta=2
resetVect:
PAGESEL main
goto main
PSECT code, delta=2
main:
clrf GPIO ; clrf GPIO, F
movlw 0b0001000 ; configure GP1 (only) as an output
tris GPIO
loop:
bcf GPIO,0
bsf GPIO,0
movlw 256
movwf 0x10
nop
goto loop
END resetVect
该方案从方案记忆1F6(第503条)开始,指示“主线”。 它执行所有代码项目,但当它达到“goto loop”指示时,方案记忆线1FF没有显示“goto loop”指示,然后,方案记忆线0c7没有指示。 它没有回到“全球知识分子”计划中。
https://i.stack.imgur.com/LHKdh.png”rel=“nofollow noreferer”> 方案记忆
At first I was using a "call" instruction to call the subroutine "loop" with a return instruction but I was getting the error message that the instruction return was an illegal instruction for this PIC 10F202. I had an old assembly code that work before with "goto" instruction but this code was compiled with the old compiler from MPLAB: MPASM. In this code (using the same PIC 10f202) I used goto and call instructions and it compiled fine. Thanks for helping! Dominique