FILE COMMANDS

THE EXPERIENCED PROGRAMMER MAY READ AND WRITE PS/8 COMPATIBLE DATA FILES WITH MANY DEVICES. PS/8 FOCAL ASSUMES .FC AND .FD AS NAME EXTENSIONS FOR PROGRAM AND DATA FILES RESPECTIVELY. DATA FILES ARE SAVED IN STANDARD PS/8 ASCII FORMAT AND ARE EDIT AND TECO-8 COMPATIBLE. THE TERMINAL (TTY:) IS PS/8 FOCAL'S NORMAL INPUT AND OUTPUT DEVICE. THE 'OPEN INPUT' COMMAND PERMITS SELECTING ANOTHER DEVICE FOR INPUT 'OPEN OUTPUT' DOES THE SAME FOR OUTPUT. BE SURE TO CLOSE ONE OUTPUT FILE BEFORE OPENING ANOTHER. ',ECHO' ADDED TO THE INPUT COMMANDS ECHOES THE INPUT DATA ON THE OUTPUT DEVICE. WHEN ADDED TO OUTPUT COMMANDS, IT CAUSES THE OUTPUT TO BE ECHOED ON THE TERMINAL. 'OUTPUT CLOSE' EMPTIES THE OUTPUT BUFFER ONTO THE DEVICE AND SAVES THE FILE IF THE DEVICE IS FILE STRUCTURED (DISK OR MAGNETIC TAPE). THE 'OPEN INPUT TTY:,ECHO' COMMAND WILL RESTORE THE TERMINAL AS THE INPUT DEVICE WITH ECHO. AFTER AN ERROR OCCURS OR 'CTRL/P' IS STRUCK, THE TERMINAL IS RESTORED AS BOTH INPUT AND OUTPUT DEVICE. READING AND WRITING CAN BE RESUMED WITH PREVIOUSLY OPENED NON-TTY: DEVICES THROUGH 'OPEN RESTORE INPUT' AND 'OPEN RESTORE OUTPUT' COMMANDS. NOTE: WHEN WRITING FOCAL DATA FILES, IT IS NECESSARY TO INCLUDE A SPACE, COMMA, CARRIAGE RETURN OR OTHER DELIMITER PRECEDING ANY MINUS SIGNS, OTHERWISE THE NUMBER WILL APPEAR POSITIVE WHEN 'ASKED'. A PRECEDING SPACE WILL BE AUTOMATICALLY 'TYPED' IF THE INITIAL DIALOGUE RECEIVES AN ANSWER OF 'YES' OR '4,5'. *** PS/8 DEVICE NAMES: SYS: SYSTEM DEVICE (DSK: IN DISK SYSTEM; DTA0: IN DECTAPE SYSTEM) DSK: THE DISK IN DISK SYSTEMS; DECTAPE #1 IN DECTAPE SYSTEMS ('DSK:' IS ASSUMED IF A DEVICE IS NOT SPECIFIED) DTA0: - DTA7: DECTAPE DRIVES LTA0: - LTA7: LINCTAPE DRIVES MTA0: - MTA7: MAGTAPE DRIVES PTR: HIGH SPEED READER PTP: HIGH SPEED PUNCH LPT: LINE PRINTER TTY: TERMINAL (MAY BE USED WITH OTHER DEVICES THROUGH 'ECHO') OPEN INPUT BLEEP (SWITCHES INPUT TO 'BLEEP.FD' FILE ON DSK:) O I DTA4:RED (OPENS 'RED.FD' FILE ON DECTAPE DRIVE #4) O I TABLE,ECHO (WILL ECHO ON OUTPUT DEVICE WHILE READING 'TABLE.FD' FROM THE DSK:) OPEN INPUT TTY:,ECHO (RESTORES TERMINAL TO NORMAL FUNCTION) O I TTY:,E (ABBREVIATION) * * * CTRL/Z IS THE END-OF-DATA-FILE CHARACTER. ATTEMPTS TO READ PAST IT WILL OUTPUT A '?' AND SWITCH INPUT TO THE TERMINAL. * * * *OPEN INPUT [DEVICE:][FILE NAME][,ECHO] (PREPARES TO READ A FILE) OPEN OUTPUT DK (OPENS 'DK.FD' TO BE WRITTEN ON THE DSK:) O O DTA7: ZZ (OPENS 'ZZ.FD' FILE TO BE WRITTEN ON DECTAPE) O O DOPE,ECHO (ECHOES ON TTY: WHILE WRITING 'DOPE.FD' ON DSK:) (BE SURE TO GIVE AN 'OUTPUT CLOSE' WHEN DONE) * * * OPEN OUTPUT FILES WILL BE CLOSED IF THE COMMANDS 'LIBRARY SAVE' OR 'LIBRARY DELETE' ARE GIVEN OR IF 'LIBRARY GOSUB' IS GIVEN BY A VERSION OF A PROGRAM THAT HAS NOT BEEN SAVED. * * * * * * FAILURE TO INSERT A SPACE BETWEEN NEGATIVE NUMBERS 'TYPED' TO A FILE WILL RESULT IN THEIR BEING READ AS POSITIVE. FEATURES '4,5' OR 'YES' OF THE INITIAL DIALOGUE PROVIDE AUTOMATIC SPACING. * * * *OPEN OUTPUT [DEVICE:][FILE NAME][,ECHO] (PREPARES TO WRITE A FILE) OPEN RESTORE INPUT (RESUMES 'ASKING' FOR DATA FROM A PREVIOUSLY OPENED INPUT FILE AFTER USING TTY: INPUT WITH AN 'OPEN INPUT TTY:,ECHO') O R I (ABBREVIATION) O R I,E (SAME PLUS ECHO) *OPEN RESTORE INPUT[,ECHO] (RESUMES INPUT FROM NON-TTY:) OPEN RESTORE OUTPUT (RESUMES 'TYPING' ON PREVIOUSLY OPENED OUTPUT DEVICE AFTER USING TTY:) O R O (ABBREVIATION) O R O,ECHO (SAME PLUS ECHO) *OPEN RESTORE OUTPUT[,ECHO] (RESUMES OUTPUT TO NON-TTY:) *OUTPUT CLOSE (ENDS FILE WRITING AND SAVES OUTPUT FILE IF DEVICE IS FILE STRUCTURED (DISK OR MAGNETIC TAPE).) A FILE HANDLING PROGRAM: 12.10 C-SETUP OUTPUT FILE (.FD IS ASSUMED EXTENSION, DSK: THE DEVICE) 12.15 TYPE "LINE 12.20 WILL NOW OPEN 'NUMBRZ' FILE AND WRITE IN IT"! 12.20 OPEN OUTPUT NUMBRZ 12.45 FOR I=1,10;TYPE %3,I,! 12.50 COMMENT-NOW SAVE OUTPUT FILE AND RESTORE OUTPUT TO TTY: 12.60 OUTPUT CLOSE 12.70 TYPE "LINE 12.60 JUST CLOSED THE 'NUMBRZ' FILE"! 13.10 TYPE "LINE 13.20 WILL NOW OPEN THE 'NUMBRZ' INPUT FILE"! 13.20 OPEN INPUT NUMBRZ 13.30 TYPE "LINE 13.50 WILL NOW READ IN NUMBERS AND COMPUTE ROOTS"! 13.50 FOR I=1,10;ASK A;TYPE !"ROOT",%2,A," IS ",%5.04,FSQT(A) 13.60 TYPE !!"LINE 13.70 RESTORES INPUT TO TERMINAL"! 13.70 OPEN INPUT TTY:,ECHO 13.80 TYPE "LINE 13.90 WILL NOW DELETE 'NUMBRZ.FD' FROM THE DIRECTORY"!! 13.90 LIBRARY DELETE NUMBRZ.FD SIMULATED EXECUTION OF THE PROGRAM: LINE 12.20 WILL NOW OPEN 'NUMBRZ' FILE AND WRITE IN IT LINE 12.60 JUST CLOSED THE 'NUMBRZ' FILE LINE 13.20 WILL NOW OPEN THE 'NUMBRZ' INPUT FILE LINE 13.50 WILL NOW READ IN NUMBERS AND COMPUTE ROOTS ROOT 1 IS 1.0000 ROOT 2 IS 1.4142 ROOT 3 IS 1.7321 ROOT 4 IS 2.0000 ROOT 5 IS 2.2361 ROOT 6 IS 2.4495 ROOT 7 IS 2.6458 ROOT 8 IS 2.8284 ROOT 9 IS 3.0000 ROOT 10 IS 3.1623 LINE 13.70 RESTORES INPUT TO TERMINAL LINE 13.90 WILL NOW DELETE 'NUMBRZ.FD' FROM THE DIRECTORY



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search

Mirror site if this site is slow highgate.comm.sfu.ca