;FILENAME:   STLAB061.ASM
;DATE:       March 16, 1996
;TITLE:      LCD character display
;HARDWARE:   MLAB-121

;JAZZ-31 utilities subroutines

DTSEC   EQU     0042H           ;delay 1/10 routine
SCAN    EQU     0093H           ;wait kb & display

;LCD-MODULE (DMC161) Interface declaration

LCDWRC  EQU     0FE00H          ;LCD WRITE CONTROL
LCDRDC  EQU     0FE01H          ;LCD READ CONTROL (BUSY CHECK)
LCDWRD  EQU     0FE02H          ;LCD WRITE DATA
LCDRDD  EQU     0FE03H          ;LCD READ DATA
;
; Program 1: LCD characters display

        ORG     8100H
START:
        LCALL   DELAY
        LCALL   LCD_INIT
LOOP1:
        MOV     A,#80H          ;SET DDRAM ADDRESS 1ST HALF OF LINE
        LCALL   LCD_WRITE_INST
        LCALL   KB_XFER
        LJMP    0036H

; Send a data when 'inc' keyboard pressed
; and transfer to LCD data register
;
KB_XFER:
        MOV     B,#08H         ;wait 8 characters
KB_XFR1:
        LCALL   SCAN            ;wait key
        CJNE    A,#11H,KB_XFR1  ;until 'inc' pressed
        MOV     A,#30H          ;then display '0' on LCD screen
        LCALL   LCD_WRITE_DATA
        DJNZ    B,KB_XFR1
        RET

        $INCLUDE "STLAB06H.ASM"
;
        END

