home *** CD-ROM | disk | FTP | other *** search
- ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ;
- ; Name : Scroll.ASM
- ; Revised : 4/20/90
- ; Purpose : - This routine allows a user-defined screen "window" area to be
- ; SCROLLED by one screen row on the currently active display page
- ; of the screen.
- ; - The user must define the 4 corners of the area, the color to
- ; use, and the direction of the scroll.
- ;
- ; Notes : - This routine does NO ERROR CHECKING!
- ; - Requires the Microsoft MACRO ASSEMBLER V 5.1 or higher for
- ; successful assembly due to the use of the Microsoft simplified
- ; Segment Model.
- ; - This routine should be DECLAREd in your program as an
- ; external SUB routine, via the QuickBASIC statement :
- ;
- ; DECLARE SUB Scroll (Ulr%, Ulc%, Lrr%, Lrc%, Attrib%, Dir%)
- ;
- ; - Consistent with QuickBASIC, this routine will treat 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 usually defines the screen ( as 0,0 to 24,79 ).
- ; - It is OK to use an Lrr > 24 if you are in EGA (43 row) or
- ; VGA (50 row) text mode.
- ;
- ; Parameters : - This SUB requires SIX parameters, any or all of which
- ; may be either pre-defined INTEGER VARIABLES, IMMEDIATE INTEGER
- ; VALUES, or CONSTs.
- ; - Note that INTEGER VARIABLES or CONST's are faster at run-time
- ; than IMMEDIATE INTEGER VALUES.
- ; - In Sequence, 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 #
- ; Attrib = The color attribute to give the Window Area
- ; Dir = Direction to Scroll (0 = UP, 1 = DOWN)
- ;
- ; 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
-
- Scroll PROC ULR:word, ULC:word, LRR:word, LRC:word, ATTRIB:word, DIR:word
-
- mov BX,ULC ; Put address of Ulc value into BX
- mov CX,[BX] ; Put the 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 the Ulr value into AX
- dec AX ; Adjust for BASIC screen definition
- mov CH,AL ; Put Ulr value into CH
-
- mov BX,LRC ; Put address of Lrc value into BX
- mov AX,[BX] ; Put the Lrc value into AX
- dec AX ; Adjust for BASIC screen definition
- mov DX,AX ; Put adjusted value into DL
-
- mov BX,LRR ; Put address of Lrr value into BX
- mov AX,[BX] ; Put the Lrr value into AX
- dec AX ; Adjust for BASIC screen definition
- mov DH,AL ; Put the Lrr value into DH
-
- mov BX,DIR ; Load address of scroll direction
- mov AX,[BX] ; Put scroll direction value in AL
- mov AH,AL ; Transfer scroll direction value to AH
- push AX ; Save the scroll direction temporarily
-
- mov BX,ATTRIB ; Put address of color attribute in BX
- mov AX,[BX] ; Load color attribute value into AX
- mov BH,AL ; Load color attribute value into BH
-
- pop AX ; Restore the scroll direction value
- add AH,06 ; BIOS Scroll Function
- mov AL,01 ; for one line
- int 10h ; BIOS INT
-
- ret ; RETURN to CALLing QB program
-
- Scroll ENDP
- END
- ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-