25-apr-84 [1,200] RSX BASIC - MICHAEL REESE VERSION Overview: BASIC as implemented in the following files under RSX-11D is a highly upgraded version of what used to be a DECUS library program for DOS. Full FILES-11 I/O is supported (although in a bastard sort of way). String functions and user de- fined functions are much more flexible than in either the original version or in DEC's BASIC-11. A number of defici- encies and bugs in the original have been fixed. Multi-user implementation is supported with separate pure and impure areas. This implementation of BASIC is highly interpretive and thus is slow for number crunching (that's why you have FORTRAN). It is however, highly interactive and includes special debugging commands: STEP, CON and SET TRACE. OVERLAY and a data preserving CHAIN are also supported. A clean "break" feature is implemented via the TT handler (more below). In the latest version, a number of RSTS-like features have been added including: virtual arrays, integer and byte variables, continued lines and IF-THEN-ELSE. Files: BASIC0.MAC through BASIC4.MAC plus IDNTFY.MAC and IMPUR.MAC are the seven source files for the interpreter. BASIC4.MAC implements the guts of the user subroutine CALL statement plus a set of specialized subroutines used at Michael Reese Medical Center. This code can probably be removed with a minimum of work if space becomes a problem. The file SPAWN.MAC implements the IAS V3.0 SPAWN directive via a BA- SIC CALL statement. The reference to SPAWNB in IMPUR.MAC should be commented out if not running under IAS V3.0 or higher. Two command files for assembly are provided: 11MASM.CMD and 11DASM.CMD. BIGBASIC.CMD is a task build command file which may be tail- ored for single user operation. Note that for either single user or multi-user operation, routines for trigonometric and transcendental functions are taken from a FORTRAN OTS libra- ry. The library which we are set up for is V01C. This could be changed to use F4P OTS if references in BASIC1 are changed to the F4P entry point names. FOR V02 is an unknown as far as use of its OTS routines are concerned. The task build command files assume these to be in SYSLIB. If they are somewhere else, an explicit reference should be made to whatever library they are in. Another set of command files is used to link a library ver- sion of BASIC. First, an impure area STB is created by as- sembling IMPUR without the symbol definition TASK=1. Use IMPURNOMO.ASM for this. This prevents the global definition of .MOLUN and prevents problems later on. Also assemble IM- PUR with the command file IMPUR.ASM in preparation for final PAGE 2 25-apr-84 linking with BAS.CMD (below). IMPURNOMO is then linked to form the symbol table. For RSX11D usd IMPURNOMO.CMD to link the symbol table. The library is then linked using BASPUR.CMD. Put the resulting TSK and STB files in LB:[1,1], install the BASPUR resident library and link with BAS.CMD. The BAS.TSK file can now be installed with differ- ent INC values and different names for optimized use, each one sharing the pure code. A command file for use with ...AT. are provided for doing all of the work described in the above paragraph: 11DSHARE.CMD for RSX11D or IAS. The development of the equivalent command file to do the same for RSX11M-PLUS remains to be done at this point. If some- one has done this, we would appreciate their feedback. One could probably make one following the RSX11D command file and modifying for RSX11M. Programs: MSGEN is a program for generating and modifying an MO mes- sage file for BASIC. The current file is BASIC.MSG. It should be placed under [1,2] on the disk referred to as SD:. BASIC0.MAC can be edited to change the disk name and ac- count. If no MO output is desired, modify BASIC0.MAC by re- moving the line defining the symbol RSX11D. This will pro- duce numbered error messages but no explanatory text. This is automatically done with 11MASM.CMD. BASDOC is a program which extracts RUNOFF format source text from the macro files for BASIC. The output is a file BASIC.RNO which, when processed by a special version of RU- NOFF, produces a fairly complete manual for BASIC. BASIC.DOC is such a manual. The special version of RUNOFF was made at Michael Reese Medical Center for use with a Cen- tronics printer having a wide character option. It also has some non-standard abbreviations for commands. If needed, the BASIC.RNO file could be edited for use with a standard RUNOFF. The special Centronics commands usually start with a "W", i.e. ".WC" instead of ".C" etc. A BASIC break is now implemented via the ^C AST function of the TT handler. Note that the definition RSX11D=1 is used for this option to distinguish between handler AST action under RSX11M and RSX11D. Also note that this break happens between successively executed lines. Thus a one line loop cannot be broken. If you have questions call: Frank R. Borger Dept. of Medical Physics Michael Reese Medical Center 2929 So. Ellis Ave. Chicago, Ill. 60616 (312) 791-2515 PAGE 3 25-apr-84 Reese BASIC Users Dear User, This release of REESE BASIC is mainly a maintenance update. The basic working of the system has not changed, rather the emphasis has been to include bug fixes and better documenta- tion and 11M support. Changes include: 1. Attempting to load a program with the "/CO" switch, (implying a previously compiled version was saved,) when the source file was NOT complied, confused the blazes out of the interpreter. The current version sets the "FORTRAN Carriage-control" bit in the file header as a check when saving compiled versions of the file, and checks same when reading back in. As a result, previously compiled BASIC files must be re-compiled. 2. Immediate mode commands in source files could often blow BASIC out of the water. In the current ver- sion, any Immediate mode command read in from a saved program is reported as an error. (To deter- mine the location of an immediate mode command, after the error message, issue a "CLOSE" command from the keyboard, followed by a "LIST" command. The immediate mode command causing the error fol- lows the last line of the program.) 3. The manual has been significantly re-done. The ma- in change is a re-structuring of the format, into several more chapters, with the various commands and functions, more logically grouped. In addition appendices B and C provide much better documenta- tion on techniques for writing loadable macro su- broutines. 4. Due to the problems incurred in figuring out what DEC changed in the FORTRAN math routines, (SIN, COS, etc.) from release to release and from IV to IV-PLUS, we now include the routines in MATHLIB.OLB. (These are extracted from version 2 of FORTRAN-IV.) 5. Better support is provided for RSX11M. Present command files let one use all the bells and whis- tles, including loadable MACRO subroutines, SPAWN capability, etc. UIC [1,203] contains a current working version under 11M. The following points should be made for 11M users: 1. The TKB "/MU" switch is entirely different in it's meaning between 11M and IAS. 11M TKB com- mand files which happen to have this switch in- PAGE 4 25-apr-84 cluded will jam all READ-ONLY P-SECTS up in ad- dress range 160000 to 1777776, and the resul- tant task will bomb when it trys to access those subroutines. (As usual, DEC documents this abnormality on a single page buried deep in the TKB manual, and doesn't say a thing about it on the page describing the MU switch.) 2. We haven't yet gotten a shared-code version running under 11M, and would appreciate feed-back from some users. 3. Under 11M, BASIC cannot spawn another version of himself, (due to system restrictions which do not let multiple copies of a task execute at the same terminal.) This can be gotten around by creating copies of the task image, and ins- talling them with the names "...BA1", "...BA2", etc. 6. Loadable subroutines Users acquainted with the loadable MACRO subroutine capability should look at a couple of new routines, including: 1. DIRECT, a routine which enables BASIC to issue any system directive. The BASIC program GETTI uses them to find out good things about what terminal one is running at. 2. EXITST, a routine that lets basic do an "EXIT WITH STATUS". 3. Several BASICn.doc files, extracted subroutine descriptions from BASIC0 thru BASIC4, which should make it easier for experienced system/macro programmers to write their own routines. 7. BASDOCMAK.BAS, a program to re-create the BASIC.MSG file, since FLX won't keep the fixed-length attri- butes of the BASIC error message file. 8. Users who would like a demonstration of the capa- blily of BASIC using the SPAWN capability should look at BASMANUAL.BAS. In essence, this master program: 1. CAUSES another version of basic to extract the RUNOFF source from the several MACRO source files, (and seperate them into the several chapters.) PAGE 5 25-apr-84 2. Creates one concatenated RUNOFF source file for the manual. 3. Extracts table-of-contents information from a first RUNOFF pass on said source file. 4. Inserts the table-of-contents into the RUNOFF source using RNP, (available elsewhere on this tape) 5. Produces the final document, in two forms, one suitable for use on normal printers, the other tailored for DIABLO type printers, (includes proportional spacing and highlighting in RED) 6. Optional capability to use TWOPAGE.BAS to print the manual on both sides of 8&1/2 X 11 paper NOTE The above programs use a special REESE version of RUNOFF, plus the programs RNP.TSK and TWOPAGE.BAS, available on this tape under a seperate UIC. 9. Included in this release are some new conditionals and a couple of bug fixes, supplied by Daniel steinberg of SRI International. They provide the following enhancements and bug fixes. 1. Undefined variables correctly reported by error processing 2. Mixed mode arithmetic (A=B$) correctly reported by error processing 3. Conditional assembly parameter to automatically set a new variable to zero, (rather than gener- ating an error) 4. Conditional assembly for RSX11M to automatical- ly extend the task when user storage area is full. 5. A FLOATING-POINT emulator which lets BASIC run on non-FPP machines. 10. A late bug fix, any INPUT command that included a prompt string but did not have a variable to input would crash basic. This has been fixed in the IAS PAGE 6 25-apr-84 version, the 11M version is not fixed. 11. A late enhancement, if BASIC does not find a re- quested program, it also looks under [1,1] (on the same disk.) This makes commonly used programs ava- ilable to everyone without having multiple copies all over. This enhancement is also not included in the 11M version. LATE FLASH for IAS users: First time users under IAS (or 11D) should avail themselves of the indirect command file and batch stream (BUILD.CMD and BUILD.BIS,) supplied by Paul D. Clayton. These will get a first version of BASIC up and running with a minimum amount of pain. (You must still edit BASPRE.MAC to configure things for your system and hardware. He also included a FORTRAN program to re-create the BASIC.MSG file (as fixed length,) which FLX clobbers in the transfer process. See his notes later in this document PAGE 7 25-apr-84 TO: Users, Modifiers, Debuggers of these programs RE: Feedback If you, as a user of the here-in presented submission make significant changes, enhancements, bug-fixes etcetera, PLEASE make them known to the person listed as the main- tainer of the package. Feedback from users can provide help in various ways: 1. Pointing out bugs the maintainer was not aware of 2. Suggesting enhancements/changes that improve per- formance 3. Providing insight into support on other operating systems and hardware. As an example, I discovered some neat work done on REESE BA- SIC by another organization on the Spring '79 tape. These included support for non FPP hardware, and extending the task (rather than generating an error message) under RSX11M I only discovered these goodies by accident. I can't speak for all submitters to the SIG tapes, but I my- self would really like to hear from people who use our con- tributions. I may not be able to help with all the prob- lems, I may be able to refer you to someone who has similar hardware/software, but in any case, just knowing someone is out there on the other end of this tape really helps. PAGE 8 25-apr-84 PAUL D. CLAYTON RMS AT NADC, WARMINSTER, PA. 19-MAR-82 12:27:00 COMMAND FILES HAVE BEEN GENERATED AS FOLLOWS: 1. 'BUILD.CMD' IS A PDS COMMAND STREAM TO ASSEMBLE, TASK BUILD AND COPY TASK IMAGES TO THE CORRECT LB: ACCOUNTS. 2. 'BUILD.BIS' DOES THE SAME THING FROM A BATCH STREAM IF YOU WANT TO FREE UP THE TERMINAL WHILE BASIC IS BUILT AND HAVE A PERMANT LOG OF THE ACTIONS TAKEN AND THERE RESULTS. YOU SHOULD LOOK OVER THE COMMAND/BATCH FILES AND CHECK TO MAKE SURE THE ACCOUNTS NUMBERS MATCH WHERE THEY ARE NOW, AND THAT YOU HAVE THE NEEDED FILES. THE FILES MENTIONED ABOVE WILL INSTALL BASIC WITH THE LARGEST SPACE FOR USER PROGRAMS. YOU MAY WANT TO INSTALL A NUMBER OF SMALLER BASICS IF MEMORY SIZE IS A PROBLEM. IGNORE THE UNDEFINED SYMBOLS IN THE BUILD OF 'IMPURNOMO' AS IT IS ONLY FOR THE GENERATION OF A SYMBOL TABLE. YOU WILL NOTICE THAT THERE ARE A LOT OF COMMAND FILES AND WHAT HAVE YOU THAT APPEAR TO BE FOR SOMETHING. LOOK THEM OVER AND DECIDE FOR YOURSELF. REFER TO THE EXTENSIVE DOCUMENTATION (.DOC) AND README.* FILES FOR HELP IN ANY SPECIAL EFFORTS THAT YOU HAVE. PAGE 9 25-apr-84 Installation guideline There often seems to be question about configuring basic. Under IAS one has to do the following: 1. Print out BASPRE.MAC and decide what configuration you need, edit BASPRE.MAC accordingly. 2. Assemble new objects using 11DASM. 3. Use BSCALL.CMD or BSCALL.BUG to remove old version and install new version, (".bug" command files generate de-bugging or test version.) Note that steps 2 and 3 can also be done by Paul Clayton's BUILD.CMD and BUILD.BIS files. For 11M, one must: 1. Edit BASPRE to reflect your configuration, especially 11M switch. 2. Assemble sources using 11MASM.CMD 3. Remove build and replace using BSCALL11M.CMD Note that 11M users should work from UIC [102,23]. This UIC does not always contain the latest sources, since 11M support tends to drag behind IAS. If in doubt, copy sources from [1,202]. As a final note, since there are so many files, I have included an annotated directory, "basic.dir" which contains a one-line description of all files.