>>>>>>>>>>>>>>>>>>>>> CP/M-Net News <<<<<<<<<<<<<<<<<<<<<<<< ============================================================ Number 6 June, 1981 Volume 1, Issue 6 ============================================================ In This Issue ============= DU - THE Universal Disk Utility by: Eddie Currie Communications Standards and Protocols: Let's Get Together! by: Wally A. Linstruth, WA6JPR DDT WITH B: !!! by: Michael J. Karas Running Submit Files from Disks other than A: by: Leor Zolman A Simple Program to Calculate Modem Transfer Time by: Kelly Smith, CP/M-Net "SYSOP" CP/M-Net "Tip-of-the-Month" Patch to CP/M 2.x to Display User Number in Drive Prompt by: Bruce Kendall and Bruce Ratoff (additional comments by: Kelly Smith) Printed monthly (at worst quarterly) to inform user's of RCPM Systems to the latest software news, information, and updates of public domain software accessible via telephone/modem transfer. Yearly subscription for copies of the CP/M-Net News may be obtained by mailing $18.00 (check or money orders only) to Kelly Smith, CP/M-Net, 3055 Waco Street, Simi Valley, California 93063. CP/M-Net is a non- profit orginization and all money received on subscriptions are utilized for the sustaining and enhancments of the CP/M- Net System. If you would like to contribute an article, include a column containing your area of interest and expertise, or participate in an open forum for conversation and transfer of ideas, feel free to send it to the CP/M-Net System and indicate that you would like it to be included in the CP/M- Net News...if possible, use WordStar (trademark, MicroPro International) or Electric Pencil (trademark, Micheal Shrayer) in 60 column format. NOTE: CP/M is a registerd trademark of Digital Research ============================================================ On the Stack ============ Many thanks to the following supporting subscribers to the CP/M-Net News: Stanley B. Fowler, Envirotech Corporation, El Monte, CA. Paul Kelley, Waban, Mass. Walter A. Linstruth - WA6JPR, Redondo Beach, CA. Albert L. Ponaman, World Wide Search, Inc., Canoga Park, CA. Dick Rice, American Management Consultants, N.Hollywood, CA. Joseph C. Sharp, Micro Science Assoc., San Luis Obispo, CA. Sandy's Shoppe, El Segundo, CA. Donald s. Tork, Thousand Oaks, CA. Note: Back issues for the CP/M-Net News Letter are available for two dollars each. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ DU - THE Universal Disk Utility =============================== by: Eddie Currie Ward Christensen has done it again ... with the advent of DU , his universal disk utility, an extremely powerful disk maintenance and repair facility is provided to the CP/M user. Version 7.5 is menu driven and Any valid command string may be placed as an operand of the original DU command, e.g. A>DU G0;D;G2;=OK<1A>;D Functions supported: Tnn Seek to track nn (no read) Snn Position to sector nn, and read Gnn Position to group nn and read. G Shows current position V Views the current sector. (assumes ASCII data) Vnn Views nn sectors Fname print directory for file "name", then positions to it's directory sector. (Won't position under CP/M 2.x, but see = command below.) =string Ascii search, starting at current sector. hex may be imbedded, or used alone: To find "IN 0FEH": = Ignores bit 7 unless is used. L Re-logs in the current disk. You may pull out a disk, put in a new, and "L" just to log it in. Lx Logs in disk 'x', such as: LB Ux Logs user 'x' for next F command. Gives '?' error if not CP/M version 2.x. D Dump sector, hex + ASCII A Dump sector, ASCII only H Dump sector, hex only Note that all dump commands (D, A, H) may be optionally followed by a starting and ending address: D0,7F is the same as just D D3,5 A20,3F CHaddr,val,val,val... change hex in sector CAaddr,char string... change ASCII in sector NOTE that may be hex imbedded in the Ascii: ca0,OK<1a> ----> Use W to write changes to disk. Note that the C command echoes the overlaid data for verification. CHaddr-addr,byte or CAaddr-addr,byte repeats a change + advance 1 sector (if below track 2, this advances to next numerical, if 2 or >, advances based on CP/M's normal sector scrambling algorithm, i.e. so + will get the next logical sector of the file - backs up 1 logical sector Note + and - may take an amount: for example, +F steps in 15 sectors. Note also that "-" issued at the first logical sector of the disk will wrap back to the last. Further, "+" issued at the last sector will wrap forward to the first. ? Gives command summary # Prints the disk parameters M Dumps a map of the group allocations for files. Mn Shows which file is allocated to group "n". N Resets CP/M via the BDOS. This may make it possible under some implementations of CP/M to change the disk format (e.g., density, sides, etc) R Reads the sector currently positioned to into memory. Note R (Read) is implicit in the G, +, and - commands, but N-O-T in the S and T commands (I did it because I was tired of disk reading after T command before I had a chance to issue the S command) W Write back the current sector (N-O-T-E may not be used after an F command, as CP/M was used to find the file in the directory X Exit back to CP/M (Must press return). Ctl-c was too easy to hit over modem lines, so I decided on 2-byte (X, CR) to exit. P Toggle printer switch on/off Z Sleep - causes the program to pause, such as to look at a dump. Z is 1 sec. Znn is nn tenths of a second on a 2 MHz 8080. < Saves current sector in a save buffer > Gets saved buffer. < and > may be used to move a sector to another place. / Repeats entire command. Defaults or /nn to "forever". NN may be 2 to 65535. Multiple commands are separated by ";" when given on the same command line, for example, the following commands will erase the b disk directory to all E5's: lb log in b drive g0 position to dir. ch0-7f,e5 fill with e5 < save the sector >;w;+;/16 restore, write, next, repeat 16 ----This could be shortened to: lb;g0;ch0-7f,e5;< >;w;+;/16 The menu is displayed as 24 lines (or other suitable number of lines of text as determined by the associated equate in the source) and the next page is displayed following the typing of any key on the terminal. It is important to understand the format of a CP/M directory entry as provided by DU when using either the "F" (find file) command,or "D" (dump) of the directory sectors, which are located in groups 0 and 1 on a single density disk. Sample result of "FSID.COM" command: 40 00534944 20202020 20434F4D 0000003A *.SID COM...:* 50 33343536 3738393A 00000000 00000000 *3456789:........* First line - 40 00534944 20202020 20434F4D 0000003A *.SID COM...:* || ||| | || || | | || ||^----hex file name-----^ || || ^file name^ || || || || in ASCII || || extent-^^ || || || || || || file size in sectors-^^ || || || ^^-00 = file active || E5 = file erased ^^-displacement of line in directory sector Second line - 50 33343536 3738393A 00000000 00000000 *3456789:........* | | | | ^---allocation group numbers-------^ A trivial example of how to read a given sector is given by: :T0;S1 Track zero , sector one please. T=0, S=1, PS=1 T=0, S=1, PS=1 :R Read the sucker ... :D Now let me read will ya ??? 00 3100D0F3 AFD308DB 08E608C2 07003E04 *1.Ps/S.[.f.B..>.* 10 D309C320 00DB08E6 02C21500 3E02D309 *S.C .[.f.B..>.S.* 20 DB08E640 C2150001 00012180 CECD5000 *[.f@B.....!.NMP.* 30 DB08E602 C230003E 01D30901 01012180 *[.f.B0.>.S....!.* 40 DECD5000 3A59EBE6 10CA00E6 FBC300E6 *^MP.:Ykf.J.f{C.f* 50 C5E57CFE D0DA6700 3AFF003E FFBCDA67 *Ee|.PZg.:..>. use logged drive to find file 005CH = 01H --> use drive A: to find file 005CH = 02H --> use drive B: to find file 005CH = 03H --> use drive C: to find file 005CH = 04H --> use drive D: to find file etc., etc., .... etc. A few months later Kelly Smith, publisher of the CP/M Net News, Simi Valley, CA, placed a similar item in a CP/M tip of the month column so that more people could gain the knowledge of how to use DDT more efficiently. Since that time I have seen published documentation of the same idea in several other computer club newsletters and even Doctor Dobbs Journal. I don't know how many people have really discovered the use of the "poke a number into 05CH" idea but I have gradually decided that it was somewhat of a pain to do it all the time. Therefore I decided to fix DDT in a way that makes drive referencing possible in a direct manner with CP/M style syntax. The intended goal was to get two things out of the effort: (1) Make DDT easier to use, and (2) Put a new CP/M tip into the public domain for all you computer people to chew on for a awhile!! The following parts of this article describe a procedure to patch DDT Version 1.4 to permit use of the CP/M DDT "I" command in any of the following typical formats: A> A>DDT DDT VERS 1.4 -IPROG.HEX <== Reference file "PROG.HEX" on default drive A: or, -IB:PROG2.ASC <== Reference file "PROG2.ASC" on file B: etc., etc. One may ask why DDT was not written to be used in the above manner in the first place when it only takes 37 more bytes to make it work. Well, Digital Research has already made their buck on the copy that you bought, so if you think you would like "B:" in the "I" command, then you will have to follow the following implementation procedure. Note that this patch has not been tried with CP/M DDT version 2.2 so its not known if the following patch instructions will work for versions other than 1.4. To implement the patch the first thing to do is to edit the following short program into a file called "DDTPATCH.ASM". You may use any editor as long as you carefully keep all those funny little numbers in the equates "EXACTLY" the same. The program should then be assembled into a ".HEX" file using an assembler. ; ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ; PATCH TO GIVE "I" COMMAND DRIVE SELECT CAPABILITY IN DDT ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ; ; PATCH FOR DDT VERSION 1.4 ; TPA EQU 00100H ;START OF TRANSIENT PROGRAM AREA ; PATCH EQU 00904H ;LOCATION OF INTERNAL DDT PATCH ;(IN ABSOLUTE DDT IMAGE) ; FETCHR EQU 00BD7H ;LOCATION FOR FETCH CHARACTER ROUTINE ;(IN ABSOLUTE DDT IMAGE) ; ENDCHK EQU 0091CH ;LOCATION IN DDT TO ENTER "I" CMD LOOP ;(IN ABSOLUTE DDT IMAGE) ; ENDDDT EQU 00FD0H ;END LOCATION OF DDT 1.4 ;(IN ABSOLUTE DDT IMAGE) ; FCB EQU 0005CH ;LOCATION OF DEFAULT FCB ; ORG TPA+1 ;FIX OLD DDT MODULE SIZE ; DW 0FB6H+063 ;NEW MODULE SIZE WITH END PATCH ; ORG PATCH+200H ;OFFSET ASSEMBLY FOR INTERNAL PATCH ; JMP COLNCK-200H;JUMP TO PROCESS COLON CHECK ; DRDONE: XRA A STA FCB+020H ;CLEAR FCB RECORD COUNT ; ;CODE TO BE PATCHED IN AT END OF DDT IMAGE. THIS ROUTINE CHECKS ;FOR A ":" AS THE SECOND CHARACTER IN THE "I" COMMAND STRING. ;IF PRESENT THE LOWER FOUR BITS OF FIRST CHARACTER ARE USED AS ;A DRIVE SELECT DESIGNATOR. ; ORG ENDDDT+0200H ; COLNCK: CALL FETCHR ;GET FIRST CMMAND CHARACTER MOV B,A ;SAVE FIRST IN (B) CALL FETCHR ;GET SECOND CHARACTER CPI ':' ;CHECK IF SECOND IS COLON JZ SETDRV-0200H ;IF SO THEN GO SETUP DRIVE SELECT LXI H,FCB+1 ;SET PARAMETERS FOR NORMAL MOV M,B ;PUT FIRST CHARACTER INTO FCB INX H MVI C,08H ;SET OTHER PARAMETERS FOR NORMAL MOV B,A ;SAVE SECOND CHAR AWHILE XRA A ;CLEAR TO DEFAULT DRIVE STA FCB MOV A,B ;GET SECOND CHARACTER BACK AGAIN JMP ENDCHK ;GO BACK INTO NORMAL DDT "I" LOOP ; SETDRV: MOV A,B ;USE FIRST CHARACTER AS DRIVE ANI 0FH ;LOWER FOUR BITS ONLY STA FCB ;SET SELECTED DRIVE NUMBER JMP DRDONE-0200H ;BACK TO BEGIN NORMAT "I" COMMAND ; END ; Once you have made the ".HEX" file, then put a copy of it on a CP/M system disk along with your copy of DDT version 1.4. Boot up the system disk on drive A: and carefully follow the installation procedure below. If you are not currently familiar with the operation of DDT now would be a good time to get the manual out and read it. We will be using DDT to make the patched copy of itself. The sequence below must be followed exactly in order. The notation below indicates that you should type carriage return. The part of the text that the system types versus what you type will become obvious as you fire up DDT to do the patch process. A> A>DDT <== Invoke DDT DDT VERS 1.4 -IDDT.COM <== Read in copy of DDT.COM -R NEXT PC 1400 0100 -S12D6 <== Change bit map for patch 12D6 90 92 12D7 04 . -S13B0 <== Add new bytes to bit map 13B0 00 22 13B1 00 10 13B2 00 00 13B3 00 10 13B4 00 08 13B5 00 . -M11B6,1400,1A00 <== Move bit map out of way -IDDTPATCH.HEX -R <== Overlay DDT.COM with patch NEXT PC 1400 0000 -M1A00,2000,11F5 <== Move bit map into place -^C <== Exit DDT to system with ctl-C A>SAVE 19 DDTP.COM <== Save patched DDT.COM A> You now have a copy of DDT that is patched to permit the use of drive designators in the DDT "I" command. For the patch to work a colon must be entered as the second character of the file name field of the normal "I" command syntax. The drive designatior can be most any ASCII character except "." or "cr". The patch simply strips out the lower four bits of your entered ASCII character to use as the drive code in FCB location 05CH. This permits any of 16 drives to be selected. If the colon does not appear as the second input character then the "I" command works just like it always used to. Have fun !!!! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Running Submit Files from Disks other than A: ============================================= by: Leor Zolman For a long time, I have been frustrated by "accidentally" submitting a submit file while being logged in to a disk other than A:, and having a magical "$$$.SUB" appear instead of having my submit file processed. Having gotten my hard disk up, and being forced to leave my system on floppies and use the hard disk as C: and D:, I found myself really missing the ability to do submits... As a first solution to the problem, I tried going to A: and writing a submit file that started with C:, just to see if it would take it. Yes! It did let me log in to C: as the first thing in a submit file, but I still had to go to A: to submit it. Could there possibly be a way to do a submit on C: without ever leaving C: ? --- YES !! --- If you DDT or SID SUBMIT.COM, you'll notice that the FCB area for the temporary file that SUBMIT.COM creates ($$$.SUB) has its first byte set to 00. That means that the $$$.SUB file will always be written to the currently logged disk, EVEN THOUGH IT HAS NO MEANING UNLESS IT IS WRITTEN TO A: (smart move, Digital Research...another of many!). SOOOO...my simple solution was to change that 00 leading byte of the FCB to 01. This causes $$$.SUB to always be written to A:, no matter which disk the submit is submitted from. Now I can be on C: and do a submit as easily as if I were on A:. I hope this helps some of you out there who've been frustrated by the same problem. Incidentally, the location to patch in the 2.2 SUBMIT.COM program is: 05BB hex (change from 00h to 01h). ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ A Simple Program to Calculate Modem Transfer Time ================================================= by: Kelly Smith, CP/M-Net "SYSOP" Here's a simple program to determine the transfer time in minutes, to or from a RCPM system. Very handy in determining the charges from Ma' Bell (or whatever telephone system you use) when transferring some really huge files... 10 REM File Transfer Rate Program for RCPM's, by Kelly Smith 20 REM 30 REM This program may be used by a RCPM user to determine 40 REM the total time in minutes to transfer files to or from 50 REM a RCPM system. Time is rounded down to the nearest 60 REM minute, but detailed information may be obtained by 70 REM removing the 'REM's in the following code. This program 80 REM is compatible with Microsoft BASIC, and will compile to 90 REM a 11 kilobyte (Gag!) file utilizing BASCOM. 100 REM 110 PRINT:INPUT "What is the Baud Rate (60 to 1200)";B 120 IF B<>60 AND B<>110 AND B<>300 AND B<>450 THEN GOTO 140 130 GOTO 180 140 IF B<>600 AND B<>710 AND B<>1200 THEN GOTO 160 150 GOTO 180 160 PRINT:PRINT"+++ Invalid Baud Rate +++":PRINT 170 PRINT"Must be 60, 110, 300, 450, 600, 710, or 1200 Baud!":GOTO 110 180 INPUT "What is the File Size in kilobytes";S 190 IF S<1 THEN GOTO 180 200 S=S*1024:T=S/(B/10):TM=T/60 210 REM PRINT:PRINT"Total number of characters in this file is";S 220 REM PRINT"This file will take";T;"seconds" 230 REM PRINT"Which equals";TM;"minutes" 240 PRINT:PRINT"Transfer time will be approximately"; 250 T=INT(TM):IF T>1 THEN PRINT T "minutes" ELSE PRINT" 1 minute"" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CP/M-Net "Tip-of-the-Month" =========================== Patch to CP/M 2.x to Display User Number in Drive Prompt ======================================================== by: Bruce Kendall and Bruce Ratoff (additional comments by: Kelly Smith) Are you annoyed with CP/M 2.x's USER command, that there is no way of indicating which USER area you are currently in? This patch solves this problem by displaying the USER number in hex ( a single character since user number 0 - 15 are valid) between the drive name letter and the '>'. That is, a user logged into user area number 4 would see the standard CP/M prompt (modified by this patch) as: A4> ...instead of just A> Enter the following listing with your favorite flavor of editor, assemble, and then 'GEN' a new CP/M system image as you normally would with DDT...for example: A>ddt cpm56.com <--- load system image you made with MOVCPM DDT VER 2.2 <--- DDT announcing itself... NEXT PC 2300 0100 -iboot56.hex <--- your disk boot loader -r900 <--- read it in at 900 hex -ibios56.hex <--- your system BIOS -r5580 <--- offset required for a 56k system -iuser#.hex <--- the USER NUMBER patch -r5580 <--- offset required for a 56k system -g0 <--- exit DDT, and return to CP/M A>sysgen <--- SYSGEN the disk SYSGEN VER 2.0 <--- SYSGEN announcing itself... SOURCE DRIVE NAME (OR RETURN TO SKIP) <--- return DESTINATION DRIVE NAME (OR RETURN TO REBOOT)A <--- A: disk DESTINATION DRIVE NAME (OR RETURN TO REBOOT) <--- reboot A> Now 'cold boot' your system, and you will see the new USER number prompt: A0> Here's the USER NUMBER patch, and be sure and set 'msize' for YOUR CP/M system size and use YOUR offset value when setting this up! msize equ 56 ; CP/M system size in kilobytes ; ; You MUST set this value to your ; CP/M system size delta equ 000h ; offset from standard CP/M size: ; ; This would be set to 400h if ; the 20k CP/M was actually a 19k ; CP/M (when compared to the std ; 20k CP/M described in the CP/M ; manuals from Digital Research). bias equ (msize-20)*1024-delta ; offset from 20k CP/M ccp equ 3400h+bias offset equ 980h-ccp; offset used with DDT in system ; configuration (assumes that the ; 'CCP' occures at 980h in the ; sysgen memory image) cout equ ccp+8ch ; CCP console output routine gtusr equ ccp+113h; CCP get user number routine org ccp+38dh ; call patch ; this was a CALL COUT ; org ccp+15f0h ; patch area at end of BDOS ; patch: call cout ; output character in A to console call gtusr ; get user number adi 90h ; use Intel Hex/ASCII trick daa aci 40h daa jmp cout ; print out and return ; end ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++