org 8000h ljmp start ;program start org 9000h start: ; Initialize the T6963C clr 0e9h ;hardware reset nop nop nop setb 0e9h mov dptr, #msgi1 ;initialization bytes lcall msgc ; Start of regular program ; Display graphic mov dptr,#msgi2 ;set auto mode lcall msgc mov dptr,#msg1 ;display graphic lcall msgd sjmp $ ;************************************************* ;SUBROUTINES ; MSGC sends the data pointed to by ; the DPTR to the graphics module ; as a series of commands with ; two parameters each. msgc: mov r0,#2 ;# of data bytes msgc2: clr a movc a,@a+dptr ;get byte cjne a,#0a1h,msgc3 ;done? ret msgc3: mov r1,a lcall writed ;send it inc dptr djnz r0, msgc2 clr a movc a, @a+dptr ;get command mov r1,a lcall writec ;send command sjmp msgc ;next command ; MSGD sends the data pointed to by ; the DPTR to the graphics module. msgd: clr a movc a,@a+dptr ;get byte cjne a,#0a1h,msgd1 ;done? ret msgd1: mov r1,a lcall writed ;send data inc dptr sjmp msgd ; WRITEC sends the byte in R1 to a ; graphics module as a command. writec: lcall status ;display ready? setb 0e8h ;c/d = 1 (4.0) writec1: mov p1,r1 ;get data clr 0eah ;strobe it setb 0eah ret ; WRITED sends the byte in R1 to the ; graphics module as data. writed: lcall status ;display ready? clr 0e8h ;c/d = 0 (p4.0) sjmp writec1 ; STATUS check to see that the graphic ; display is ready. It won't return ; until it is. status: setb 0e8h ;c/d=1 mov p1,#0ffh ;P1 to input mov r3,#0bh ;status bits mask stat1: clr 0ebh ;read it (p4.3) mov a,p1 setb 0ebh anl a,r3 ;status OK? clr c subb a,r3 jnz stat1 ret ;************************************************ ; TABLES AND DATA ; Initialization bytes for 240x64 msgi1: db 10h,00h,40h ;text home address db 28h,00,41h ;text area db 00,00,42h ;graphic home address db 28h,00,43h ;graphic area db 00,00,98h ;mode set db 00,00,24h ;address pointer set db 00,00,9ch ;display mode set db 0a1h msgi2: db 00,00,0b0h ;auto mode db 0a1h ;240x64 Bitmap graphic data ;Only the first 8 bytes are shown here ;The real graphic consists of 1920 bytes ;of binary data. msg1: db 55h,55h,55h,55h,55h,55h,55h,55h db 0a1h end