;----------------------------------------------------------------------
proc ClearScreen   
  push cx
  push ax
  push di
  push es		         ; Save ES value - IMPORTANT, or else the clock loop in the main program wouldn't work properly.
  mov ax,0A000h          ; BIOS graphics (not text).
  mov es,ax
  xor di,di
  xor ax,ax
  mov cx,32000d          ; 320 X 200, 64000 bytes in memory.
  cld
  rep stosw
  pop es
  pop di
  pop ax
  pop cx
  ret
endp ClearScreen
;----------------------------------------------------------------------