Trailing-Edge
-
PDP-10 Archives
-
bb-jr93f-bb
-
7,6/ap017/forio.c17
There are 10 other files named forio.c17 in the archive. Click here to see a list.
REP 3/1 ;17C1
TV FORIO I/O ROUTINES,11(5014)
WIT
TV FORIO I/O ROUTINES,11(5033)
INS 897/2 ;17C2
***** End V11 Development *****
5031 MRB 9-Mar-87
When using random files and the record number is such that
when the page number is calculated (in routine RMAPW) it
exceeds 512*512 pages (the operating system limit), give
an error message.
5033 MRB 18-Mar-87
Correction to edit 5031. When using RMS files WSIZ(D) may
1)not be set-up yet or 2)will be set to the record size.
In either case we will need to calc the number of bytes
in a file page ourselves. (routine RMAPW)
INS 31/47 ;17C3
REP 35/47 ;17C4
SUBI T1,1 ;GET # RECS BEFORE THIS ONE
MOVEM T1,CREC(D) ;STORE PREVIOUS RECORD NUMBER
IMUL T1,T2 ;GET # BYTES BEFORE THIS ONE
MOVEM T1,BYTN(D) ;WHICH IS THE BYTE NUMBER OF REC BEG
POPJ P,
WIT
SUBI T1,1 ;GET # RECS BEFORE THIS ONE
MOVEM T1,CREC(D) ;STORE PREVIOUS RECORD NUMBER
IMUL T1,T2 ;GET # BYTES BEFORE THIS ONE
MOVEM T1,BYTN(D) ;WHICH IS THE BYTE NUMBER OF REC BEG
;
; [5031] Calculate the number of the file page where this record will end.
; Check to see if the it is greater than the max page number (2^18)-1.
;
ADD T2,T1 ;[5031]#Bytes_in_rec + File_byte#
SKIPN T1,BPW(D) ;[5033]Get number of bytes/word
POPJ P, ;[5033]BPW(D) not set-up, Skip this test
LSH T1,^D9 ;[5033]Calc number of bytes/file page
IDIV T2,T1 ;[5033]Calc file page number
MOVE T1,@A.REC ;[5031]Get Rec# (for err message)
CAILE T2,777777 ;[5031]Is this past the max page number?
$ACALL IRN ;[5031]Yes "illegal record number"
POPJ P, ;[5031]No, it's ok!
SUM 97599