INCLUDE"P16F690.INC" ;实验内容:上电后,RC0口点亮.接着RC0-RC3口的灯左循环三次,然后接着右循环三次,依次周而复始循环. COUNTER EQU 41H ORG 0000H NOP BSF STATUS,RP0 CLRF TRISC BCF STATUS,RP0 CLRF PORTC ST MOVLW 01H ;将01送往W MOVWF PORTC ;为何PORTC中没有01,或为别的数? MOVLW 03H MOVWF 41H LOOP1 RLF PORTC CALL DELAY1S DECFSZ 41H GOTO LOOP1 MOVLW 03H MOVWF 41H LOOP2 RRF PORTC CALL DELAY1S DECFSZ 41H GOTO LOOP2 GOTO ST DELAY1S MOVLW 0EAH MOVWF 42H L0 MOVLW 09AH MOVWF 43H L1 MOVLW 07AH MOVWF 44H L2 DECFSZ 44H GOTO L2 DECFSZ 43H GOTO L1 DECFSZ 42H GOTO L0 RETURN END |