.model small CR EQU 13 LF EQU 10 .data MyString db CR,LF,"Hello Class! 1" db CR,LF,"This is line 2" db CR,LF,"and 3" db CR,LF,"and maybe 4" db CR,LF,"end of String $" ROW db 10 MyNewString db 28h dup (0) NewLine db CR,LF,"$" MyChar db ? MyPrompt db CR,LF," Please Enter a String : NO DOLLARS!! $" MyPressPrompt db CR,LF," Press a key to continue : $" .stack 100h .code main: ;START of Program ;call procedures here call initsegs mov dx, OFFSET Mystring call PrintString mov cx,5 rep_str: mov dx, OFFSET NewLine call PrintString loop rep_str ; call readchar ; mov dx, OFFSET NewLine; ; call PrintString ; ; call printchar mov dx, OFFSET MyPressPrompt call PrintString call Wait4Keypress call ClearScreen mov dx, OFFSET MyPrompt call PrintString call ReadString mov dx, OFFSET NewLine; call PrintString mov dx, OFFSET NewLine; call PrintString mov dx, OFFSET MyNewString call PrintString mov dx, OFFSET NewLine; call PrintString mov dx, OFFSET NewLine; call PrintString call exit ;== PROCS== PROC Wait4KeyPress push ax mov ah,0h INT 16H pop ax RET ENDP Wait4KeyPress PROC ClearScreen ;setup push ax bx cx dx mov bh,07h ; THIS WAS THE ERROR !!!!! WAS set to 0h! WHY DID THAT CAUSE THE PROBLEM? mov al,0 ; blank previous lines mov cx, 0 ; CL=0 CH=0 (Row,COL) mov dx, 184fh ; mov dh,24d mov dl,79d mov ah,7h INT 10H pop dx cx bx ax RET ENDP ClearScreen PROC ReadString push ax bx clc mov bx, OFFSET MyNewString next_char: call ReadChar jc done mov al, MyChar mov [bx],al inc bx jmp next_char done: mov [bx], BYTE PTR '$' pop bx ax RET ENDP ReadString PROC ReadChar push ax mov ah,1 INT 21H mov MyChar,al cmp MyChar,13 ; IS IT RETURN CHARACTER?? jnz done2 stc ; Set the Carry Flag done2: pop ax RET ENDP ReadChar PROC PrintChar push ax dx mov ah,2 mov dl, MyChar INT 21H pop dx ax RET ENDP PrintChar PROC PrintString push ax mov ah,9 ; Function 9 INT 21H ; INT 21 API of Functions pop ax RET ENDP PrintString PROC Initsegs push ax mov ax,@DATA mov ds,ax mov es,ax pop ax RET ENDP InitSegs PROC Exit ; Function 4c of INT21H is Exit to DOS push ax mov ah, 4ch INT 21H pop ax RET ENDP Exit end main; MAIN