Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-01 - decus/20-0002/sailpd.fai
There is 1 other file named sailpd.fai in the archive. Click here to see a list.
COMMENT    VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	SAILPD -- a FAIL macro to define SAIL procedure descriptors
C00005 ENDMK
C;

;SAILPD -- a FAIL macro to define SAIL procedure descriptors
;	(BAIL needs a procedure descriptor in order to call anything)
;
;Arguments are
;	NAME	must be defined as entry address, also used as name of proc
;	PROCTYP	type of procedure
;	PPARMS	number of parameters passed on P ('17) stack
;	SPPARM	number of parameters passed on SP ('16) stack
;		(same as number of VALUE STRINGs)
;	ARGTYPS	list of argument types
;
;For a procedure corresponding to the SAIL declaration
;	INTEGER PROCEDURE MYPROC
;	    (REFERENCE INTEGER I; STRING S; INTEGER J; INTEGER K[13])
;an acceptable macro call is
;	SAILPD	(MYPROC,INTEGR,3,1,<REFERENCE+INTEGR,STRING,INTEGR,
;			INTEGR+DEFAULT+[=13]>)
;

DEFINE SAILPD (NAME,PROCTYP,PPARMS,SPPARM,ARGTYPS) <
	BEGIN
	XPUNGE		;NO SYMBOLS FROM THIS BLOCK IN .REL FILE
%PDLNK __ 6		;PROCEDURE DESCRIPTOR LOADER LINK

DEFAUL __ 1=35
REFERE __ 1=34
QUES   __ 1=33
BIND   __ 1=32
PROCED __ 1=31
ITEM   __ 1=30
LEAPAR __ 1=29		;LEAP ARRAY, FOR  ARRAY ITEMVAR ARRAY

NOTYPE __ 1=23
STRING __ 3=23
REAL   __ 4=23
INTEGR __ 5=23		;INTEGER IS FAIL RESERVED WORD
SSET   __ 6=23		;SET IS FAIL RESERVED WORD
LIST   __ 7=23
CONTEX __ 13=23
RECPTR __ 15=23	;RECORD!POINTER
ITEMVA __ 20=23

ARRAY  __ 24=23


	0		;LOADER CHAIN
	LINK %PDLNK,.-1
	NAME		;ENTRY ADDRESS

	FOR @$ ZOT E <NAME><1+>0	;LENGTH
	POINT	7,[ASCII/NAME/],-1

	PROCTYP
	2*SPPARM,,1+PPARMS
	0		;STACK DISPLACEMENTS
	0		;LOCAL VARIABLE INFO
	.+4		;PTR TO PARAM INFO
	.-10,,0		;PDA,,0
	NAME,,0		;PCNT AT MKSEMT,,PARENT'S PDA
	NAME,,0		;PCNT AT PRDEC,,JRST EXIT

FOR ZOT IN (ARGTYP)<
	ZOT>		;PARAMETER TYPES

	BEND>

;TITLE TEST
;MYPROC:0
;	SAILPD	(MYPROC,INTEGR,3,1,<REFERENCE+INTEGR,STRING,INTEGR,
;			INTEGR+DEFAULT+[=13]>)
;END