;FILENAME:   STLAB062.ASM
;DATE:       March 16, 1996
;TITLE:      LCD characters display
;HARDWARE:   MLAB-121

; JAZZ-31 utilities subroutines
DTSEC   EQU     0042H   ;delay 1/10 routine

; 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 2:  A complete line characters LCD dislay
;
        ORG     8100H
START:
        LCALL   DELAY
        LCALL   LCD_INIT
LOOP1:
        MOV     DPTR,#MSG_TST   ;message to be displayed
        LCALL   LCD_WRITE_LINE  ;write a line
        MOV     R2,#10
        LCALL   DTSEC
        LJMP    0036H
;
MSG_TST: DB      '012345-ABCDEFGHI'
;
; Write 16 characters to DDRAM of LCD-MODULE (DMC161)
; IN:  DPTR = start address of 16 bytes buffer
;
LCD_WRITE_LINE:
        MOV     A,#80H          ;SET DDRAM ADDRESS 1ST HALF OF LINE
        LCALL   LCD_WRITE_INST
        LCALL   PMEM_XFER       ;tranfer from 8051 Program memory
;
        MOV     A,#0C0H         ;SET DDRAM ADDRESS 2ND HALF OF LINE
        LCALL   LCD_WRITE_INST
        LCALL   PMEM_XFER       ;tranfer from 8051 Program memory
        RET
;
        $INCLUDE  "STLAB06H.ASM"
;
        END
