Category : Files from Magazines
Archive   : PCTV1N4.ZIP
Filename : GETCOLOR.ASM

 
Output of file : GETCOLOR.ASM contained in archive : PCTV1N4.ZIP
;********** 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


  3 Responses to “Category : Files from Magazines
Archive   : PCTV1N4.ZIP
Filename : GETCOLOR.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/