File 2DILFIL

Directory of image this file is from
This file as a plain text file

*20
//2DILFIL
/2 DIAL FILE HANDLER
/MANUSCRIPT TO BE APPENDED TO
/USER PROGRAMS WHEN NEEDED.
	 
/CALL: JMP FILGET  ASKS  NAME,UNIT
/FOR THE TWO DIAL FILES TO BE MODIFIED.
/IF FILENAME DO NOT ALREADY EXIST, DILMAK
/IS AUTOMATICALLY CALLED UP.
	 
/CALL: PICK  ALLOWS ONE TO MODIFY THE
/TWO FILES BY READ OR WRITE.
/       AC = ITEM NUMBER
/      .+1 = FILE NUMBER (0 OR 1)
/      .+2 = READ(0) OR WRITE(1)
/USES DF6, QN4 & 5.
/MUST STUFF FOLLOWING LOCATIONS WHICH IS
/USUALLY DUN BY FILGET:
/   BLK0: 4000+F0START BN
/   BLK1: 4000+F1START BN
/ FILLS0: UNIT OF F0
/ FILLS1: UNIT OF F1
	 
/CALL: JMP CLOSE  CLOSES THE TWO FILES.
	 
/CALL: JMP DILMAK  MAKES A FILE OF SPECIFIED
/LENGTH ON SPECIFIED UNIT. (NAME,UNIT)
	 
	 
/SUBROUTINE FILGET.
FILGET,	LDA
	0
	STC FILGX
	 
/SETUP DIAL TAPE HANDLER BUFFER.
	SET I 16
	FILLS0-1
	SET I 17
	-20
	STA I 16	/CLR
	XSK I 17
	JMP .-2
	COM		/7777
	STA
	CB0
	STC CB1
	LDA I
	6000
	STC CB0+3
	LDA I
	6400
	STC CB1+3
	 
/ASK FOR NAMES.
FILG0,	LIF 4
	INTRAC
	FCJ1
	FM1		/FILE0:
	 
FILG1,	LIF 4
	INTRAC
	FCJ2
	FM2		/FILE1:
	 
FCJ1,	FT1
	FJ1
FCJ2,	FT1
	FJ2
	 
FT1,	0
	 
FJ1,	JMP FILG0	/CR
	JMP FNAM0	/NUM
	 
FJ2,	JMP FILG1       /CR
	JMP FNAM1	/NUM
	 
FM1,	TEXT .FILE0,U:.
FM2,	TEXT .FILE1,U:.
	 
	 
/FILE NAME 0 HANDLER.
FNAM0,	SET I 17
	4\NAM0-1
	JMP GFNAM	/SETUP FIND
	JMP FIND0	/SETUP PICK
	 
/FILE NAME 1 HANDLER.
FNAM1,	SET I 17
	4\NAM1-1
	JMP GFNAM	/SETUP FIND
	JMP FIND1	/SETUP PICK
	 
	 
/MOVE NAME FROM INBUF TO FIND CALL ALSO SET UP
/UNIT NUMBER.
	 
GFNAM,	SET 16
	0
	LDA I
	1
	STC UNUM
	LDF 4
	SET I 15
	4\INBUF-1
	SET I 14
	-10
	 
GFN1,	LDH I 15
	SHD I
	4500
	JMP SPIN
	SHD I
	5600
	JMP SPIN
	SHD I
	5400
	JMP SPIN
	XSK 14
	SKP
	JMP GFN1
	STH I 17
	XSK I 14
	NOP
	JMP GFN1
	 
	EJECT
SPIN,	LDA I
	77
	XSK 14
	SKP
	JMP SPN2
	STH I 17
	XSK I 14
	NOP
	JMP SPIN
	 
SPN1,	LDH I 15
SPN2,	LDH 15
	SHD I
	4500
	JMP ESP
	SHD I
	5600
	JMP SPN3
	SHD I
	5400
	JMP SPN3
	JMP SPN1
	 
SPN3,	LDH I 15
	BCL I
	7770
	STC UNUM
	 
ESP,	LDA I
UNUM,	0
	STA I 17
	JMP 16
	 
	 
/GET STARTING BN & SETUP PICK FOR FILE 0.
FIND0,	LIF 4
	FIND
NAM0,	0
	0
	0
	0
UN0,	0
	JMP NOF0
	BSE I
	4000
	STC BLK0
	ADD UN0
	STC FILLS0
	JMP FILG1
NOF0,	LIF 4
	MESOUT
	NSF
	JMP DILMAK
	JMP FILG0
	 
NSF,	TEXT .NO SUCH FILE.
	4543
	 
	 
/GET STARTING BN & SETUP PICK FOR FILE 1.
FIND1,	LIF 4
	FIND
NAM1,	0
	0
	0
	0
UN1,	0
	JMP NOF1
	BSE I
	5000
	STC BLK1
	ADD UN1
	STC FILLS1
FILGX,	JMP
	 
NOF1,	LIF 4
	MESOUT
	NSF
	JMP DILMAK
	JMP FILG1
/END FILGET.
	 
	 
/SUBROUTINE PICK.
	 
	PICK=JMP .
	 
	SET 17
	0
	LDF 5
	STC ITEM
	STORE
	KNUM
	SFLOAT
	ITEM
	STORE
	FITEM
	FDIV
	BLKCT
	FIX
	FAC
	ISTOR1
	NBLK
	SFLOAT
	NBLK
	FMUL
	BLKCT
	FCOMP
	FADD
	FITEM
	FMUL
	THRE
	FIX
	FAC
	ISTOR1
	FLOC
	LDA 17
	ROL 3
	ADA I
	FILLS0
	STC CF
	LDA I 17
	ROL 1
	ADA I
	JMP GDSP
	STC DSP
	XSK I 17
	SET I 16
CF,	0
	LDA I
NBLK,	0
	XSK I 16
	STA I 16	/NBLK
	LDA I
FLOC,	0
	XSK I 16
	XSK I 16
	STA I 16	/CURLOC
	 
DSP,	JMP
GDSP,	JMP DOR		/READ DATA
	JMP 17
	JMP DOW		/WRITE DATA
	JMP 17
	 
FILLS0,	0		/UNIT F0
BLK0,	0		/START BLOCK
	0		/NEW BLK
CB0,	7777		/CURBLK
	0		/WRITE FLAG
	0		/CURLOC
	6000		/BUFFER LOC
	0		/UNUSED NOW
FILLS1,	0
BLK1,	0
	0
CB1,	7777
	0
	0
	6400
	0
M1,	7776
THRE,	2
	3000
	0
BLKCT,	7
	2520
	0
FITEM,	0
	0
	0
ITEM,	0
	EJECT
	 
/READ DATA HANDLER
DOR,	SET 15
	0
	LDF 6
	JMP SETUN	/SET UP UNIT
	LDA 16		/NBLK
	SAE I 16	/CURBLK
	JMP .+3
	XSK I 16
	SKP
	JMP RUN		/READ BLOCK IN
	LDA I 16	/CURLOC
	ADA I 16	/BUFLOC
	STC 13		/POINTS TO DATA
/GET DATA
	LDA 13
	APO
	ADD M1
	STC KNUM
	LDA I 13
	STC KNUM+1
	LDA I 13
	STC KNUM+2
/KNUM TO FAC
	LOAD
	KNUM
	JMP 15
	 
/WRITE DATA HANDLER
DOW,	SET 15
	0
	LDF 6
	JMP SETUN
	LDA 16		/NBLK
	SAE I 16	/CURBLK
	JMP .+3
	XSK I 16
	SKP
	JMP RUN		/READ BLOCK IN
	LDA I 16	/CURLOC
	ADA I 16	/BUFLOC
	STC 13		/POINTS TO DATA
/POINT 16 AT WRITE FLAG
	SET 16
	CF
	LDA I 16	/START BLK
	ADA I 16	/NBLK
	XSK I 16
	STA I 16	/WRITE FLAG
/STORE DATA
	LDA
	KNUM
	APO
	ADD PP1
	STA 13
	LDA
	KNUM+1
	STA I 13
	LDA
	KNUM+2
	STA I 13
	JMP 15
	 
	 
KNUM,	0
	0
	0
	 
/TAPE READER
RUN,	STA 16		/CURBLK
	LDA
	0
	STC RUX
	LDA I 16
	AZE
	JMP WUN		/WRITE FLAG UP
	CLR
	STA 16		/CLEAR WRITE FLAG
	 
RR,	RDC
RB,	0
RUX,	JMP
/
WUN,	STC WB
	ADD RR
	BSE I
	4
	STC .+1
	WRC
WB,	0
	JMP 0
	 
/UNIT SETUP
SETUN,	SET 16
	CF
	LDA
	0
	STC SETUX
	LDA 16
	ROR I 1
	AXO
	ROL I 4
	BCL I
	7767
	BSE I
	RDC
	STC RR
	LDA I 16
	ADA I 16
	STC RB
SETUX,	JMP
	 
/CLOSE BOTH FILES
CLOSE,	LDA
	0
	STC CLOX
	PICK
	0
	0
	LDA I
	200
	PICK
	0
	0
	CLR
	PICK
	1
	0
	LDA I
	200
	PICK
PP1,	1
	0
CLOX,	JMP
/END PICK.
	 
	 
/SUBROUTINE MAKDIL.
DILMAK,	LDA
	0
	STC DILMKX
	 
FD3,	LIF 4
	INTRACT
	FCJ3
	FM3		/NUM LOCKS
	 
FD4,	LIF 4
	INTRACT
	FCJ4
	FM4		/NAME,U:
	 
FCJ3,	FT1
	FJ3
FCJ4,	FT1
	FJ4
	 
FJ3,	JMP FD3		/CR
	JMP .+1		/NUM
	STC BN
	JMP FD4
	 
FJ4,	JMP FD4		/CR
	JMP .+1		/NUM
	SET I 17
	4\NAM-1
	JMP GFNAM	/GET NAM+UNUM
	LIF 4
	MAKDIL
NAM,	00
	00
	00
	00
NUMU,	0
BN,     0
	JMP BADFIL	/NO ROOM
	STA I
BNSTRT,	0
DILMKX,	0		/LEAVE
	 
BADFIL,	LIF 4
	MESOUT
	FM5
	JMP FD3
	 
/MESSAGES.
FM3,	TEXT .MAKE DIAL FILE.
	4543
	TEXT .LENGTH (BLKS):.
FM4,	TEXT .NAME,U: .
FM5,	TEXT .TAPE FULL .
	4543
/END DILMAK.
	 
//END 2DILFIL.
/OCT 73
/NDC, FHD.



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