Ansi.sys and old Dos programs

#1
Say I need to run an old DOS program like Zork which needs an ansi.sys driver. In the XP command environment I can type "nnansi.com" and then "_zork1.com" and I can combine them in a bat file.

This doesn't seem to work in the TCC environment.

What I can do is type "cmd nnansi.com" which waits for more input, then type "_zork1.com" which runs the DOS program okay, although nothing prints when _zork1.com is typed.

I don't understand what's happening and I haven't been able to combine these two commands into a single command or get them to run in a batch or btm file.

Any suggestions?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#2
Say I need to run an old DOS program like Zork which needs an ansi.sys driver. In the XP command environment I can type "nnansi.com" and then "_zork1.com" and I can combine them in a bat file.

This doesn't seem to work in the TCC environment.

What I can do is type "cmd nnansi.com" which waits for more input, then type "_zork1.com" which runs the DOS program okay, although nothing prints when _zork1.com is typed.

I don't understand what's happening and I haven't been able to combine these two commands into a single command or get them to run in a batch or btm file.

Any suggestions?
I think the usual way to handle this is to put a DEVICE=%SYSTEMROOT%\SYSTEM32\ANSI.SYS statement in your CONFIG.NT file. You could probably instead put a reference to NNANSI.COM in your AUTOEXEC.NT file. I doubt there's any real advantage to using one over the other.
 
Apr 4, 2010
57
0
#3
I think the usual way to handle this is to put a DEVICE=%SYSTEMROOT%\SYSTEM32\ANSI.SYS statement in your CONFIG.NT file. You could probably instead put a reference to NNANSI.COM in your AUTOEXEC.NT file. I doubt there's any real advantage to using one over the other.
But TCC doesn't listen to the *.nt files, correct? Which is to say that
config.nt and autoexec.nt are only for 16 bit shells, i.e command.com, but not cmd.exe or TCC.exe. Is that right?
 
#4
Say I need to run an old DOS program like Zork which needs an ansi.sys driver. In the XP command environment I can type "nnansi.com" and then "_zork1.com" and I can combine them in a bat file.

This doesn't seem to work in the TCC environment.

What I can do is type "cmd nnansi.com" which waits for more input, then type "_zork1.com" which runs the DOS program okay, although nothing prints when _zork1.com is typed.

I don't understand what's happening and I haven't been able to combine these two commands into a single command or get them to run in a batch or btm file.

Any suggestions?
Use DOSBox (http://www.dosbox.com/). I also have several DOS programs that work only in DOS. As they will never be updated, or until I find a replacement, DOSBox is the best zero-cost solution.

Note that DOSBox does NOT work with TC.

Joe
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#5
But TCC doesn't listen to the *.nt files, correct? Which is to say that config.nt and autoexec.nt are only for 16 bit shells, i.e command.com, but not cmd.exe or TCC.exe. Is that right?
They are for Windows's DOS subsystem; they will affect any DOS-based program, including Zork and COMMAND.COM but not CMD.EXE or TCC.EXE. Which is what you'd want, I imagine. After all, it's Zork which emitting those ANSI sequences, not TCC or CMD.EXE.

A couple of other approaches, which I haven't tested: Create a .PIF file for _ZORK1.COM, and specify a custom Config or Autoexec file in that (it's the Advanced button on the Program tab); run the .PIF from TCC. Or, create a ZORK.BAT file (not .BTM) which loads NNANSI.COM and then runs _ZORK1.COM; run COMMAND /C ZORK.BAT from TCC.
 
#6
Use DOSBox (http://www.dosbox.com/). I also have several DOS programs that work only in DOS. As they will never be updated, or until I find a replacement, DOSBox is the best zero-cost solution.

Note that DOSBox does NOT work with TC.

Joe
Thanks for the lead. I just tried DOSBox as you suggested. Cute program works just like an old DOS programmer would expect.

But I'm determined to make Zork run from a single command in TC just to see if I can do it (I don't have any trouble running Zork using NT CMD -- of course it's not really Zork I wan't to run, but a command interpreter I once wrote to run under DOS). But I'm finding TC hard to catch on to.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#8
Exactly, that works!

(only I don't quite understand why!?)
Well, since it's COMMAND.COM executing the batch file and not TCC, both commands are executed in the same DOS session.

If you put both commands in a .BTM and TCC executes it, then NNANSI and Zork will wind up running in separate DOS sessions (VDMs). The first VDM is created when you load NNANSI.COM, a DOS program -- and destroyed when NNANSI terminates (almost immediately.) Then a second VDM is created for Zork, but by then the first VDM is gone, taking NNANSI with it. Running DOS programs in a non-DOS operating system is a mess; DOS TSRs were always a mess; put them together and you have mess squared.

CMD.EXE has a Rube Goldbergesque mechanism for handling .BAT files which causes all DOS programs to be executed in the same VDM. TCC doesn't emulate it. Type HELP 4NTBAT for ugly details, if you really want them.