Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAIN CALL EC8INIT
- CALL E88INIT
- CALL EKINIT
- CALL ELINIT
- CALL ELCDINIT
- CALL ESINIT
- LFSR 1,S88DISP
- BSF INTCON, GIE ; < Allow Global interrupt! >
- MOVLW low(LCDTEXT)
- MOVWF TBLPTRL ; Load in to TABLPTRL
- MOVLW high(LCDTEXT) ; Get high byte of code table
- MOVWF TBLPTRH ; Load in to TABLEPTRH ; Fetch data from TABLPTR
- CALL LOADMSG
- LOOP CLRF PORTD ; Clear PORTD
- CALL EC8NEXT ; Advance to and activate next column
- CALL EKDOWNQ ; Check if any key in column is pressed
- BTFSS WREG,7 ; Button pressed?
- CALL BTN_PRESS ; ... yes, call BTN_PRESS
- 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
- BTN_PRESS CALL GET_ASCIICODE ; Get ASCII for button number
- CALL ESWRITE ; Send ASCII over serial port
- RETURN
- GET_ASCIICODE RLNCF WREG ; Multiplay WREG with 2
- MOVWF TBLPTRL ; Load in to TABLPTRL
- MOVLW high(ASCIICODES) ; Get high byte of code table
- MOVWF TBLPTRH ; Load in to TABLEPTRH
- TBLRD* ; Fetch data from TABLPTR
- MOVF TABLAT, W ; Load fetched data to work
- RETURN
- 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
- TBLRD* ; Fetch data from TABLPTR
- MOVF TABLAT, W ; Load fetched data to work
- RETURN
- NUMBERCODES org 0x500 ; 7seg TABLE
- 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
- ASCIICODES org 0x600 ; ASCII Table
- DB B'00110000' ; 0
- DB B'00110001' ; 1
- DB B'00110010' ; 2
- DB B'00110011' ; 3
- DB B'00110100' ; 4
- DB B'00110101' ; 5
- DB B'00110110' ; 6
- DB B'00110111' ; 7
- DB B'00111000' ; 8
- DB B'00111001' ; 9
- DB B'01000001' ; A
- DB B'01000010' ; b
- DB B'01000011' ; C
- DB B'01000100' ; d
- DB B'01000101' ; E
- DB B'01000110' ; F
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement