CODE SEGMENT 
	ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
	
	STACK1 EQU 0540H
	LCDC EQU 00H  ; control of the LCD
	LCDC_S EQU 02H ; status of the LCD
	LCDD EQU 04H ; data of the LCD
	
1000 ORG 1000H

	XOR AX,AX 
	MOV SS,AX 
	MOV SP,STACK1
	
	CALL ALLCLR 
	CALL ENTMODE 
L1: 
	CALL CUSOR1 
	MOV SI,OFFSET DATA 
	CALL STRING 
	JMP L1

	DATA DB '8086 Training Kit Good !',00H 

ALLCLR: 
	MOV AH,01H 
	JMP LNXX 
ENTMODE: 
	MOV AH,00000111B 
	JMP LNXX 
CUSOR1:
	MOV AH,90H 

LNXX: 
	CALL BUSY 
	MOV AL,AH 
	OUT LCDC,AL 
	RET
BUSY: 
	IN AL,LCDC_S 
	AND AL,10000000B 
	JNZ BUSY 
	RET
CHAROUT: 
	CALL BUSY
	MOV AL,AH 
	OUT LCDD,AL 
	RET
STRING: 
	MOV AH,BYTE PTR CS:[SI] 
	CMP AH,00H 
	JE STRING1
	CALL BUSY 
	CALL CHAROUT 
	INC SI 
	CALL TIMER 
	JMP STRING 
STRING1: 
	RET 
TIMER: 
	MOV CX,1 
TIMER2: 
	PUSH CX 
	MOV CX,0 
TIMER1: 
	NOP 
	NOP
	NOP 
	NOP 
	LOOP TIMER1 
	POP CX 
	LOOP TIMER2 
	RET
CODE ENDS 
END 