Google
 

Trailing-Edge - PDP-10 Archives - AP-D480B-SB_1978 - foropn.mac
There are 27 other files named foropn.mac in the archive. Click here to see a list.
	TITLE FOROPN %5A(703) ROUTINES TO SIMULATE F40 SUBROUTINE CALLS
	SUBTTL	D. TODD /DRT/JNG/CLRH/SWG/SJW	13-SEP-77



;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.

;COPYRIGHT (C) 1972,1977 BY DIGITAL EQUIPMENT CORPORATION

	SEARCH FORPRM		;GET THE GLOBAL SYMBOLS

;	ENTRY IFILE,OFILE,EOF1,EOFC,DEFINE,BUFFER,IBUFF,OBUFF,MAGDEN,RELEAS
	MLON
	SALL
	SUBTTL	REVISION HISTORY


;504	18010	CORRECT SAVE ROUTINE TO SAVE T5 ALSO.
;556	20228	FIX ILL MEM REFS IN F10 CALLS TO BUFFER, ETC.

;****	BEGIN VERSION 5A	*****

;644	-----	FIX ERRF40 MACRO TO WORK WHEN F40 LIB SWITCH OFF
;703	22687	PUT BUFFER, IBUFF, OBUFF, EOF1, EOFC AND MAGDEN UNDER
;		  IFN F40LIB
;********** END OF REVISION HISTORY ***********************************

	DEFINE	ERRF40(C)	<
	SALL
	SIXBIT	/C/
	ENTRY	C
C:
;**;	[644]	INSERT @ C:	SWG	3-MAR-77
IFN F40LIB,<			;[644] MAKE THIS LOOK LIKE HELLO MACRO
	CAIA			;[644] BUT CANNOT USE HELLO BECAUSE
	PUSH	P,CEXIT.##	;[644] BECAUSE OF MOVEI
>				;[644]
	MOVEI	T1,.-3
	>
	SUBTTL COMMON STORAGE AND TABLES
UNSAVE:	MOVSI	T5,SAVAC	;GET A RESTORE BLT POINTER
	BLT	T5,T5		;RESTORE THE AC'S
	POP	P,L		;RESTORE AC L
	GOODBY			;RETURN TO THE USER
SAVE:	EXCH	L,(P)		;SAVE THE LINK POINTER
	PUSH	P,L		;SAVE THE SAVE CALL RETURN ADDRESS
;**;[504] Replace @ SAVE+2L	JNG	23-Nov-75
	MOVEI	L,SAVAC		;[504] GET A BLT POINTER TO SAVE AREA
	BLT	L,SAVAC+T5	;[504] SAVE THE AC'S
	MOVE	L,-1(P)		;RESTORE THE LINK REGISTER
	MOVE	T0,@(L)		;GET THE UNIT NUMBER
	HRRZM	T0,ARGBLK	;SAVE AS FIRST IN THE ARGBLK
IFN F40LIB,<
	TLNE	L,-1		;F10 CALL
	JRST	SAVE1		;NO F40 CALL
>
	HLL	L,-1(L)		;YES, GET THE ARG BLOCK SIZE
	POPJ	P,		;RETURN
IFN F40LIB,<
SAVE1:
	MOVEI	T1,(L)		;F40 SIMULATE THE F10 ARG COUNT
SAVE3:	MOVE	T0,(T1)		;GET THE INSTRUCTION
	TLC	T0,(<CAI>)	;CHECK FOR A CAI INSTRUNCTION
	TLNN	T0,777000	;CAI INSTRUCTION
	JRST	SAVE4		;YES, NO TYPE CONVERSION
	TLC	T0,(<JUMP>-<CAI>)	;JUMP INSTUCTION
	TLNE	T0,777000	;CHECK THE OP CODE
	JRST	SAVE2		;NO, END OF ARGUMENT LIST
	LDB	T2,[POINT 3,(T1),12];GET THE OLD TYPE CODE
	MOVS	T2,TYPBOX(T2)	;GET A CAI TYPE CODE,..
	DPB	T2,[POINT 13,(T1),12];STORE OPCODE AND TYPE
SAVE4:	SUBI	T1,-1		;INCREMEMT THE ADDRESS AND COUNT NEG IF THE LEFT HALF
	JRST	SAVE3		;CONTINUE
SAVE2:	HLL	L,T1		;SET UP THE AOB IN THE L REG
	POPJ	P,		;RETURN

TYPBOX:					;TYPE CONVERSION TABLE
	<CAI	TP%INT,0>_-5	;0;INTEGER
	<CAI	0,0>_-5		;1;
	<CAI	TP%REA,0>_-5	;2;REAL
	<CAI	TP%LOG,0>_-5	;3;LOGICAL
	<CAI	TP%OCT,0>_-5	;4;OCTAL
	<CAI	TP%LIT,0>_-5	;5;LITERAL
	<CAI	TP%DOR,0>_-5	;6;DOUBLE PRECISION REAL
	<CAI	TP%COM,0>_-5	;7;COMPLEX
>


ARGBLK:	BLOCK	^D20		;ARGBLK STORAGE
SAVAC:	BLOCK	6	;SAVE ARE FOR ACS 0-6
	SUBTTL THE FOLLOWING ROUTINE ARE PASSED ON TO FOROTS
	HELLO	(RELEAS)
	PUSHJ	P,SAVE		;SAVE THE WORDKING AC'S
	MOVSI	T1,1000
	HRLM	T1,ARGBLK
	MOVEI	L,ARGBLK	;GET THE ARGBLOK POINTER
	PUSHJ	P,RELEA.##	;RELEASE THE DEVICE
	JRST	UNSAVE		;RESTORE THE AC'S CONTINUE

	HELLO	(IFILE)
	PUSHJ	P,SAVE	;SAVE THE AC'S
	MOVE	T1,[XWD 2000!TP%LIT_5,[ASCIZ/SEQIN/]]
	JRST	OFILE1	;COMMON EXIT
	HELLO	(OFILE)
	PUSHJ	P,SAVE		;SAVE THE AC'S
	MOVE	T1,[XWD 2000!TP%LIT_5,[ASCIZ/SEQOUT/]]
OFILE1:	MOVEM	T1,ARGBLK+1
	MOVE	T1,1(L)		;GET THE FILE NAME POINTER
	TLZ	T1,777000	;CLEAR THE OP CODE
	TLO	T1,6000		;SET THE FILE NAME POINTER
	MOVEM	T1,ARGBLK+2		;STORE IN THE ARGGBLK
	MOVSI	T1,3000			;SET THE ARGBLK COUNT
	IORM	T1,ARGBLK		;STORE IN THE ARGBLK
	JRST	OPENGO			;OPEN THE FILE
	SUBTTL ROUTINE THAT ARE NOT IMPLEMENTED IN FOROTS 
	HELLO	(DEFINE)
	PUSHJ	P,SAVE		;SAVE THE ACS
	MOVEI	T3,3		;SET THE MIN ARG COUNT
	MOVE	T1,[XWD 2000!TP%LIT_5,[ASCIZ /RANDOM/]]
	MOVEM	T1,ARGBLK+1	;SAVE IN ARGBLK
	AOBJP	L,DEFGO		;EXIT IF END OF ARG LIST
	MOVE	T1,(L)		;GET THE RECORD SIZE
	TLZ	T1,777000	;CLEAR THE OP CODE
	TLO	T1,14000	;SET THE RECORD SIZE PARAMETER
	MOVEM	T1,ARGBLK+2	;SAVE IN ARGBLK
	AOBJP	L,DEFGO		;EXIT IF END OF ARG LIST
	MOVE	T1,(L)		;GET THE ASSOCIATE VARIABLE ADDRESS
	ADDI	T3,1		;COUNT IT
	TLZ	T1,777000	;CLEAR THE OP CODE
	TLO	T1,22000	;SET THE ASSOCIATE VARIABLE PARAMETER
	MOVEM	T1,ARGBLK+3	;SAVE IN THE ARGBLK
	AOBJP	L,DEFGO		;EXIT IF END OF ARG LIST
	MOVE	T1,(L)		;GET THE FILE NAME ARGUMENT
	ADDI	T3,1		;COUNT IT
	TLZ	T1,777000	;CLEAR THE OP CODE
	TLO	T1,6000		;SET THE FILE NAME POINTER
	MOVEM	T1,ARGBLK+4	;SAVE IN THE ARGBLK
	AOBJP	L,DEFGO		;EXIT IF END OF ARG LIST
	ADDI	T3,1		;COUNT IT
	HRLZ	T1,@(L)		;GET THE PROJECT NUMBER
	AOBJP	L,DEFGO		;EXIT IF END OF ARG LIST
	HRR	T1,@(L)		;GET THE PROGRAMMER NUMBER
	MOVEM	T1,ARGBLK+^D18	;STORE IN A TEMP
	SETZM	ARGBLK+^D19	;SET A TERM.
	MOVE	T1,[XWD 10000,ARGBLK+^D18]	;GET A DIRECTORY POINTE
	MOVEM	T1,ARGBLK+5	;STORE IN THE ARGBLK
DEFGO:	LSH	T3,9	;POSITION THE ARG COUNT
	HRLM	T3,ARGBLK	;STORE IN THE ARGBLK
OPENGO:	MOVEI	L,ARGBLK
	PUSHJ	P,OPEN.##
	JRST	UNSAVE

;**; [556] CHANGE @ OPENGO + 3L	CLRH	22-JUN-76
;**; [703] @ OPENGO + 3  SJW  13-SEP-77
IFN F40LIB,<
	ERRF40	(BUFFER)		;[556]
	JRST	BAD
	ERRF40	(IBUFF)			;[556]
	JRST	BAD
	ERRF40	(OBUFF)			;[556]
	JRST	BAD
	ERRF40	(EOF1)			;[556]
	JRST	BAD
	ERRF40	(EOFC)			;[556]
	JRST	BAD
	ERRF40	(MAGDEN)		;[556]
;	JRST	BAD
BAD:	OUTSTR	[ASCIZ /
%0 THE FOLLOWING ROUTINE IS NOT IMPLEMENTED IN FOROTS: /]
;**; [556] CHANGE @ BAD + 3L	CLRH	22-JUN-76
	MOVE	T1,0(T1)	;[556] GET THE SIXBIT NAME
	SETZ	T0,
	LSHC	T0,6		;GET A SIXBIT CHARACTER
	ADDI	T0," "		;CONVERT TO ASCII
	OUTCHR	T0		;OUTPUT IT
	JUMPN	T1,.-4		;CONTINUE
	OUTSTR	[ASCIZ/
/]
	GOODBY
>				;[703] END OF IFN F40LIB
	END