Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAIN CALL EC8INIT
- CALL E88INIT
- CALL EKINIT
- LOOP CLRF PORTD ; Clear PORTD
- CALL EC8NEXT ; Advance to and activate next column
- CALL EKDOWNQ ; Check if any key in column is pressed
- CALL EC8FREE ; Turn off all columns
- MOVF IKTEMP, W ; Move last pressed key to work
- CALL GET_NRCODE ; Look up 7seg code in table
- MOVWF PORTD ; Present code on PORTD
- BSF PORTA, RA1 ; Activate Column 0
- CALL ED10MS ; Let it glow for a while..
- BCF PORTA, RA1 ; Turn off Column 0
- GOTO LOOP
- GET_NRCODE RLNCF WREG ; Multiplay WREG with 2
- MOVWF TBLPTRL ; Load in to TABLPTRL
- MOVLW high(NUMBERCODES) ; Get high byte of code table
- MOVWF TBLPTRH ; Load in to TABLEPTRH
- MOVLW upper(NUMBERCODES) ; Get upper byte of code table
- MOVWF TBLPTRU ; Load in to TABLEPTRU
- TBLRD* ; Fetch data from TABLPTR
- MOVF TABLAT, W ; Load fetched data to work
- RETURN
- NUMBERCODES org 0x500
- DB B'00111111' ; 0
- DB B'00000110' ; 1
- DB B'01011011' ; 2
- DB B'01001111' ; 3
- DB B'01100110' ; 4
- DB B'01101101' ; 5
- DB B'01111100' ; 6
- DB B'00000111' ; 7
- DB B'01111111' ; 8
- DB B'01100111' ; 9
- DB B'01110111' ; A
- DB B'01111100' ; b
- DB B'00111001' ; C
- DB B'01011110' ; d
- DB B'01111001' ; E
- DB B'01110001' ; F
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement