|
该程序是用16C57在一个数码管上循环显示0-9的例子,仅供参考. ORG 7FFH
GOTO START
ORG 100H
START MOVLW 0
TRIS 6
TRIS 5
CLRF 8
BCF 3,2
MOVLW 3FH
MOVWF 6
BSF 5,0
RE_DO CALL DELAY
INCF 8
BCF 3,2
XORLW 0AH
BTFSS 3,2
GOTO FIND_TAB
CLR_F8 CLRF 8
BCF 3,2
FIND_TAB MOVF 8,0
BCF 3,2
CALL TRANS
MOVWF 6
GOTO RE_DO
ORG 000H
TRANS ADDWF 2
RETLW 3FH
RETLW 06H
RETLW 5BH
RETLW 4FH
RETLW 66H
RETLW 6DH
RETLW 7DH
RETLW 07H
RETLW 7FH
RETLW 6FH
DELAY MOVLW D'83'
MOVWF 20
LOOP DECFSZ 20,1
GOTO LOOP
RETLW 0
END |
|