An implementation/simulation of the MOD1 MSR (Mass Storage Resident) operating system and programming environment is available. This provides an easy way to manipulate files on mass storage media (Disk Packs). This feature is implemented as a set of java virtual extensions. See Virtual Series 2000 Extensions for more on virtual software extensions.
Features of "File Support C" and "Volume Preparation C" are implemented in the menu "Disk Util". These allow initialization of a volume, mapping (listing) of a volume, and allocation (create) and deallocation (delete) of files. See information in Basic Operation.
Access to files (data) in programs is through the MOD1MSIO virtual macros package, invoked (loaded) using the "MAC" assembler directive as described in Easycoder Assembler Implementation. Apart from the non-standard virtual extension "MAC", the macros are used as described in the original MOD1 documentation, with the following exceptions:
Here is a sample program to read a file named "MYFILE01" and print it, simplified for clarity.
00010* MOD1 PROGRAM TO TEST READING DISK FILE 00020 PROG MOD1T2 00030 ORG 1340 00040 ADMODE4 00050 MAC MOD1MSIO 00060* 00070L MIOC A 00080* 00090C F1 MCA A,DEVTAB 00100C 10 RECD2,,MOVE,RECD1 00110C 20 MYFILE01, 00120C 31 00, 00140L 43 DEXIT, 00170* 00180 START CAM 60 00190L MSOPENF1,IN 00200L NEXT MSGET F1, 00210 PDT RECD1,12,02,01 PRINT RECORD 00220 PCB *,12,02,00 00230 B NEXT 00240* 00250L DONE MSCLOSF1, 00260 PDT FIN,10,02,01 00270 PCB *,10,02,00 00280 B (164) MOD1 PROGRAM EXIT 00290* 00300 ABORT DCW #1C40 00310 DEXITC DCW #1B0 00320 DEXIT SCR DXITZ,70 00330 BCE DONE,DEXITC,01 EOF IS SOFT ERROR 00340 EXM ABORT,VEXITC,01 ANYTHING ELSE FATAL 00350 DXITZ B 0 00360* 00410 DEVTAB RESV 0 00420 DCW #3C040000 PCU, LUN, 00 00430 L DCW #1B0 00440* 00450 RECD1 RESV, 80 ITEM BUFFER 00460 L DCW #1A 00470* 00480 RECD2 RESV, 256 BLOCK BUFFER 00490 L DCW #1A 00500 L DCW #1A 00510 L DCW #1A 00520* 00530 F FIN DC @FINISHED @ 00540* 00550 END START
At card (line) 00050 is the modern (non-standard) extension to EasyCoder to load a macro library.
At line 00070 is the initialization of MIOC, declaring instance "A". Note that, in this implementation, all of MIOC/MPIOC is in a virtual runtime and thus consumes no extra program memory, making most parameters to MIOC irrelevant.
Beginning at line 00090 is the definition of the MCA for "MYFILE01".
At line 00190 the file is opened for input-only. Note, any failures at this point cause an EXIT call which is fatal/terminal.
At line 00200 one item is read from the file. Note, a Data EXIT for EOF will cause a graceful end to the program, checked on line 00330.
In the case of a graceful end, the file is closed on line 00250.
All of these system files are Partitioned Sequential files. Currently, "*DRS1LIB" is not used (native macros not yet supported). "*DRS1GO" is the default output file for the "Disk Image" option of the assembler. "*DRS1RES" is the only input for MOD1 executables. Executables are managed using the menu option "Executable Function" under "Disk Util".
File Name | Purpose | Item, Record, Block length |
---|---|---|
*DRS1RES | Resident Executable Images | 250, 250, 250 |
*DRS1GO | Assembler Output Executables | 250, 250, 250 |
*DRS1LIB | Unspecialized Macros | 80, 250, 250 |
When booting, this code expects a partitioned-sequential file name "*DRS1RES" that contains an executable program image in the member named "SUPER101" (visibility is not checked). This program will be loaded and executed whenever the code boots or is entered again ("normal program exit"). If SUPER1 is made resident, then it should intercept the entry calls and prevent mod1loader from redundantly loading SUPER1.
The code for SUPER1 is in superv.ezc, and may be assembled using the built-in H2000 Assemble function, with the "Disk Image" option (if "*DRS1RES" exists). The "*DRS1RES" file may be created on any volume using the "Allocate File" function. The file must have a item, record, and block size of 250 and an index size (and data allocation) sufficient for storing the desired set of programs.
SUPER1 (as implemented by superv.ezc) will print READY on the console typewriter and wait for a 6-character command. The command must be either "EXΔΔΔΔ" or "TESTΔΔ". After entering the 6th character, enter one more space to confirm the command or any other character to abort and return to READY. If the command is not recognized, "WHAT?" will be printed. After the command is accepted, enter the 8 character program and segment name of a program on the resident ("EX") or go ("TEST") file, then press RETURN. If the program can be found and loaded, it will be executed. If the program exits by a standard monitor method, then the supervisor will be reloaded and the READY state reached. If the program does not exit using a standard monitor method, and has not corrupted the communications area, then setting the SR to 86 decimal (126 octal) and pressing RUN should restore the READY state. Otherwise, it will be necessary to boot from the disk pack again.
TODO: Managing the "*DRS1RES" program library.