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 " Well, better go now. Hope you can reply. SEE YA LATER. DAB ",80 DUP(32),13 ROW DB ? .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 ) MOV DH,1 MOV AH,00h MOV AL,03h INT 10h 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 ADD ROW,1 ;ADD 1 TO LOWER TEXT MOV DH,ROW CMP DH, 3 ;IF IT IS JMP ALT JMP DRAW ALT: MOV ROW,1 MOV DH,1 DRAW: MOV DL,80 ; 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) PUSH DX 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 POP DX 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.