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

  1.           title     RESTSCRN
  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      es
  12.           push      ds                  ;save for basic
  13.           xor       ax,ax
  14.           mov       es,ax               ;segment 0000h
  15.           mov       dx,es:0463h         ;point to 6845
  16.           add       dx,6                ;point to status reg
  17.           mov       di,0410h            ;equipment flag
  18.           mov       ax,0b800h           ;assume color monitor
  19.           mov       bx,es:[di]          ;get the byte
  20.           and       bx,30h              ;
  21.           cmp       bx,30h              ;is it color
  22.           jne       ok                  ;yup
  23.           mov       ax,0b000h           ;nope - so change it
  24.  
  25. ok:       mov       ds,ax               ;point to screen
  26.           les       di,snochk           ;pointer to test byte
  27.           mov       ax,es:[di]
  28.           push      ax                  ;save it for later
  29.           les       di,varray           ;point to array
  30.           mov       cx,2000             ;no. of times
  31.           push      es                  ;
  32.           push      ds                  ;swap since we are moving
  33.           pop       es                  ;data from array to screen
  34.           pop       ds                  ;
  35.           xor       si,si               ;zero out si
  36.           xchg      si,di               ;exchange them too
  37.           pop       ax                  ;get test byte
  38.           cmp       ax,1                ;is it a one
  39.           jz        go                  ;yes - don't test for snow
  40.           mov       bx,es
  41.           cmp       bx,0b000h           ;check dest. if mono
  42.           jz        go                  ;if it is don't test
  43. snow:     cli                           ;disable interrupts
  44. WaitLo:   in        al,dx               ;test retrace
  45.           shr       al,1                ;wait for low
  46.           jc        WaitLo
  47. WaitHi:   in        al,dx               ;wait for high
  48.           shr       al,1
  49.           jnc       WaitHi
  50.           movsw                         ;ok to move now
  51.           loop      WaitLo              ;do it 2000 times
  52.           sti                           ;enable interrupts
  53.           jmp       short done
  54. go:       movsw
  55.           loop      go
  56. done:     pop       ds
  57.           pop       es
  58.           pop       bp                  ;back to basic
  59. program   ends
  60.           end
  61.