Re: Help (w) Screen Attri

 BBS: Inland Empire Archive
Date: 01-29-93 (17:53)             Number: 382
From: ROB MCKEE                    Refer#: NONE
  To: MIKE AUDLEMAN                 Recvd: NO  
Subj: Re: Help (w) Screen Attri      Conf: (2) Quik_Bas
Hello Mike!
   You wrote in a message to Victor Yiu:

 MA> To get to the root, I am trying to detect the FG and BG
 MA> colors that were in effect when the compiled program was run
 MA> from the dos prompt so I can use the same settings within
 MA> the program.  IE; if they were using HI-White on a Blue
 MA> background, I can then use COLOR 15,1 in the program. I want

 MA> Everything ELSE in the program works perfictly EXCEPT the
 MA> Interrupt call routine to 10h Func 08h which should return
 MA> AH=Attribute and AL=ASCII Character.  No matter what I do,
 MA> various color settings, cls etc, AH always comes back 50h.

Are you setting bh for the Page you want?

 Mov ah,02  ; Func 2 set cursor position
 xor bh,bh  ; Page 0
 xor dx,dh  ; Cursor position 0,0
 int 010                                        Color
 mov ah,08  ; Func 08 get char & attr  ; 76543210
 xor bh,bh  ; Page 0                   ; bb  f
 int 010                               ; l k  o
 mov Byte Attribute,ah                 ; i  g  r
 mov Char,al                           ; n      e
 and ah,0f                             ; k
 mov ForeGround,ah                     ;   Mono
 mov ah,attribute                      ; 76543210
 and ah,070                            ; B | |000 - Normal White  mov
BackGround,ah                     ; l | |001 - Underlined
White  mov ah,Attribute                      ; i | |111 -
Black Foreground  and ah,080                            ; n
| `----- Intensity  mov Blink,ah                          ;
k |---- 000 Black Background
        ;   |            (Normal)
             ;   `---- 111 Inverse Background

 Catcha Later , I'll see you on the flip side - Rob
 Vote Zack_Jones,Quik_Bas Moderator

--- timEd/B6
 * Origin: Flyer_Proof_Computer_Svs,V32B,V42B,XA (1:125/1212.13)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET