Classic Computer Magazine Archive ANTIC VOL. 1, NO. 6 / FEBRUARY 1983

Assembly Language

Extended Directory

By Wes Newell

For some time now I have been unhappy with only having eleven spaces, including filename extension, to use for disk directory filenames. This forced me to undertake the task of trying to modify the DOS to accept longer filenames. Well, after many long and sleepless days and nights, I finally completed the job. The following Assembler source code will produce the program to modify DOS 2.0S.

The following advantages will be noticed:

1 Filenames to a maximum of 27 characters.

2. Any ASCII character from decimal 48 to 122 is legal anywhere within the filename, even the first character.

These are the disadvantages:

1. The modified DOS will not read the directory of the old DOS and vice versa. The directory can be changed to allow either DOS to read the other.

2. Allows 60 files maximum. That's four less than the current DOS 2.0S.

3. The disk format will take up seven more sectors, leaving 700 free sectors instead of 707.

4. Because DOS.SYS and DUP.SYS will both be modified, I have changed the name of DUP.SYS to dup.sys (lower case) to keep from loading one system with the other.

Example

If you boot with the old DOS and put a diskette with the modified DOS on it into the drive and call up DOS, the system will not see DUP.SYS since it has been changed to dup.sys. Therefore the system will return control back to you. This works in reverse if you boot with the modified DOS.

If you are happy with the filename structure as it is now, wait until you have a hundred diskettes or so and a thousand different files and try to remember what CRUNCH CRCHO means. Calling the file Crunch_Crumble_ and_Chomp would be so much easier, and you still have the three-character extender left over.

I will not go into detail as to how the program works but I think you will be happy with the results.

Also included with this article is a program that will automatically convert your directory to the modified version, provided you have copied the files to a diskette that was formatted using the modified DOS.

0000        45          .PAGE
            50 ;COPYRIGHT 1982 W. NEWELL
            60 ;NEWELL INDUSTRIES
0000        0100        *=   $4000     ;ORG AND RUN ADDRESS
4000 A91A   0110        LDA  #$1A      ;FROM THIS LINE TO
4002 8D3B09 0120        STA  $093B     ;LINE 1170 MODIFIES
4005 8DA522 0130        STA  $22A5     ;THE DOS AND DUP
4008 8D3624 0140        STA  $2436     ;SYSTEMS
400B A918   0150        LDA  #$1B
400D 8D7309 0160        STA  $0973
4010 8D1E0C 0170        STA  $0C1E
4013 8DB50E 0180        STA  $0EB5
4016 8D6D0F 0190        STA  $0F6D
4019 8DEF30 0200        STA  $30EF
401C 8D0924 0210        STA  $2409
401F A921   0220        LDA  #$21
4021 8DCE0D 0230        STA  $0DCE
4024 8D660E 0240        STA  $0E66
4027 A960   0250        LDA  #$60
4029 8D2D0F 0260        STA  $0F2D
402C A920   0270        LDA  #$20
402E 8D390F 0280        STA  $0F39
4031 8D900B 0290        STA  $0B90
4034 A9A0   0300        LDA  #$A0
4036 8D8E0B 0310        STA  $0B8E
4039 8D9B0B 0320        STA  $0B9B
403C A906   0330        LDA  #$06
403E 8DBF0B 0340        STA  $0B8F
4041 A99D   0350        LDA  #$9D
4043 BD910B 0360        STA  $0B91
4046 A90B   0370        LDA  #$0B
4048 8D920B 0380        STA  $0B92
404B A9EA   0390        LDA  #$EA
404D 8D930D 0400        STA  $0B93
4050 A904   0410        LDA  #04
4052 8D9C0B 0420        STA  $0B9C
4055 A9A9   0430        LDA  #$A9
4057 8D9D0B 0440        STA  $0B9D
405A A900   0450        LDA  #$00
405C 8D9E0D 0460        STA  $0B9E
405F A907   0470        LDA  #$07
4061 8D9C12 0480        STA  $129C
4064 A930   0490        LDA  #$30
4066 8DE00E 0500        STA  $0EEA
4069 A97A   0510        LDA  #$7A
406B 8DEE0E 0520        STA  $0EEE
406E A91D   0530        LDA  #$1D
4070 8D430E 0540        STA  $0E43
4073 8DAF22 0550        STA  $22AF
4076 8D5324 0560        STA  $2453
4079 A918   0570        LDA  #$18
407B 8DDF0E 0580        STA  $0EDF
407E 8D0B0F 0590        STA  $0F0B
4081 8D9B22 0600        STA  $229B
4084 8DDB30 0610        STA  $30DB
4087 A91C   0620        LDA  #$1C
4089 8D110F 0630        STA  $0F11
408C A924   0640        LDA  #$24
408E 8DC223 0650        STA  $23C2
4091 A92E   0660        LDA  #$2E
4093 8DF824 0670        STA  $24FB
4096 A923,  0680        LDA  #$23
4096 8DFA24 0690        STA  $24FA
409B A90 1  0700        LDA  #$01
409D 8DCC23 0710        STA  $23CC
40A0 BDD923 0720        STA  $23D9
40A3 8D2A24 0730        STA  $242A
40A6 8D4724 0740        STA  $2447
40A9 8D3A24 0750        STA  $243A
40AC A925   0760        LDA  #$25
40AE 8DD123 0770        STA  $23D1
40B1 8DDA23 0780        STA  $23DA
40B4 8D0A24 0790        STA  $240A
40B7 8D2b24 0800        STA  $242B
40BA 8D4824 0810        STA  $2448
40BD 8D3B24 0820        STA  $243B
40C0 A943   0830        LDA  #$43
40C2 8D4423 0840        STA  $2344
40C5 A94F   0850        LDA  #$4F
40C7 8D4523 0860        STA  $2345
40CA A950   0870        LDA  #$50
40CC 8D4623 0880        STA  $2346
40CF A959   0890        LDA  #$59
40D1 8D4723 0900        STA  $2347
40D4 A949   0910        LDA  #$49
40D6 8D4823 0920        STA  $2348
40D9 A94E   0930        LDA  #$4E
40DD 8D4923 0940        STA  $2349
40DE 8D4D23 0950        STA  $234D
40E1 A947   0960        LDA  #$47
40E2 8D4A23 0970        STA  $234A
40E6 A92D   0980        LDA  #$2D
40E8 8D4B23 0990        STA  $234B
40EB A944   1000        LDA  #$44
40ED 8D4C23 1010        STA  $234C
40F0 8D5C24 1020        STA  $245C
40F3 A93A   1030        LDA  #$3A
40F5 8D4E23 1040        STA  $234E
40F8 A94D   1050        LDA  #$4D
40FA 8D2324 1060        STA  $2423
40FD 8DC524 1070        STA  $24C5
4100 8DD224 1080        STA  $24D2
4103 A94C   1090        LDA  #$4C
4105 8D3124 1100        STA  $2431
4108 8D4324 1110        STA  $2443
410B 8D4E24 1120        STA  $244E
410E 8D5924 1130        STA  $2459
4111 8D6A24 1140        STA  $246A
4114 8D8624 1150        STA  $2486
4117 8DD524 1160        STA  $24D5
411A 8DC52D 1170        STA  $2DC5
411D A9EA   1180        LDA  #$EA      ;THIS SECTION
411F 8DBA0D 1190        STA  $0DBA     ;MODIFIES THE VTOC
4122 8D8B0D 1200        STA  $0D8B     ;FOR 60 FILENAMES
4125 A90E   1210        LDA  #$0E
4127 8D9B0D 1220        STA  $0D9B
412A A90F   1230        LDA  #$0F
412C 8D400F 1240        STA  $0F40
412F A98C   1250        LDA  #$BC
4131 8D620D 1260        STA  $0D62
4134 A000   1270        LDY  #0
4136 B97641 1280 LOOP1  LDA  MOD,Y     ;CHANGES DUP.SYS
4139 993218 1290        STA  $1832,Y    ;TO dup.SYS
413C CE3    1300        INY
413D C007   1310        CPY  #7
413F D0F5   1320        BNE  LOOP1
4141 A000   1365        LDY  #0
4143 B95141 1370 LOOP2  LDA  MESG,Y    ;NEW MENU TITLE
4146 99101F 1380        STA  $1F10,Y
4149 C8     1390        INY
414A C025   1400        CPY  #37
414C D0F5   1410        BNE  LOOP2
414E 4C0030 1415        JMP  $3000       ;BACK TO DOS
4151 44     1420 MESG   .BYTE "DOS 2.0S MOD. DIRECTORY W.NEWELL 6/82"
4152 4F
4153 53
4154 20
4155 32
4156 2E
4157 30
4158 53
4159 20
415A 4D
415D 4F
415C 44
415D 2E
415E 20
415F 44
4160 49
4161 52
4162 45
4163 43
4164 54
4165 4F
4166 52
4167 59
4168 20
4169 57
416A 2E
416B 4E
416C 45
416D 57
416E 45
416F 4C
4170 4C
4171 20
4172 36
4173 2F
4174 38
4175 32
4176 64     1430 MOD    .BYTE "dup.SYS"
4177 75
4178 70
4179 2E
417A 53
417B 59
417C 53

Listing: EXTDIR.SRC Download / View