home *** CD-ROM | disk | FTP | other *** search
- ;********** GETCOLOR.ASM - retrieves the current colors in use by QuickBASIC
-
- ;Copyright (c) 1990 Ethan Winer
-
- ;Usage: CALL GetColor(FG%, BG%, Border%)
-
- ;NOTE: This routine cannot be used within a Quick Library.
-
- .Model Medium, Basic
- .Data
- Extrn B$FBColors:Word, B$BorderColor:Byte
-
- .Code
-
- GetColor Proc, FG:Word, BG:Word, Border:Word
-
- Mov DX,B$FBColors ;get the combined foreground/background word
- Mov AL,DL ;copy the foreground portion to AL
- Cbw ;convert the byte to a full integer word
- Mov BX,FG ;get the address for FG%
- Mov [BX],AX ;and assign FG%
- Mov AL,DH ;now load AL with the background portion
- Mov BX,BG ;point BX to the BG% parameter
- Mov [BX],AX ;and assign BG% (AH is still zero)
- Mov AL,B$BorderColor ;get BASIC's border color
- Mov BX,Border ;point BX to Border%
- Mov [BX],AX ;assign Border%
- Ret ;return to BASIC
-
- GetColor Endp
- End