;program sections from the textbook, SECTION 12.8 MOV AL,38H ;initialize LCD for 2 lines & 5x7 matrix CALL COMNDWRT ;write the command to LCD CALL DELAY ;wait before next command MOV AL,0EH ;send command for LCD on,cursor on CALL COMNDWRT ;write the command to LCD CALL DELAY ;wait before the next command MOV AL,01 ;clear LCD CALL COMNDWRT CALL DELAY MOV AL,06 ;command for shifting cursor right ; .......... ; ;and so on for any command in Table 12-8 to be sent to LCD COMNDWRT PROC ;this procedure writes commands to LCD PUSH DX ;save DX MOV DX,PORTA OUT DX,AL ;send the code to Port A MOV DX,PORTB ;Port B address MOV AL,00000100B ;RS=0,R/W=0,E=1 for H-TO-L pulse OUT DX,AL ;to Port B NOP ;wait for high-to-low pulse to be NOP ;wide enough, especially for faster x86s NOP ;you might need a small loop NOP MOV AL,00000000B;RS=0,R/W=0,E=0 for H-TO-L pulse OUT DX,AL ; POP DX ;restore DX RET ;return to caller COMNDWRT ENDP