; ; SQUASH.A86 Version 0.0 ; Clears The Screen By Squashing The Screen Contents To The Screen's Center ; Freeware from Kirk Lawrence ; cseg org 100h jmp start ; value dw 1 ;delay value nmbr dw 0 ;storage variable curoff db 27,'n$' curon db 27,'m$' cls db 27,'E$' ; start: mov dx,offset curoff;point DX to 'cursor off' sequence call pstring ;go print it top: add bl,1 ;add 1 to our counter BL cmp bl,13 ;have we reached 13 yet? jne movit ;no, so keep scrolling screen exit: mov dx,offset cls ;point DX to 'clear screen' sequence call pstring ;go print it mov dx,offset curon ;point DX to 'curson on' sequence call pstring ;go print it xor cx,cx ;function 0 - reset system int 224 ;call BDOS movit: mov ah,07h ;function 7 - scroll down mov al,1 ;1 line mov bh,07 ;white-on-black mov ch,0 ;top row in CH mov cl,0 ;top column in CL mov dh,11 ;bottom row in DH mov dl,79 ;bottom column in DL int 10h ;call BIOS video services mov ah,06h ;function 6 - scroll up mov al,1 ;1 line mov bh,07 ;white-on-black mov ch,12 ;top row in CH mov cl,0 ;top column in CL mov dh,23 ;bottom row in DH mov dl,79 ;bottom column in DL int 10h ;call BIOS video services call timer ;go pause a tick jmp top ;go do it again ;-------------------------------------------------- ; This routine slows things down by one timer tick. ; timer: xor ax,ax ;zero the register xor cx,cx ; " xor dx,dx ; " mov ah,00 ;function 0 - read system timer int 1Ah ;call BIOS timer services add dx,value ;add our delay factor mov nmbr,dx ;move total into variable count: mov ah,00h ;function 0 - read system timer int 1Ah ;call BIOS timer services cmp dx,nmbr ;has time period elapsed? je thatsall ;yes, go do the screen jmp count ;no, go count some more thatsall: ret ;return ;------------------------------------------------------------ ; This routine prints a text string, pointed to by offset DX, ; to the screen. ; pstring: mov cl,9 ;function 9 - print string int 224 ;call BDOS ret ;return ; end