Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - lnkov2.c08
There is 1 other file named lnkov2.c08 in the archive. Click here to see a list.
 REP 2/1	;08C1
	SUBTTL	D.M.NIXON/DMN/JLd/RKH/JNG/MCHC/DZN/PY/PAH	2-Jun-83
 WIT
	SUBTTL	D.M.NIXON/DMN/JLd/RKH/JNG/MCHC/DZN/PY/PAH	8-Nov-83
 REP 36/1	;08C2
	DECEVR==2042		;DEC EDIT VERSION
 WIT
	DECEVR==2053		;DEC EDIT VERSION
 INS 63/2	;08C3
	;2053	Process deferred character fixups.
 REP 14/6	;08C4
		PUSHJ	P,RDCST		;READ IN BLOCK CONTAINING CONTROL SEC.
 WIT
	;**;[2053] Replace after OVR3A+4 Lines	PY	8-Nov-83
		PUSHJ	P,INPH		;[2053] READ IN PREAMBLE
		SKIPE	P1,ARGFXP	;[2053] ANY CHARACTER FIXUPS?
		 PUSHJ	P,FIXARG	;[2053] YES, DO ANY FOR THIS OVERLAY
		PUSHJ	P,RDCST0	;[2053] READ IN BLOCK CONTAINING CONTROL SEC.
 REP 2/30	;08C5
		HRRZ	R1,PH+PH.OVL	;[1400] BLOCK# OF CODE SECTION
 WIT
	;**;[2053] Replace after RDCST		PY	8-Nov-83
	RDCST0:	HRRZ	R1,PH+PH.OVL	;[2053] BLOCK# OF CODE SECTION
 INS 34/32	;08C6
	;**;[2053] Insert after RDREL1+5 Lines		PY	8-Nov-83
	;[2053] Here to do the deferred character fixups.
	;[2053] P1 contains the pointer to the first character fixup block.
	;[2053] Each character fixup requires two addresses. To minimize
	;[2053] disk I/O, there are two buffers kept. The block number of
	;[2053] the argument descriptor is in R1, and the block of the
	;[2053] character string descriptor is in R2, unless they are the
	;[2053] same block. The character fixup blocks are built at COEOVL
	;[2053] in LNKOV1.

	FIXARG:	HLRZ	T1,TPCAD(P1)	;[2053] Get the overlay number
		CAME	T1,LNKNO.	;[2053] Fixups for this overlay?
		 POPJ	P,		;[2053] No
		SETZB	R1,R2		;[2053] Remember no blocks read yet
	FXARG1:	HRRZ	T1,TPCAD(P1)	;[2053] Get the address
		PUSHJ	P,FIXAD1	;[2053] Get it into memory
		MOVE	P2,T1		;[2053] Keep it safe
		HRRZ	T1,(T1)		;[2053] Get the address of the
					;[2053] string descriptor
		PUSHJ	P,FIXAD2	;[2053] Get it into memory
		HRRZ	T1,(T1)		;[2053] Get the start address of the string
		HRLI	T1,(<Z 17,>+1B0);[2053] Make it an ascii descriptor
		MOVEM	T1,(P2)		;[2053] Put it back in memory
		MOVE	T1,P1		;[2053] Get the address of this block
		MOVEI	T2,TPCBK	;[2053] And the size
		HRRZ	P1,TPCLK(P1)	;[2053] Get the next block
		PUSHJ	P,DY.RET##	;[2053] Return this block
		JUMPE	P1,FXARG2	;[2053] Check for no more blocks
		HLRZ	T1,TPCAD(P1)	;[2053] Get the overlay number
		CAMN	T1,LNKNO.	;[2053] For this overlay?
		 JRST	FXARG1		;[2053] Yes, do another
	FXARG2:	MOVEM	P1,ARGFXP	;[2053] Put the chain back
		USETO	OC,(R1)		;[2053] Set to output last block
		MOVE	T1,LC.LB	;[2053] Get the location in memory
		SUBI	T1,1		;[2053] As an IOWD
		HRLI	T1,-.DBS	;[2053] One block
		SETZ	T2,		;[2053] Terminate the IO list
		OUT	OC,T1		;[2053] Write it
		POPJ	P,		;[2053] OK, Return
		PUSHJ	P,E$$OOV##	;[2053] Error

	;[2053] FIXAD1 brings a location in the overlay into a read/write
	;[2053] block of memory. If the block contains another page of the
	;[2053] overlay file, it writes the block back into the file first.
	;[2053] Accepts an address in T1. Returns with updated address
	;[2053] in T1.

	FIXAD1:	HRRZ	T3,PH+PH.OVL	;[2053] Block number of code section
		SUB	T1,PH+PH.ADD	;[2053] Minus base
		PUSH	P,T1		;[2053] Save the offset
		ROT	T1,-.DBS2W	;[2053] Convert into blocks
		ADDI	T3,(T1)		;[2053] Point to block desired code
		JUMPE	R1,FXAD1A	;[2053] Always read if nothing in yet
		CAIN	R1,(T3)		;[2053] Is it already in memory?
		 JRST FXAD1B		;[2053] Yes, don't read it again
		USETO	OC,(R1)		;[2053] Set on it
		MOVE	T1,LC.LB	;[2053] Get the location in memory
		SUBI	T1,1		;[2053] As an IOWD
		HRLI	T1,-.DBS	;[2053] One block
		SETZ	T2,		;[2053] Terminate the IO list
		OUT	OC,T1		;[2053] Write it
		  CAIA			;[2053] Okay
		PUSHJ	P,E$$OOV##	;[2053] Error
	FXAD1A:	HRRZ	R1,T3		;[2053] Remember the new block
		USETI	OC,(R1)		;[2053] Set on it
		MOVE	T1,LC.LB	;[2053] Get the location in memory
		SUBI	T1,1		;[2053] As an IOWD
		HRLI	T1,-.DBS	;[2053] One block
		SETZ	T2,		;[2053] Terminate the IO list
		IN	OC,T1		;[2053] Read it
		 CAIA			;[2053] Okay
		PUSHJ	P,E$$IOV##	;[2053] Error
	FXAD1B:	POP	P,T1		;[2053] Get back the offset
		ANDI	T1,.DBM		;[2053] Get the offset within the block
		ADD	T1,LC.LB	;[2053] The block is in the LC area
		POPJ	P,		;[2053] Done

	;[2053] FIXAD2 brings a location in the overlay into memory.
	;[2053] If the desired location is already in the read/write 
	;[2053] block, it uses that, otherwise it reads it into a
	;[2053] read only block if it is not there yet. Accepts an
	;[2053] address in T1. Returns with updated address in T1.

	FIXAD2:	HRRZ	T3,PH+PH.OVL	;[2053] Block number of code section
		SUB	T1,PH+PH.ADD	;[2053] Minus base
		PUSH	P,T1		;[2053] Save the offset
		ROT	T1,-.DBS2W	;[2053] Convert into blocks
		ADDI	T3,(T1)		;[2053] Point to block desired code
		CAIN	R1,(T3)		;[2053] Is it already in memory?
		 JRST	FXAD1B		;[2053] Yes, in the read/write block
		JUMPE	R2,FXAD2A	;[2053] Always read if nothing in yet
		CAIN	R2,(T3)		;[2053] Is it already in memory?
		 JRST FXAD2B		;[2053] Yes, don't read it again
	FXAD2A:	MOVE	R2,T3		;[2053] Remember the new block
		USETI	OC,(R2)		;[2053] Set on it
		MOVE	T1,LC.LB	;[2053] Get the location in memory
		ADDI	T1,.DBS-1	;[2053] Second block of LC, as an IOWD
		HRLI	T1,-.DBS	;[2053] One block
		SETZ	T2,		;[2053] Terminate the IO list
		IN	OC,T1		;[2053] Read it
		 CAIA			;[2053] Okay
		PUSHJ	P,E$$IOV##	;[2053] Error
	FXAD2B:	POP	P,T1		;[2053] Get back the offset
		ANDI	T1,.DBM		;[2053] Get the offset within the block
		ADD	T1,LC.LB	;[2053] The block is in the LC area
		ADDI	T1,.DBS		;[2053] In the second block
		POPJ	P,		;[2053] Done

 SUM 202686