Trailing-Edge
-
PDP-10 Archives
-
decuslib10-07
-
43,50433/paslnk.mac
There are 4 other files named paslnk.mac in the archive. Click here to see a list.
TITLE PASLNK - MODULE TO RETURN STUFF FROM SCAN TO PASREL
TWOSEG
;edit history
;2 - modify pushf so caller can detect problems in openning file
;3 - add clribf for clrbfi after error
search uuosym,pasunv
lookl==6 ;length of lookup block made by passcn
openl==3 ;length of open block
pathl==9 ;length of path block made by passcn
infil==2 ;ac containing file block for input
outfil==3 ; " output
relfil==4 ; " rel file
file==5 ; " current file block
data==6 ; " current data block from passcn (lookl+openl+pathl)
p==17
t==1
reloc 0
oldf: block filcmp+1
oldfen=.-1
RELOC 400000
ENTRY PASPRM
entry clribf,curnam
ENTRY PASXIT
entry pushf
entry popf
extern resetf,clofil,oldbfh
pasprm: movem relfil,relfcb## ;store for restart
move file,infil ;convert input file spec
movei data,inblk##
pushj p,pascnv
move file,outfil
movei data,outblk##
pushj p,pascnv
move file,relfil
movei data,relblk##
pushj p,pascnv
movei t,relnam## ;beginning of parameter block to return
movem t,1(p) ;place PASCAL expects returned thing
popj p,
pascnv: push p,b
move b,file
pushj p,initb.## ;init the file control block
pop p,b
move t,lookl+1(data) ;device name
movem t,fildev(file)
move t,.rbnam(data) ;file name
movem t,filnam(file)
move t,.rbext(data) ;extension
movem t,filext(file)
move t,.rbprv(data) ;protection
movem t,filpro(file)
skipn t,.rbppn(data) ;any PPN?
jrst noppn ;no
tlnn t,777777 ;pointer to path?
jrst path ;yes
movem t,filppn(file) ;regular PPN
setzm filppn+1(file) ;so zero path
popj p,
noppn: setzm filppn(file) ;default PPN
popj p,
path: hrli t,lookl+openl+2(data) ;beginning of path
hrri t,filppn(file) ;place it goes
blt t,filppn+5(file)
popj p,
clribf: clrbfi
popj p,
pasxit: movei reg,input##
setz reg1,
pushj p,clofil
movei reg,output##
setz reg1,
pushj p,clofil
move reg,relfcb
setz reg1,
pushj p,clofil
jrst calscn##
pushf: hrl t,reg
hrri t,oldf
blt t,oldfen
pushj p,init.b## ;renew the FCB
setz a, ;this is a text file
seto reg3, ;[2] don't do get, so we can check errors
setz reg4, ;[2]
movei reg5,40000 ;see eoln char's
movei reg6,4000 ;don't do error recovery
pushj p,resetf
popj p,
popf: push p,reg
push p,reg1
setz reg1, ;normal close
pushj p,clofil
pop p,reg1
pop p,reg
hrli t,oldf
hrr t,reg
blt t,filcmp(reg)
popj p,
;CURNAM
;b - fcb
;c - addr of string
;d - length
;On Tops-20, we put the filspec into the string. But on Tops-10 it
;turns out to be easier just to dump the appropriate fields of the
;fcb in binary.
curnam: push c,fildev(b)
push c,filnam(b)
push c,filext(b)
push c,filpro(b)
push c,filppn(b)
push c,filppn+1(b)
push c,filppn+2(b)
push c,filppn+3(b)
push c,filppn+4(b)
push c,filppn+5(b)
popj p,
end