[net.micro.pc] Changing colors and stuff in ms-dos

dgary@ecsvax.UUCP (D Gary Grady) (06/06/85)

Several people have reported trouble trying to follow posted instructions
for using ANSI.SYS to change screen colors.  I thought I'd essay a VERY
brief attempt to clarify what's going on.

First ANSI.SYS is a program that attaches itself to DOS as a "device
driver."  ANSI.SYS watches over output being sent to the screen with
normal DOS functions (that is, programs that write to screen memory
or use BIOS calls bypass ANSI.SYS).  If ANSI.SYS sees an Escape
character (decimal 27, hex 1B), it stops it from going to the screen and
interprets one or more following characters as instructions to do
something.  That something can be repositioning the cursor, clearing the
screen, changing colors, or doing something else.  The DOS Technical
Reference manual lists the various options.

It follows that ANYTHING that sends text to the screen through DOS can
be used to control screen color.  Why, then, the numerous examples
posted to the net that use PROMPT?  Well, PROMPT makes it easy to send
an Escape character and most other things don't.  Bennett Todd
(bet@ecsvax) recently posted article 1420@ecsvax giving an excellent
.BAT file for setting colors using echo.  (I have to say nice things
about him.  He knows where I park my car.)  Unfortunately, he neglected
to explain how to enter Escape characters into a file, something a few
text editors make very difficult.

It turns out that it is not too difficult to change another character to
Escape by means of DEBUG.  Type in Bennett's file as given, but use @
signs where Bennett has indicated <ESC>.  Call the file COLOR.BAT.  Now
enter DEBUG COLOR.BAT.  This will load COLOR.BAT into memory at offset
hex 100.  By looking for @ signs (hex 40s) with the D command, and
replacing them with Escapes (hex 1As) using the E command, you'll soon
wind up with what you were after.  The command W writes out the file and
Q takes you out of DEBUG.  (The CX register should be set to the length
of the file before you write it, but DEBUG should take care of that for
you during the loading process.)  I'm not going into more detail here;
see the DEBUG documentation in your DOS manual.
-- 
D Gary Grady
Duke U Comp Center, Durham, NC  27706
(919) 684-3695
USENET:  {seismo,decvax,ihnp4,akgua,etc.}!mcnc!ecsvax!dgary

ucoelm@sw1c.UUCP (06/08/85)

>If you want to change the colors on a pc without ansi.sys, which is preferable
>because ansi.sys slows your system down, you need to make a simple C program
>to interrupt to int 10H, the BIOS video section. The technical Reference Manual
>is pretty good at explaining how to do it. I have an XT, and the section is on
>page 5-68 of my manual. 

>[code follows]
>See ya around!
>Vince.

Alternatively, for those of you who are not into C and/or basically lazy,
you can buy the almost ubiquitous Norton Utilities package which contains
a COM program which changes screen color without the need for ansi.sys.
(NO I don't work for Norton.)

-- 
					Lee Morehead
				Southwestern Bell Telephone Co.
				...!ihnp4!sw1c!ucoelm

My opinions are my own ... no one else will claim them.

"Tell them Willy boy is here...and he's eating the furniture again."