Documentation for DISPMEN.MAC -by R. Buckman [72356,344] DISPMEN is a macro that takes a menu and splits it into two columns. It is known to work with M80, and will probably work with MAC after some minor changes. One of those changes will be moving the "MENFLG SET FALSE" statement (on the first line) to somewhere near the beginning of your main source file. MAC does not accept the definition of SET statements within a macro library. Reason for Writing After fooling around with the APMOD777 source file (Apple version of MODEM7) and adding some more menu options, I noticed that the menu was getting a bit full; almost scrolling off of the screen! The CAL option split the phone numbers into two columns, so why not the main menu? After looking at how the phone number menu was split, I decided that it would be too much trouble to adapt those routines to the main menu. The answer was to write a macro that could take any menu (with fixed length options) and split it. Features o Menu entries can be added or deleted in the source file without changing any programming code or addresses. o The macro (between the conditional IF statements) is assembled only once with subsequent calls to the macro vectored through calls to ?SETUP. The more menus your program has, the more space this saves. (Well, sort of. That is the equivilent of buying more of a sale item to save more!) o As distributed, it will begin printing the right column in the 41st character position. This is easily changed to suit the user by changing one byte in the COMOF1: routine. o Most menus are in some type of logical order (ie: alphabetical). This macro preserves that order in that it will take the second menu option and print it directly beneath the first menu option and not next to it. You get this: A - (1st menu option) D - (4th menu option) B - (2nd menu option) E - (5th menu option) C - (3rd menu option) and not this: A - (1st menu option) B - (2nd menu option) C - (3rd menu option) D - (4th menu option) E - (5th menu option) o Menus with an odd number of options will print one more option in the left column than in the right column. Limitations o Each option within a menu must contain the same number of characters (fixed length) as all the other options within that menu. Spaces (tabs are not allowed ) can be used as filler. o The total number of characters in two menu options plus two spaces (to seperate the columns) can not be greater than your screen width. For example; if each menu option is 30 characters long then two options are 60 characters long plus 2 spaces equals 62 characters, so your screen must be at least 63 characters wide (allowing one for auto-linefeeds). The maximum number of characters that a menu option can have for an 80 column display is 38. The minimum number of characters is one. o The total number of menu options that will fit one 24 line screen, is 46. Forty-eight options will scroll the top two off of the screen. Implementation To incorporate DISPMEN.LIB into your program, do the following to your source code: a. Where you want the menu to be displayed, insert the line: DISPMEN MENUxTOP,MENUxBOT,y where "x" is a digit from 0 to 9 (it can be as many digits as you want, within the restrictions of your assembler) and "y" is the number of characters in each menu option. (Other menus can have a different length.) b. At the top/beginning of your menu, just before the first menu option, insert the line: MENUxTOP EQU $ and just after the last menu option, insert the line: MENUxBOT EQU $ The number used for "x" must be the same as that used in step a. and each menu must have a different number. In this way, menus may be placed anywhere in the source code. c. Near the beginning of your source code, insert a reference to the macro or, if you wish, add DISPMEN to your macro library. I've inserted it in my MODEM7 macro library and the reference looks like this: MACLIB MODEM7.LIB Otherwise, just leave it as DISPMEN.LIB. Demonstration A demonstration of DISPMEN is provided within this library (.LBR) file. The demonstration file name is DISPDEMO.MAC. Be sure to study it in order to gain an understanding of how the menu should look in your source file. Remember, tabs are not allowed within the single quotation marks and each option must be preceded by a "DB". To use the demo, place your disk with M80.COM and L80.COM in drive A: and your disk with DISPDEMO.MAC and DISPMEN.LIB in drive B:. Type: A:M80 =DISPDEMO This will create an REL file. Next type: A:L80 DISPDEMO,DISPDEMO/N/E This will create an executable COM file (DISPDEMO.COM). Type: DISPDEMO and you will see the list of options for menu one. Press any key and you will see the list of options for menu two. Epilogue I am not all that familiar with Digital Research's "MAC" macro assembler, and therefore have not provided much information on how to use it here. It seems that more people have MAC, but MicroSoft's support of Apple products has been good in the past which is why I went with M80 (part of the Assembly Language Development System). I'm still new to assembly language as it is. This is the first time I have released anything I've written so I would appreciate feedback via EasyPlex/EMail (User ID 72356,344). - Bob Buckman 18 NOV 85