PIC单片机汇编语言的中断程序 ,求人分析一下怎么运行的
LISTP=16F877INCLUDE“P16F877.INC”TMR0BEQU03CHCOUNTEREQU20HORG0000HNOPGOTOMAIN;--------...
LIST P=16F877
INCLUDE “P16F877.INC”
TMR0B EQU 03CH
COUNTER EQU 20H
ORG 0000H
NOP
GOTO MAIN
;----------------------------
ORG 0004H
BCF INTCON,T0IF
DECFSZ COUNTER
GOTO RT
INCF PORTC
MOVLW 0AH
MOVWF COUNTER
RT MOVLW TMR0B
MOVWF TMR0
RETFIE
;--------------------------------
MAIN BSF STATUS,RP0
MOVLW 00H
MOVW FTRISC
MOVLW 07H
MOVWF OPTION_REG
BCF STATUS,RP0
MOVLW B”10100000”
MOVWF INTCON
MOVLW 0AH
MOVWF COUNTER
CLRF PORTC
MOVLW TMR0B
MOVWF TMR0
LOOP GOTO LOOP
;---------------------
END 展开
INCLUDE “P16F877.INC”
TMR0B EQU 03CH
COUNTER EQU 20H
ORG 0000H
NOP
GOTO MAIN
;----------------------------
ORG 0004H
BCF INTCON,T0IF
DECFSZ COUNTER
GOTO RT
INCF PORTC
MOVLW 0AH
MOVWF COUNTER
RT MOVLW TMR0B
MOVWF TMR0
RETFIE
;--------------------------------
MAIN BSF STATUS,RP0
MOVLW 00H
MOVW FTRISC
MOVLW 07H
MOVWF OPTION_REG
BCF STATUS,RP0
MOVLW B”10100000”
MOVWF INTCON
MOVLW 0AH
MOVWF COUNTER
CLRF PORTC
MOVLW TMR0B
MOVWF TMR0
LOOP GOTO LOOP
;---------------------
END 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询