home *** CD-ROM | disk | FTP | other *** search
- ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ;
- ; Name : CLEARWIN.ASM
- ;
- ; Revised : 4/20/90
- ;
- ; Overview : This routine allows a user-defined screen "window" area to be
- ; cleared, much like the CLS command clears the entire screen.
- ; This routine requires the user to define the four corners of
- ; the window area itself, and to specify an INTEGER value for
- ; the color attribute which the cleared screen area should be
- ; given (see table below).
- ;
- ; Notes : - Requires the Microsoft MACRO ASSEMBLER V 5.1 or higher for
- ; successful assembly due to the use of the simplified Segment
- ; Model by Microsoft.
- ; - THIS PROGRAM PERFORMS NO ERROR CHECK!
- ; - This SUB should be DECLAREd in your program as an external
- ; SUB routine, as follows:
- ;
- ; DECLARE SUB ClearWin (Ulr%, Ulc%, Lrr%, Lrc%, Att%)
- ;
- ; - Consistent with QuickBASIC, this routine will define the
- ; screen as ranging from the upper left corner (at 1,1)
- ; to the lower right corner (at 25,80), rather than the
- ; way in which assembler defines the screen (as 0,0 to 24,79).
- ;
- ; Parameters : - This SUB requires FIVE parameters, which may be pre-defined
- ; INTEGER VARIABLES, IMMEDIATE INTEGER VALUES, or CONST's.
- ; Note that VARIABLES and CONST's are faster at run-time than
- ; are IMMEDIATE values.
- ; These parameters are defined as -
- ;
- ; Ulr = Upper Left Hand Row # of the Window
- ; Ulc = Upper Left Hand Column # of the Window
- ; Lrr = Lower Right Hand Row #
- ; Lrc = Lower Right Hand Column #
- ; Att = The color attribute to give the Window Area, as follows:
- ;
- ; COLOR VALUES TO USE
- ;
- ; Color Foreground Value Background Value
- ;
- ; BLACK 0 0
- ; BLUE 1 16
- ; GREEN 2 32
- ; CYAN 3 48
- ; RED 4 64
- ; MAGENTA 5 80
- ; YELLOW 6 96
- ; WHITE 7 112
- ;
- ; To get INTENSE foreground color, add 8 to foreground value.
- ; To get BLINKING attribute, add 128 to the total combined color value.
- ;==============================================================================
-
- .MODEL MEDIUM, BASIC
- .CODE
-
- ClearWin PROC ULR:word, ULC:word, LRR:word, LRC:word, ATTRIB:word
-
- mov BX,ULC ; Put address of Ulc value into BX
- mov CX,[BX] ; Put Ulc value into CL
- dec CX ; Adjust for BASIC screen definition
-
- mov BX,ULR ; Put address of Ulr value into BX
- mov AX,[BX] ; Put Ulr value into AX
- dec AX ; Adjust for BASIC screen definition
- mov CH,AL ; Transfer Ulr value into CH
-
- mov BX,LRC ; Put address of Lrc value into BX
- mov AX,[BX] ; Put Lrc value into AX
- dec AX ; Adjust for BASIC screen definition
- mov DX,AX ; Put Lrc value into DL
-
- mov BX,LRR ; Put address of Lrr value into BX
- mov AX,[BX] ; Put Lrr value into AX
- dec AX ; Adjust for BASIC screen definition
- mov DH,AL ; Put actual Lrr value into DH
-
- mov BX,ATTRIB ; Put addr. of color attribute into BX
- mov AX,[BX] ; Put color attribute value into AX
- mov BH,AL ; Put the color to use into BH
- mov AX,0600h ; BIOS Scroll Up Function, all lines
- int 10h ; BIOS INT
-
- ret ; Back to the CALLing QB program
-
- ClearWin ENDP
- END
-
- ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-