home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / utils / miscutil.zip / TBWINDOW.ZIP / SAVESCRN.ASM < prev    next >
Assembly Source File  |  1987-05-27  |  2KB  |  51 lines

  1.           title     SAVESCRN
  2.           page      60,132
  3.  
  4. varray    equ       [bp + 06h]          ; VARPTR(ARRAY)
  5. snochk    equ       [bp + 0Ah]          ; SNOCHK%
  6.  
  7. program   segment
  8.           assume    cs:program
  9.           push      bp
  10.           mov       bp,sp
  11.           push      ds                  ;save for basic
  12.           xor       ax,ax
  13.           mov       es,ax               ;segment 0000h
  14.           mov       dx,es:0463h         ;point to 6845
  15.           add       dx,6                ;point to status reg
  16.           mov       di,0410h            ;equipment flag
  17.           mov       ax,0b800h           ;assume color monitor
  18.           mov       bx,es:[di]          ;get the byte
  19.           and       bx,30h
  20.           cmp       bx,30h              ;is it color
  21.           jne       ok                  ;yup
  22.           mov       ax,0b000h           ;nope - so change it
  23. ok:       mov       ds,ax               ;
  24.           xor       si,si               ;point to screen with ds:si
  25.           les       di,snochk           ;pointer to test byte
  26.           mov       ax,es:[di]
  27.           les       di,varray           ;point to array with es:di
  28.           mov       cx,2000
  29.           cmp       ax,1                ;is it a one
  30.           jz        go                  ;yes - don't test for snow
  31.           mov       bx,ds
  32.           cmp       bx,0b000h           ;check source if mono
  33.           jz        go                  ;if it is don't test
  34. snow:     cli                           ;disable interrupts
  35. WaitLo:   in        al,dx               ;test retrace
  36.           shr       al,1                ;wait for low
  37.           jc        WaitLo
  38. WaitHi:   in        al,dx               ;wait for high
  39.           shr       al,1
  40.           jnc       WaitHi
  41.           movsw                         ;ok to move now
  42.           loop      WaitLo              ;do it 2000 times
  43.           sti                           ;enable interrupts
  44.           jmp       short done
  45. go:       movsw
  46.           loop      go
  47. done:     pop       ds
  48.           pop       bp                  ;back to basic
  49. program   ends
  50.           end
  51.