PAGE	58,163				; Sets printer page for listing file
TITLE	Message creator program.	; Sets title of page for listing file
.MODEL MEDIUM				; Sets it for a medium program model
.286					; Use 286 code
.STACK					; Set defualt 1024 byte stack
.DATA					; Point to DATA segment

					; The [ 80 DUP(32) ] command is to
					; display that blank line before and
					; after the message.

MESSAGE 	DB	80 DUP(32),"HELLO Dennis. Have I got a challenge for you. Alter this program to display messages like this. See if we can make a challenge for eachother to match or beat the quality of eachother's messages,"
		DB	" and send mail to eachother. How have you been going with the assembly books? Please tell me if you are having troubles creating your programs, maybe I can help."
		DB	" Use this ASM file to reply. In the program it automaticaly detects when a message has ended as long as you put character number 13 on the end. Alter the ASM to enhance it but you dont have to, Unless you want too. "
		DB	" Make a backup before changing it. Tell me how your first project is going, something about pressing a key and that key filling the screen or something."
		DB	" Well, better go now. Hope you can reply. SEE YA LATER.         DAB ",80 DUP(32),13

.CODE					; Point to CODE segment
DISP		PROC	FAR		; Start of program

		PUSHA			; Push MOST registers
		PUSH	DS		; Push old data segment

		MOV	AX,@DATA	; Copy new data segment to AX
		MOV	DS,AX		; Copy AX to data segment reg.
		MOV	ES,AX		; Copy AX to extra segment reg.
		MOV	SI,0		; Set SI reg. to 0  ( for message )
		MOV	CX,80		; Set CX reg. to 80 ( fill a line )
START:					; Start of loop
		PUSH	CX		; Save CX ( as it's altered later )

		MOV	AH,2		; This group of commands sets up the
		XOR	BH,BH		; cursor position to display the
		MOV	DH,0		; message at the top of the screen.
		MOV	DL,40		; These two lines creat the
		SUB	DL,CL		; scrolling effect.
		INT	10H		; Run the command

		MOV	AH,9		; These commands print the character
		MOV	AL,MESSAGE[SI]	; on the screen and also creat the
		XOR	BH,BH		; scrolling effect.
		MOV	BL,14
		MOV	CX,1		; This is where CX is altered
		INT	10H		; Run it

		ADD	SI,1		; Add SI to display next charaacter

		POP	CX		; Restore CX to the original value

		LOOP	START		; Loop until the line is updated (80)

		CMP	MESSAGE[SI],13	; See if the message has ended
		JE	EXIT		; If so, jmp to exit

		SUB	SI,79		; Set SI to creat a scrolling effect
					; note SI takes away 79 not 80 and
					; that's why it scrolls backward.

		MOV	CX,80		; Set CX to loop until line is filled

		HLT			; Halt the CPU for 1 / 18 of a sec
		HLT			; "                              "
		HLT			; "                              "

		JMP	START		; Reprint another line

EXIT:					; EXIT label

		POP	DS		; Restore old DATA segment
		POPA			; Restore most old registers

		MOV	AX,4C00H	; Send exit code to dos
		INT	21H		; Send command to DOS

DISP		ENDP			; Set end of program
END		DISP			; Set starting address!
					; Hard to explain. Read the book.
