• Please review our updated Terms and Rules here

Make your DOS menu system

Agent Orange

Veteran Member
Joined
Sep 24, 2008
Messages
6,643
Location
SE MI
Below are all the ingredients for a simple, precious memory sipping, DOS menu program for the purist. Kudos to Van Wolverton.

The following is a list of all the doc's, .com's, and .bat's that are required. These small programs are to be assembled in DOS using DEBUG. You will need to install ANSI.SYS in your CONFIG.SYS ([device=c:\dos\ansi.sys] for example) in order for the ASCII codes and menu overlay to function properly. Make a directory on your c:\ drive named 'MENU'. All of the files associated with the menu program should be located in the 'MENU' directory.

1) ANSI_ESC.TXT - using the prompt $e[ function to add color
2) MAINMENU.BAT - menu program
3) BIGCURS.COM - turns the cursor into a block
4) NOCURS.COM - turns the cursor off
5) NORMCURS.COM - returns the cursor to its normal appearance
6) REPLY.COM - holds the cursor in its place within the MAINMENU.BAT program
7) MAINMENU.DOC - ASCII representation of the menu overlay

Code:
REPLY.COM

debug

-a 100
xxxx:0100 mov ah,8
xxxx:0102 int 21
xxxx:0104 cmp al,0
xxxx:0106 jnz 10a
xxxx:0108 int 21
xxxx:010A mov ah,4c
xxxx:010C int 21
xxxx:010E
-r cx
CX 0000
:e
-n reply.com
-w
Writing 000E bytes
-q

Code:
BIGCURS.COM

debug

-a 100
xxxx:0100 mov ah,1
xxxx:0102 mov cx,10C
xxxx:0105 int 10
xxxx:0107 int 20
xxxx:0109
-r cx
CX 0000
:9
-n bigcurs.com
-w
Writing 0009 bytes
-q

Code:
NORMCURS.COM

debug

-a 100
xxxx:0100 mov ah,0f
xxxx:0102 int 10
xxxx:0104 cmp al,7
xxxx:0106 jz 10d
xxxx:0108 mov cx,607
xxxx:010B jmp 110
xxxx:010D mov cx,0b8c
xxxx:0110 mov ah,1
xxxx:0112 int 10
xxxx:0114 int 20
xxxx:0116
-r cx
CX 0000
:16
-n normcurs
-w
Writing 0016 bytes
-q

Code:
NOCURS.COM

 debug 

-a 100
xxxx:0100 mov ah,1
xxxx:0102 mov ch,20
xxxx:0104 int 10
xxxx:0106 int 20
xxxx:0108
-r cx
CX 0000
:8
-n nocurs.com
-w
Writing 0008 bytes
-q


ANSI_ESC.TXT
Code:
ANSI Escape Codes (Examples)

Command            Foreground / Background

prompt $e[37;41m = White            Red

prompt $e[37;44m = White            Blue

prompt $e[1;33;41m = High-intensity yellow    Blue

prompt $e[1;33;44m = High-intensity yellow    Blue

prompt $e[1;36;44m = High-intensity yellow    Blue

prompt $e[1;37;44m = High intensity yellow    Blue

prompt $e[1;37;46m = High intensity yellow    Cyan

Code:
MAINMENU.BAT

debug

echo off
:START
cls
cd c:\menu
nocurs
type mainmenu.doc
:GET_RPLY
reply
if errorlevel 69 goto GET_RPLY
if errorlevel 68 goto F10
if errorlevel 67 goto F9
if errorlevel 66 goto F8
if errorlevel 65 goto F7
if errorlevel 64 goto F6
if errorlevel 63 goto F5
if errorlevel 62 goto F4
if errorlevel 61 goto F3
if errorlevel 60 goto F2
if errorlevel 59 goto F1
goto GET_RPLY
:F10
normcurs
cls
goto END
:F9
goto GET_RPLY
:F8
normcurs
c:\
qd.bat ;(sample program)
:F7
goto GET_RPLY
:F6
goto GET_RPLY
:F5
goto GET_RPLY
:F4
goto GET_RPLY
F3
goto GET_RPLY
:F2
goto GET_RPLY
:F1
cls
nocurs
reply
normcurs
goto START
:END

MAINMENU.DOC
Code:
[ATTACH=CONFIG]55890[/ATTACH]

Please note: The above MAINMENU.DOC comprised of ASCII
characters and is difficult to represent on a modern system.


ASCII character codes used in the menu overlay:
Code:
╔ Alt-201   ═ Alt-205   ╗ Alt-187

║ Alt-186   ▒ Alt-177   ▓ Alt-178

╠ Alt-204   ╣ Alt-185  ╚ Alt-200

╝ Alt-188
 
I'm all for cute menu implementations; they are a good learning exercise.

If space is a primary concern, this takes up less space on disk: http://www.vcfed.org/forum/showthread.php?15191-Tiny-Menu
(Because your menu relies on 7 files, there's no way it can take up less than (7*512)=3.5 KB.)

Links to Tiny-Menu are no good. So, what's 3.5 KB? I been using this menu for 30 years or so on various DOS setups. I don't think I've ever run out of memory or disk space on any of my old DOS PC's. If you don't what to use it or at least try it, then that's up to you. It's a nice project for someone just getting in the hobby.
 
MAINMENU.DOC Addendum

MAINMENU.DOC Addendum

For some reason the originally posted 'MAINMENU.DOC' produced an error:

Menu1..jpg
 
In my experience the only part of any DOS menu system that needs to be tiny is the part that remains resident while whatever program you've chosen from the menu is running (which is the biggest benefit imo of batch-based menu systems -- the only resident part is command.com which will already be resident anyway). Ages ago I wrote a simple program using Turbo C to display a menu (with the names of the choices read in from a file specified via the command line), returning the user's choice via ERRORLEVEL. It ended up being used for lots of things, pretty much until we stopped using DOS boot floppies to set up newly unboxed PC's. The advantage of doing it this way was that the operator could choose an option using cursor keys and Enter (space and backspace also worked, in case the keyboard didn't have cursor keys), in addition to the 'normal' way of just typing the number of the row they wanted.
 
I like Automatic Menu by Joel Gott. It only uses ~ 5k and it doesn't require any work at all to use it. :)

Here's a synopsis:

The AMENU utility (Automatic MENU) is a simple yet very functional menu
utility. It was not designed to replace a "standard" menu program. Its
purpose is to give you an uncomplicated means of viewing every executable file
within a directory.


AMENU scans the current directory and builds a menu for all .BAS, .BAT, .COM,
and .EXE files. It also displays all subdirectories as well as the "parent"
directory. All that is left for you to do is highlight the program that you
want to run and press [ENTER/RETURN] or click a mouse button. It's that easy.


AMENU also has a companion program called AMENUED.EXE. AMENUED allows you to
customize AMENU to suit your tastes. All colors can be changed. Your own
title can be displayed. Extension groups can be enabled and disabled. Various
features used within AMENU can be enabled and disabled. Even the background
pattern can be changed.


AMENUED creates a data file called AMENU.DAT in the current directory. If at
any time you want to return to the default settings of AMENU, then just delete
this data file.
 
I like Automatic Menu by Joel Gott. It only uses ~ 5k and it doesn't require any work at all to use it. :)

Here's a synopsis:

The AMENU utility (Automatic MENU) is a simple yet very functional menu
utility. It was not designed to replace a "standard" menu program. Its
purpose is to give you an uncomplicated means of viewing every executable file
within a directory.


AMENU scans the current directory and builds a menu for all .BAS, .BAT, .COM,
and .EXE files. It also displays all subdirectories as well as the "parent"
directory. All that is left for you to do is highlight the program that you
want to run and press [ENTER/RETURN] or click a mouse button. It's that easy.


AMENU also has a companion program called AMENUED.EXE. AMENUED allows you to
customize AMENU to suit your tastes. All colors can be changed. Your own
title can be displayed. Extension groups can be enabled and disabled. Various
features used within AMENU can be enabled and disabled. Even the background
pattern can be changed.


AMENUED creates a data file called AMENU.DAT in the current directory. If at
any time you want to return to the default settings of AMENU, then just delete
this data file.

That's cool and I like Direct Access too, but this is a learning experience and it's a lot of fun to do if you're just getting into this old DOS PC thing. No frills or extras, but you'll gain a fairly good understanding of how batch files work and get a taste of assembly on the side. It's really nice if you have a slew of games on your DOS machine as there's virtually no overhead.
 
That's cool and I like Direct Access too...
I also like Direct Access but that also requires some setup and a lot of configuration. AMenu is quick and clean -- as opposed to down and dirty. :) You just run it. In fact, it could probably be used in order to help setup the system you are promoting right here. And then you could just ignore AMenu or use it whenever it's deemed appropriate.
 
Below are all the ingredients for a simple, precious memory sipping, DOS menu program for the purist. Kudos to Van Wolverton.

The following is a list of all the doc's, .com's, and .bat's that are required. These small programs are to be assembled in DOS using DEBUG. You will need to install ANSI.SYS in your CONFIG.SYS ([device=c:\dos\ansi.sys] for example) in order for the ASCII codes and menu overlay to function properly. Make a directory on your c:\ drive named 'MENU'. All of the files associated with the menu program should be located in the 'MENU' directory.

1) ANSI_ESC.TXT - using the prompt $e[ function to add color
2) MAINMENU.BAT - menu program
3) BIGCURS.COM - turns the cursor into a block
4) NOCURS.COM - turns the cursor off
5) NORMCURS.COM - returns the cursor to its normal appearance
6) REPLY.COM - holds the cursor in its place within the MAINMENU.BAT program
7) MAINMENU.DOC - ASCII representation of the menu overlay

Code:
REPLY.COM

debug

-a 100
xxxx:0100 mov ah,8
xxxx:0102 int 21
xxxx:0104 cmp al,0
xxxx:0106 jnz 10a
xxxx:0108 int 21
xxxx:010A mov ah,4c
xxxx:010C int 21
xxxx:010E
-r cx
CX 0000
:e
-n reply.com
-w
Writing 000E bytes
-q

Code:
BIGCURS.COM

debug

-a 100
xxxx:0100 mov ah,1
xxxx:0102 mov cx,10C
xxxx:0105 int 10
xxxx:0107 int 20
xxxx:0109
-r cx
CX 0000
:9
-n bigcurs.com
-w
Writing 0009 bytes
-q

Code:
NORMCURS.COM

debug

-a 100
xxxx:0100 mov ah,0f
xxxx:0102 int 10
xxxx:0104 cmp al,7
xxxx:0106 jz 10d
xxxx:0108 mov cx,607
xxxx:010B jmp 110
xxxx:010D mov cx,0b8c
xxxx:0110 mov ah,1
xxxx:0112 int 10
xxxx:0114 int 20
xxxx:0116
-r cx
CX 0000
:16
-n normcurs
-w
Writing 0016 bytes
-q

Code:
NOCURS.COM

 debug 

-a 100
xxxx:0100 mov ah,1
xxxx:0102 mov ch,20
xxxx:0104 int 10
xxxx:0106 int 20
xxxx:0108
-r cx
CX 0000
:8
-n nocurs.com
-w
Writing 0008 bytes
-q


ANSI_ESC.TXT
Code:
ANSI Escape Codes (Examples)

Command            Foreground / Background

prompt $e[37;41m = White            Red

prompt $e[37;44m = White            Blue

prompt $e[1;33;41m = High-intensity yellow    Blue

prompt $e[1;33;44m = High-intensity yellow    Blue

prompt $e[1;36;44m = High-intensity yellow    Blue

prompt $e[1;37;44m = High intensity yellow    Blue

prompt $e[1;37;46m = High intensity yellow    Cyan

Code:
MAINMENU.BAT

debug

echo off
:START
cls
cd c:\menu
nocurs
type mainmenu.doc
:GET_RPLY
reply
if errorlevel 69 goto GET_RPLY
if errorlevel 68 goto F10
if errorlevel 67 goto F9
if errorlevel 66 goto F8
if errorlevel 65 goto F7
if errorlevel 64 goto F6
if errorlevel 63 goto F5
if errorlevel 62 goto F4
if errorlevel 61 goto F3
if errorlevel 60 goto F2
if errorlevel 59 goto F1
goto GET_RPLY
:F10
normcurs
cls
goto END
:F9
goto GET_RPLY
:F8
normcurs
c:\
qd.bat ;(sample program)
:F7
goto GET_RPLY
:F6
goto GET_RPLY
:F5
goto GET_RPLY
:F4
goto GET_RPLY
F3
goto GET_RPLY
:F2
goto GET_RPLY
:F1
cls
nocurs
reply
normcurs
goto START
:END

MAINMENU.DOC
Code:
[ATTACH=CONFIG]55890[/ATTACH]

Please note: The above MAINMENU.DOC comprised of ASCII
characters and is difficult to represent on a modern system.


ASCII character codes used in the menu overlay:
Code:
╔ Alt-201   ═ Alt-205   ╗ Alt-187

║ Alt-186   ▒ Alt-177   ▓ Alt-178

╠ Alt-204   ╣ Alt-185  ╚ Alt-200

╝ Alt-188

There is a small error in the MAINMENU.BAT. Delete 'debug' (2nd entry) as it's a batch file and not compiled.
 
There is a small error in the MAINMENU.BAT. Delete 'debug' (2nd entry) as it's a batch file and not compiled.
You could have very easily edited the quoted material so all that superfluous stuff isn't quoted unnecessarily. It's much easier to make sense of a quoted post when it's not unnecessarily long.

Thus:
Code:
MAINMENU.BAT

debug

echo off
:START
cls
cd c:\menu
nocurs
type mainmenu.doc
:GET_RPLY
reply
if errorlevel 69 goto GET_RPLY
if errorlevel 68 goto F10
if errorlevel 67 goto F9
if errorlevel 66 goto F8
if errorlevel 65 goto F7
if errorlevel 64 goto F6
if errorlevel 63 goto F5
if errorlevel 62 goto F4
if errorlevel 61 goto F3
if errorlevel 60 goto F2
if errorlevel 59 goto F1
goto GET_RPLY
:F10
normcurs
cls
goto END
:F9
goto GET_RPLY
:F8
normcurs
c:\
qd.bat ;(sample program)
:F7
goto GET_RPLY
:F6
goto GET_RPLY
:F5
goto GET_RPLY
:F4
goto GET_RPLY
F3
goto GET_RPLY
:F2
goto GET_RPLY
:F1
cls
nocurs
reply
normcurs
goto START
:END

 
That's 'cause it's got to be done manually. :) You know... highlight and press delete. I guess vBuelletin, although it's quite nice, is not fully automated.

First I've heard of it. I give it a shot.

Edit: Tried it and it didn't work.
 
Back
Top