/ takes the width of a string in r3
/ returns a pointer to a file structure in r0
/ there should be a string on the stack
/ of length the contents of r3 on top of
/ a pointer to the file variable
/ a new file structure is allocated if needed
/ temporary names are generated, and given
/ names are blank trimmed
/ if a new file buffer is allocated, the address
/ is stored throught the file variable pointer
/ dont have a file struct
mov $fchain-FCHAIN,-(sp) / get head of file chain
mov fchain,r1 / contents of head of file chain
bne 2f / end of the chain?
mov (sp)+,r1 / get last chain entry
mov r0,FCHAIN(r1) / and stuff the current file in
clr FCHAIN(r0) / last entry
cmp FLEV(r1),2(sp) / are we past it yet?
mov r1,(sp) / advance the chain
mov (sp)+,r1 / address of last entry
mov r0,FCHAIN(r1) / stuff in the current entry
/ close the associated file
bgt 3f / from name from prog hedr
bic $![TEMP+FTEXT],FUNIT(r1)
clr (r0)+ / clear the getc/putc buffer
/ get the filename to the
/ buffer (not necess. easy)
/ free previous file name