;
; The following line embeds configuration data into the PICmicro
LIST P=16F88
; __CONFIG H'2007', H'3F7A' ; RC mode
__CONFIG H'2008', H'3FFC' ; Clock Fail-Safe disabled
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; using aliases, bit names and conditional loops
#DEFINE PAGE0 BCF STATUS,5
#DEFINE PAGE1 BSF STATUS,5
STATUS EQU H'03' ; STATUS register
TRISB EQU H'86' ; Port B direction register
PORTB EQU H'06' ; Port B data register
TRISA EQU H'85' ; Port A direction register
PORTA EQU H'05' ; Port A data register
PCL EQU H'02'
W EQU 0 ; Working register flag
F EQU 1 ; File register flag
C EQU 0 ; Carry flag
Z equ 2
COUNT equ h'37' ; Use File h'30' as a loop counter
COUNT5 equ h'38'
COUNT1 equ h'30' ; Use File h'30' as a loop counter
COUNT2 equ h'31'
COUNT3 equ h'32'
COUNT4 equ h'37'
DIGIT1 EQU h'33'
DIGIT2 EQU h'34'
DIGIT3 EQU h'35'
DIGIT4 EQU h'36'
N equ H'50' ; Delay parameter computed in the text
ORG 0 ; Reset vector
GOTO 5 ; Goto start of program
ORG 4 ; Interrupt vector
GOTO 5 ; Goto start of program
ORG 5 ; Start of program memory
START CLRF PORTA ; clear Port B data register
CLRF PORTB
PAGE1 ; PAGE1
CLRF H'9B' ; Clear the ANSEL register
CLRF TRISA ; Port A direction register for output
CLRF TRISB ; Port B direction register for output
PAGE0 ; PAGE0
movlw d'0' ;
movwf DIGIT1
movlw d'0' ;
movwf DIGIT2
movlw d'0' ;
movwf DIGIT3
movlw d'0' ;
movwf DIGIT4
MAIN
CALL INCREMENTAR_NUMERO
CALL MOSTRAR_DISPLAY
GOTO MAIN
;==========================================================================================
;TABLE ROUTINE GOES HERE
TABLE ADDWF PCL,F
RETLW B'11000000' ;0
RETLW B'11111001' ;1
RETLW B'10100100' ;2
RETLW B'10110000' ;3
RETLW B'10011001' ;4
RETLW B'10010010' ;5
RETLW B'10000010' ;6
RETLW B'11111000' ;7
RETLW B'10000000' ;8
RETLW B'10010000' ;9
; common anode codes
;==========================================================================================
;FUCTION:'Dummy' Delay
;==========================================================================================
DELAY NOP
NOP
NOP
NOP
NOP
NOP
NOP
RETURN
; final statement
END