The following description is based on an article by Pete Goffinet published in the PPC Computer Journal (V3N1, January/February 1984). The article is included below, since it contains important information on entering the programs.
If you have enough memory to hold the contents of the entire diskette, then use the Huge Buffer version of RDISK. Otherwise use the Small Buffer version. Both perform exactly the same function, but the former version is much quieter (far fewer clicking noises from the diskette drive).
The programs assume that you have the floppy in drive ":D701" (second drive in a typical configuration).
The data is sent to the PC via the serial interface which is assumed to be at interface number 10 (see line 100).
If you are using the Huge Buffer version, you can remove the source floppy after the program displays the message "Finished reading".
Note: The HP-86/7 programs are as simple as I can make them because the task is CPU bound (amazing!). If you have any ideas on speeding things up, please send them to me. (They are so slow, they are driving me mad!).
On the PC side you can use the following C program to convert the data to a binary floppy image file:
#include <stdio.h> main() { int i; while (scanf("%d", &i) != EOF) putchar(i); }
100 PRINTER IS 10 110 CLEAR 120 DIM SECTOR$(1)[256] 130 M$=":D701" 140 I=1 150 DISP "Reading disk" 160 FOR SECT_S=0 TO 1055 170 RSECTOR SECTOR$(I),SECT_S,M$ 180 FOR J=1 TO 256 190 PRINT NUM (SECTOR$(1)[J]);" "; 200 IF (J MOD 8) = 0 THEN PRINT 210 NEXT J 220 IF SECT_S MOD 100=0 THEN DISP SECT_S 230 NEXT SECT_S 240 DISP "Done ..." 250 END
100 PRINTER IS 10 110 CLEAR 120 DIM SECTOR$(1055)[256] 130 M$=":D701" 140 DISP "Reading disk" 150 I=0 160 FOR SECT_S=0 TO 1055 170 RSECTOR SECTOR$(I),SECT_S,M$ 180 I=I+1 190 IF I MOD 100=0 THEN DISP I 200 NEXT SECT_S 210 DISP "Finished reading" 230 FOR I=0 TO 1055 240 FOR J=1 TO 256 250 PRINT NUM (SECTOR$(I)[J]); 260 IF J MOD 8=0 THEN PRINT 270 NEXT J 280 IF I MOD 100=0 THEN DISP I 290 NEXT I 300 DISP "Done ..." 310 END
By Pete Goffinet (10223), PPC Computer Journal, V3N1 (January/February 1984).
The binary program "r" supplied with the HP-86/87 DEMO disc contains two BASIC statements RSECTOR and WSECTOR used by the BASIC program " backup" respectively to read and write to disc sectors directly. Syntax for the two statements is as follows:
RSECTOR string, sector number, msus WSECTOR string, sector number, msus
String is a dimensioned string variable exactly 256 characters long to or from which the sector is written, sector number is the number of the disc sector of interest, and msus is a string defining the mass storage unit, for example ":D700".
Unfortunately these potentially valuable statements cannot be used directly in a BASIC program apparently because their parse routines are incomplete; in fact, the program lines in " backup" which reference them cannot be re-entered after listing by keying END LINE. To complete the litany of difficulties the program " backup" is secured. Obviously HP has, for perhaps good reasons, elected to discourage use of these statements.
However, for the adventurous, there is a way. First, unsecure the file " backup". The security code is CHR$(2)&CHR$(6) and the type is 0. Next make single line programs from the applicable lines in " backup" by deleting all but the appropriate line and storing it as a basic program file.
8900 RSECTOR SECTOR$(I),SECT_S,M$ 13500 WSECTOR SECTOR$(I),SECT_S,M$
I used RSECTOR and WSECTOR as the program filenames.
To use the statements, load the binary "r" and write an appropriate BASIC program using the same variable names as in the stored program lines, dimensioning the element lengths of SECTOR$ to 256, and assigning values to SECT_S and M$ for reading and to all three variables for writing. Place a comment line where RSECTOR or WSECTOR is to be used, and finally merge the applicable single line program at the line number of that comment.
For example, the following sequence of operations could be used to prepare a single program line for RSECTOR with .DEMO in drive 0 and a storage disc in drive 1.
UNSECURE " backup.DEMO",CHR$(2)&CHR$(6),0 LOAD " backup.DEMO" (note leading space) DELETE 1,8899 DELETE 8901,99999 STORE "RSECTOR:D701"
The first 20 sectors of the DEMO disc could then be displayed in ASCII format as follows:
SCRATCH LOADBIN "r.DEMO"
Enter BASIC program:
10 CLEAR 20 DIM SECTOR$(1)[256] 30 M$=":D701" 40 I=1 50 FOR SECT_S=0 TO 19 60 ! RSECTOR SECTOR$(I),SECT_S,M$ 70 DISP "SECTOR";SECT_S 80 DISP SECTOR$(1) 90 NEXT SECT_S 100 END MERGE "RSECTOR:D701",60,1 RUN
Similar operations can be used for writing to sectors, and additional programming can be written to convert the ASCII output to a string of octal or decimal numbers.