Microsoft KB Archive/32698

FORTRAN-80 Logical Unit Numbers

PSS ID Number: Q32698 Article last modified on 07-19-1988

3.36 3.37 3.42 3.43 3.44 CP/M-80

Summary: There is a default of 10 LUNs (Logical Unit Numbers). They are pre-assigned as follows: 1, 3, 4, 5 - console device TTY: 2 - printer device LST: 6, 7, 8, 9, 10 - default disk files FORT06.DAT, FORT10.DAT

More Information: Two library routines must be modified to do this. On the FORTRAN disk you will find the following files: DSKDRV.MAC LUNTB.MAC These files need to be modified and assembled, then linked into a program to replace the default routines in the FORLIB.REL library. LUNTB.MAC requires the following changes: 1. Increment the value of the maximum number of LUNs by 1. The value is shown as “13Q” (“Q” indicates an OCTAL number: the decimal value is 10). Change this value to the maximum number desired plus 1. 2. Add a DW instruction for each additional LUN. DSKDRV.MAC requires only a change to the value of MAXLUN. When you link the assembled items in, they must be specified before the FORLIB.REL library. Note that even if you increase the maximum number of LUNs, there is not necessarily enough TPA memory in the CP/M machine to have more than 10 files open at once. Inside LUNTB.MAC The following should be line 43 or so in LUNTB.MAC: $LUNTB:DB 13Q ;MAX LUN + 1 The following should start about 20 lines from the end of LUNTB.MAC: IFT DSK DW DSKDRV DW DSKDRV DW DSKDRV DW DSKDRV DW DSKDRV ENDIF <— add “DW DSKDRV” before the ENDIF for each additional LUN. Inside DSKDRV.MAC The following should be about the ninth line in DSKDRV.MAC: MAXLUN SET 10 ; Max number of LUNs allowed