"); //-->
代码
#include<p16f877.inc> w_temp equ 0x30 status_temp equ 0x31 pch_temp equ 0x32 fsr_temp equ 0x33 org 0x000 goto main org 0x004 movwf w_temp movf STATUS,W CLRF STATUS MOVWF status_temp movf PCLATH,W MOVWF pch_temp movf FSR,W MOVWF fsr_temp clrf PCLATH btfss INTCON,T0IE GOTO Int_Exit btfss INTCON,T0IF GOTO Int_Exit BCF INTCON,T0IF BANKSEL PORTB MOVLW .1 XORWF PORTB,F GOTO Int_Exit Int_Exit clrf STATUS MOVF fsr_temp,w movwf FSR MOVF pch_temp movwf PCLATH MOVF status_temp,w movwf STATUS SWAPF w_temp,f SWAPF w_temp,w RETFIE org 0x100 main banksel OPTION_REG MOVLW B'00001000' MOVWF OPTION_REG BANKSEL INTCON CLRF INTCON BSF INTCON,T0IE BSF INTCON,GIE banksel TRISB movlw 0x00 movwf TRISB Loop GOTO Loop end
仿真效果图
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。