ADDITIONAL NOTES: M. Slomin, 8/10/88 --
I was not successful compiling mg2 under TC 1.5. It seems to have a
memory allocation error in it. Perhaps the stack should be adjusted.
As an alternative, I minimally hacked the program for compilation
under MSC 4.0 (which generally produces faster code than TC anyway,
and, by the way, has alloca() built in). The ttyio.c, ttykbd.c, tty.c
and fileio.c files are the hacked ones; the same file names preceded
by "o" (e.g., ottyio.c, etc.) are the originals referred to below.
The makefile for compilation under MSC 4.0 is "makefile.ms4." To compile,
type "make makefile.ms4." Note that the files to be linked are in
"linkfile", and that the link command has the flag /exepack (implying
that only the MSC 4.0 linker, and not the one supplied with DOS, should
If you should have MSC 5.0 (which I don't), you should rename these
files to their original names. You may want to consider using the new
tty.c file in any event, which halves the time interval for sensing ^X
commands and the like. I found it too long in the MSC 4.0 version,
and the 5.0 code is the same.
ORIGINAL MS-DOS NOTES
This is the source for the MS-DOS version of mg2a. These files are
intended to reside in a directory sys/msdos underneath the main mg2a
This code will run under both "Turbo C 1.5" and "Microsoft C 5.1"
To compile using Turbo C 1.5, copy makefile.tc from the sys/msdos
directory into the main mg2a source directory, then cd into the main
directory and use the Turbo C "make" program (just type "make").
M.S. NOTE: IT DOESN'T WORK UNDER TC 1.5. ALSO, IGNORE INSTRUCTIONS
ON COPYING THE FILES. THE ONES IN THIS ARCHIVE ARE THE MS-DOS FILES
To compile using Microsoft C 5.1, cd into the main directory and type
M.S. NOTE: SIMPLY USE "make makefile.ms5"
A few random notes:
o The display routines rely on the ROM BIOS interface. This has the
advantage of being more portable, but at the expense of display
speed. Direct memory-mapped display code or using ANSI sequences with
NANSI or FANSI-Console could be much faster. To keep the program
small and maintain portability, enhancements such as these should
be supported as compile-time options (e.g. with #ifdef's)
The only display mode supported is 24 x 80. To fix this, you will
need to change NROW and NCOL ttydef.h to be the largest # of rows
and columns supported, then you will have to change either
ttresize() in "tty.c" or setttysize() in "ttyio.c" to check the
BIOS parameter memory for the current screen size.
o Note that the keyboard support also goes through the BIOS.
The "backspace" key generates DELETE (so that it does a
delete-backwards, while control-h still returns control-h (i.e.
HELP). Arrow keys, HOME, END, PgUp, PgDn, etc. are supported
(look in ttykbd.c) The ALT key works like a META key for alpha
keys, but the BIOS doesn't return keycodes for certain ALT
key combinations (I wish ALT-SHIFT-< worked!) 8 bit characters
(the line drawing set!) are supported, but to enter them, you
must use ALT-ddd (where ddd are digits on the numeric keypad).
o The dired mode SEEMS to work, but I am not real happy with "dired" in the
first place, and the MS-DOS implementation isn't very well tested.
Presumably this is one area which will be enhanced in mg 2b.
o REGEX compiles OK, but doesn't seem to work right. I haven't done any
extensive testing, and I'm not sure what is breaking down. If you
want to play with this, you must add the
string "-DREGEX" to the CDEFS macro in the makefile (don't try to
add it to sysdef.h: regex.c won't compile right (sigh)).
Anyway, I've got no use for REGEX at the moment, and compiling it
in adds 15K to the base executable size of 90K. I pass.
Good luck with this. We hope you find it useful. Please send any
improvements you make.
John P. Nelson (decvax!genrad!jpn, [email protected]
) did the Turbo C
port and most of the work (based on his earlier work on
MicroGnuEmacs). Jeff Siegal ([email protected]
) brought it up under
Microsoft C and fixed a few bugs.
This document was written by John P. Nelson and modified by Jeff Siegal.