CSEG    SEGMENT
	ASSUME CS:CSEG,DS:DSEG

MAIN    PROC
	MOV AX,DSEG
	MOV DS,AX
	MOV AX,ESEG
	MOV ES,AX
	MOV BX,0
	MOV CX,2000
LOOP1:
	MOV AX,ES:[BX]
	MOV SCRSAV[BX],AX
	INC BX
	INC BX
	LOOP LOOP1
	MOV BX,0
	MOV CX,2000
	MOV DL,0
LOOP2:
	MOV BYTE PTR ES:[BX],'A'
	INC BX
	MOV BYTE PTR ES:[BX],DL
	INC BX
	INC DL
	LOOP LOOP2
	CALL WAITKEY
	MOV BX,0
	MOV CX,2000
LOOP3:
	MOV AX,SCRSAV[BX]
	MOV WORD PTR ES:[BX],AX
	INC BX
	INC BX
	LOOP LOOP3
	MOV AX,4C00h
	INT 21h
MAIN    ENDP

WAITKEY PROC
	MOV AH,08
	INT 21h
	CMP AL,00
	JNE NOSCAN
	INT 21h
NOSCAN:
	RET
WAITKEY ENDP

CSEG    ENDS

DSEG    SEGMENT
SCRSAV  DW 2000 DUP (?)
DSEG    ENDS

ESEG    SEGMENT AT 0B800h
	DW 2000 DUP (?)
ESEG    ENDS

SSEG    SEGMENT STACK
	DB 5 DUP ("STACK******STACK")
SSEG    ENDS

	END MAIN