home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
utils
/
miscutil.zip
/
TBWINDOW.ZIP
/
SAVESCRN.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-05-27
|
2KB
|
51 lines
title SAVESCRN
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 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 ;
xor si,si ;point to screen with ds:si
les di,snochk ;pointer to test byte
mov ax,es:[di]
les di,varray ;point to array with es:di
mov cx,2000
cmp ax,1 ;is it a one
jz go ;yes - don't test for snow
mov bx,ds
cmp bx,0b000h ;check source 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 bp ;back to basic
program ends
end