home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / fort_lib / clrscr.asm < prev    next >
Assembly Source File  |  1991-01-17  |  1KB  |  45 lines

  1. ;
  2. ;----------------------------------------------------------------------
  3. ; Löschen des Grafikbildschirms mit der Hintergrundfarbe 'Color'
  4. ;----------------------------------------------------------------------
  5. ;
  6. ;FORTRAN Aufruf:
  7. ;       INTERFACE TO SUBROUTINE ClrScr [PASCAL] (VGASeg,Color)
  8. ;       INTEGER*4  VGASeg [NEAR,VALUE]
  9. ;       INTEGER*2  Color  [NEAR,VALUE]
  10. ;       END
  11. ;       ...
  12. ;       CALL ClrScr(VGASeg,Color)
  13. ;
  14.         .286p
  15.         .MODEL large,pascal
  16.         .CODE
  17.  
  18. ClrScr  PROC    USES es di dx cx, VGASeg: DWORD, Color: WORD
  19.  
  20.         les     di,VGASeg               ; ES = VGABase
  21.         mov     dx,3c4h
  22.         mov     ax,0f02h
  23.         out     dx,ax                   ; map mask register = 1111b
  24.         xor     al,al
  25.         mov     cx,Color
  26.         mov     ah,cl
  27.         mov     dx,3ceh
  28.         out     dx,ax                   ; set/reset register = color
  29.         mov     ax,0f01h
  30.         out     dx,ax                   ; enable set/reset register = 1111b
  31.  
  32.         mov     ax,0
  33.         mov     cx,38400/2              ; VGA
  34. ;       mov     cx,28000/2              ; EGA
  35.         cld
  36.         rep     stosw
  37.  
  38.         mov     ax,0001h
  39.         out     dx,ax                   ; enable set/reset register = 0
  40.  
  41.         ret
  42.  
  43. ClrScr  ENDP
  44.         END
  45.