home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / tsrhelp.zip / RESTSCR.INC < prev    next >
Text File  |  1992-05-24  |  2KB  |  68 lines

  1. ;---------------------------------------------------------------------------
  2. ; Program:  RestScr.Asm
  3. ;
  4. ; Author:   Steve Poulsen
  5. ;
  6. ; This procedure will restore the screen text/attr at SI with the location
  7. ; entered in CX and DX with CL = X1, CH = Y1, DL = X2, DH = Y2. SI should
  8. ; point to a location with the same number of words as characters to restore.
  9. ;
  10. ;---------------------------------------------------------------------------
  11. RestScr Proc    Near
  12.         Push AX
  13.         Push BX
  14.         Push DI
  15.         Push SI
  16.         Push CX
  17.         Push ES
  18.         
  19.         Mov AX,0B800h                   ; Screen memory segment for color
  20.         Mov ES,AX
  21.         Mov AH,0Fh                      ; Check video mode
  22.         Int 10h
  23.         Cmp AL,07h                      ; Monochrome?
  24.         JNE Clr
  25.         Mov AX,0B000h                   ; Screen memory segment for mono
  26.         Mov ES,AX
  27. Clr:        
  28.         Mov BL,CL
  29.         Mov BH,0
  30.         
  31.         Mov AL,160
  32.         Mul CH
  33.         Mov DI,AX
  34.         Add DI,BX
  35.         Add DI,BX
  36. C1:       
  37.         Push DX
  38.         Mov DX,CS:[SI] 
  39.         Mov ES:[DI],DX
  40.         Pop DX
  41.         Cmp BL,DL
  42.         JE N1
  43.         Inc DI
  44.         Inc DI
  45.         Inc SI
  46.         Inc SI
  47.         Inc BL
  48.         Jmp C1
  49. N1:                                      ; Start of loop for vert. lines
  50.         Inc DI
  51.         Inc DI
  52.         Inc SI
  53.         Inc SI
  54.         Inc BL
  55.         Inc CH
  56.         Cmp CH,DH
  57.         JLE Clr
  58.         
  59.         Pop ES
  60.         Pop CX
  61.         Pop SI
  62.         Pop DI
  63.         Pop BX
  64.         Pop AX
  65.         Ret
  66. RestScr EndP
  67.  
  68.