PROGRAM Smooth;

USES CRT;

PROCEDURE SmoothDown; Assembler;{Zieht das 'Fenster' nach unten}
ASM
 mov dx,03d4h  {Portadresse des CRT-Controllers}
 xor bx,bx     {Offset}
 @Zeile:

  add bx,80     {Nchster Offset}

  mov ah,bh
  mov al,0ch
  out dx,ax     {Hi-Byte 'bertragen'}
  mov ah,bl
  mov al,0dh
  out dx,ax     {Lo-Byte 'bertragen'}

  mov cx,40000  {Anpassen!}
  @Pause:
   nop
  loop @Pause

  cmp bx,25600  {320 * 80}
 jne @Zeile
END;

PROCEDURE SmoothUp; Assembler; {Zieht das 'Fenster' nach oben}
ASM
 mov dx,03d4h  {Portadresse des CRT-Controllers}
 mov bx,25520
 @Zeile:

  mov ah,bh
  mov al,0ch
  out dx,ax     {Hi-Byte 'bertragen'}
  mov ah,bl
  mov al,0dh
  out dx,ax     {Lo-Byte 'bertragen'}

  mov cx,40000  {Anpassen!}
  @Pause:
   nop
  loop @Pause

  sub bx,80     {Nchster Offset}
 jns @Zeile
END;

PROCEDURE Bildschirmfuellen; Assembler;
ASM
 mov dx,03ceh {PortAdresse vom Graphix-Controller}
 mov ax,0ff08h
 out dx,ax    {BitMaske $FF setzen = Alle Pixel setzen}
 mov ax,0003h
 out dx,ax    {berschreibModus}
 mov ax,0205h
 out dx,ax    {WriteModus 2}

 xor di,di    {Offset auf 0}
 mov ax,0a000h
 mov es,ax    {ES auf VideoSegment}

 mov cx,38400
 mov al,1
 rep stosb    {'Sichtbaren' Bereich mit blau fllen}

 mov cx,25600
 mov al,2
 rep stosb    {'Unsichtbaren' Bereich grn}
END;

BEGIN
 asm mov ax,0012h; int 10h; end; {Modus 12h einschalten}
  Bildschirmfuellen;
  SmoothDown;
  SmoothUp;
  ReadLn;
 asm mov ax,0003h; int 10h; end; {TextModus}
END.