home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
utils
/
miscutil.zip
/
TBWINDOW.ZIP
/
RESTSCRN.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-05-27
|
3KB
|
61 lines
title RESTSCRN
page 60,132
varray equ [bp + 06h] ; VARPTR(ARRAY)
snochk equ [bp + 0Ah] ; SNOCHK%
program segment
assume cs:program
push bp
mov bp,sp
push es
push ds ;save for basic
xor ax,ax
mov es,ax ;segment 0000h
mov dx,es:0463h ;point to 6845
add dx,6 ;point to status reg
mov di,0410h ;equipment flag
mov ax,0b800h ;assume color monitor
mov bx,es:[di] ;get the byte
and bx,30h ;
cmp bx,30h ;is it color
jne ok ;yup
mov ax,0b000h ;nope - so change it
ok: mov ds,ax ;point to screen
les di,snochk ;pointer to test byte
mov ax,es:[di]
push ax ;save it for later
les di,varray ;point to array
mov cx,2000 ;no. of times
push es ;
push ds ;swap since we are moving
pop es ;data from array to screen
pop ds ;
xor si,si ;zero out si
xchg si,di ;exchange them too
pop ax ;get test byte
cmp ax,1 ;is it a one
jz go ;yes - don't test for snow
mov bx,es
cmp bx,0b000h ;check dest. if mono
jz go ;if it is don't test
snow: cli ;disable interrupts
WaitLo: in al,dx ;test retrace
shr al,1 ;wait for low
jc WaitLo
WaitHi: in al,dx ;wait for high
shr al,1
jnc WaitHi
movsw ;ok to move now
loop WaitLo ;do it 2000 times
sti ;enable interrupts
jmp short done
go: movsw
loop go
done: pop ds
pop es
pop bp ;back to basic
program ends
end