This library contains the following files: -ARRAYS.DOC - Background, overview, and rationale of ARRAY functions. (The file you are now reading.) ARRAYHLP.LBR - Standard ZCPR3 HELP file similar to those for Z3LIB, SYSLIB, and VLIB. Describes ARRAY function usage. SARRYLIB.REL - An SLR format relocatable object library containing the routines described in the .HLP files. MARRYLIB.REL - Microsoft Rel format relocatable object library containing the routines described in the .HLP files. ARRAYx.Z80 - Source files for the Array Routines (x = 0....G) ARRHDR.LIB - Macro library used to adjust code to assembler used ZASMBL.COM - Alias to assemble source files using ZAS MKMLIB.COM - Alias to make Microsoft format library using ZLIB ASMBLS.SUB - SLR indirect command file to make SLR rel files ASMBLM.SUB - SLR indirect command file to make microsoft rel files MKSLIB.SUB - SLR indirect command file to make SLR format library ARRAYS is a set of routines which started out as a means of providing a Disk/User bit-map for controlling directory access by programs like FINDF and SDIR. The routines utilize a bit map of all possible drives/user areas and permit arbitrary designation of which of the D/U combinations are allowed access by transient programs. The concept (and routines) is easily extensible to BIOS functions, and to the manipulation of byte arrays of arbitrary data. Many programs use a Maximum Drive and Maximum User number above which program access is forbidden. Satisfactory as that scheme has been, it has one major drawback: if a device like Ramdisk is assigned a drive designation which is not contiguous, then you must choose between ignoring that drive or having programs attempt to access non-existant drives! On one system, I have four floppies (A: - D:) and a Ramdisk which is assigned as drive M:. These assignments are a BIOS function; to change them is no small task. A bit-map approach (in each program!) is obviously a solution, but could still be a great deal of trouble to maintain as assignments change. SDIR uses this approach for the Drives that are accessible (but not the User Areas), and must be manually maintained and reassembled if the logical drive assignments change. ARRAYS provides a set of routines which can be included in a program to provide for semi-automatic maintenance of the bit-map. The map can be manually prepared in an intuitive manner if desired. The Map can also be configured from Max DU in the program or from the ZCPR3 Environment Descriptor, from the ZCPR3 Named Directories segment, or from combinations of them. Since a bitmap is really an array of bytes the routines are arranged in such a way that they can be used to manipulate an array of bytes with equal ease. In fact, the routines are useful for byte arrays whose rows and columns are up to 255 bytes in extent. (That would fill a 64K memory bank!) The ARRAYS routines are fully documented in the accompanying HELP files. They are intended to be used in the same way as SYSLIB, VLIB, Z3LIB, and similar relocatable object sources. They provide a set of general purpose basic tools that can be used with any program written for ZCPR3. The following notes on DU maps may help provide an overview to help in understanding the rationale behind ARRAYS routines.. Structure of the DU map dumap: row0: ds (maxdu+1)/8 ;for drive 1 (A:) row1: .. ..... ;for drive 2 (B:) ... .. ..... ; etc. ... .. ..... ; etc. row15: ds (maxdu+1)/8 ;for drive 16 (P:) for maxdu=31 (typical) and maxdrv = 4, the following array is defined: (4 physical drives, and system limit is 32 users) The 1's mark user numbers that are allowed. Each row represents a drive; if the row contains all 0's then the corresponding drive is considered not available for access. dumap: db 11111111b,11111111b,11111111b,11111111b db 11111111b,11111111b,11111111b,11111111b db 11111111b,11111111b,11111111b,11111111b db 11111111b,11111111b,11111111b,11111111b db 00000000b,00000000b,00000000b,00000000b .. ......... ......... ......... ......... .. ......... ......... ......... ......... row15: db 00000000b,00000000b,00000000b,00000000b If now the system access were restricted to the following LOGICAL assignments: drive A: Users >15 not available drive B: Users >10 not available drive C: not available for access drive D: Users >10 not available drive D: Users 2 and 8 not available here is what the DU map looks like ;user numbers-> 7......0 15.....8 23....16 31....24 dumap: db 11111111b,11111111b,00000000b,00000000b db 11111111b,00000111b,00000000b,00000000b db 00000000b,00000000b,00000000b,00000000b db 11111011b,00000110b,00000000b,00000000b db 00000000b,00000000b,00000000b,00000000b .. ......... ......... ......... ......... .. ......... ......... ......... ......... db 00000000b,00000000b,00000000b,00000000b Notes on the DU array: 1. The maximum array size (Z-System or ZCPR3/CPM operating systems) is 64 bytes. The 64 bytes provide one bit position for each possible drive/user combination in a maximum size configuration. 2. Note that the assignment of bits to user numbers appears to be "backwards". This order is a result of the difference in the way assemblers describe bit positions and the way that humans conventionally write a list of numbers. This is an awkward situation if you want to generate a D/U map manually. If the map is generated by a subroutine (from maximum disk/user input, for example) then there is no difficulty except for the usual translation from hex to binary notation (in the 'backward' form!) 3) One of the routines in ARRAYS is designed to make life a little easier for manual bitmap generation. It simply walks through the array reversing the order of the bits in each byte. You can write the source code with bit assignments as shown below. Then, before your program attempts to read or write data in the bitmap, the ARINVERT routine is called. Voila! You AND the program can be happy! user numbers-> 0......7 8.....15 16....23 24....31 dumap: db 00000000b,00000000b,00000000b,00000000b Using this strategy, the bitmap from the example above could be manually entered as follows: dumap: db 11111111b,11111111b,00000000b,00000000b db 11111111b,11100000b,00000000b,00000000b db 00000000b,00000000b,00000000b,00000000b db 11011111b,01100000b,00000000b,00000000b db 00000000b,00000000b,00000000b,00000000b Standard Register usage for DU oriented array: B = Drive number. Range 1-16 C = User Number. Range 0-31 CY flag is used (when set) to indicate an error condition, and when an error condition exists, register A returns containing a value which identifies the type of error. ====================================================== ARRAYS is copyright by A. E. Hawley on March 31, 1987. It may be freely distributed, but it must not be sold either separately or as part of a package without the written consent of the author. The author may be reached via electronic mail at the Ladera Z-Node in Los Angeles, 213-670-9465, or by U.S. Mail at: 6032 Chariton Ave. Los Angeles, CA. 90056 Voice Phone: 213-649-3575 ======================================================