Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-07 - 43,50443/xpl.doc
There are 2 other files named xpl.doc in the archive. Click here to see a list.








	XPL. DOC

	DOCUMENTATION FILE FOR XPL ON THE PDP-10.

	R. W. HAY,
	COMPUTER GROUP,
	DEPARTMENT OF ELECTRICAL ENGINEERING,
	UNIVERSITY OF TORONTO,
	TORONTO, ONTARIO, CANADA.
		AND
	DATALINE SYSTEMS LIMITED,
	175 BEDFORD RD.,
	TORONTO, ONTARIO, CANADA.

	VERSION 4.0

	NOVEMBER 20, 1975.

	HISTORY OF XPL ON THE PDP-10
	----------------------------

	THIS COMPILER WAS ORIGINALLY DESIGNED AND IMPLEMENTED ON THE PDP-10
BY R.L. BISBEY, UNIVERSITY OF SOUTHERN CALIFORNIA, IN 1971.  VERSION
1 COULD COMPILE ITSELF, BUT WAS RESTRICTED IN THAT IT HAD NO GENERAL
RUN-TIME PACKAGE (IT JUST SET UP THOSE TEXT FILES NEEDED BY THE
COMPILER ITSELF), NOR WERE THE BUILT-IN PROCEDURES FILE, DATE, TIME,
AND INLINE IMPLEMENTED.

	VERSION 2, DEVELOPED AT DATALINE SYSTEMS LTD., AND THE UNIVERSITY
OF TORONTO, BY R.W. HAY, HAS MUCH MORE EFFICIENT STRING CATENATION
AND NUMBER-TO-STRING CONVERSION ROUTINES, IMPLEMENTED THE BUILT-IN
PROCEDURES FILE, DATE, TIME, AND HAS ADDED FILENAME AND RUNTIME,
HAS A MORE EFFICIENT PROCEDURE CALLING SEQUENCE, AND PRODUCES A MORE
INFORMATIVE PROGRAM LISTING.

	SEVERAL PROBLEMS IN VARIOUS PARTS OF THE COMPILER HAVE BEEN 
FIXED, AND THE COMPILING SPEED (TO PRODUCE THE MACRO FORM) HAS BEEN
IMPROVED BY A FACTOR OF NEARLY 3.  THIS SPEED IMPROVEMENT WAS MAINLY
ACCOMPLISHED BY:
	- USING A HASH-CODING SCHEME FOR SYMBOL TABLE MANIPULATION,
	- GENERATING THE STRING OF CHARACTERS REPRESENTING A NUMBER, IN
	  THE NUMBER-TO-STRING CONVERSION ROUTINE, ADJACENT TO THE LAST
	  STRING IN THE STRING AREA,
	- IN THE CATENATION ROUTINE, CHECKING FOR THE SPECIAL CASES
	  (1) THE STRINGS ARE ALREADY ADJACENT, AND ONLY THE DESCRIPTOR
	      NEEDS CONSTRUCTION,
	  (2) THE "LEFT" STRING IS THE LAST STRING, AND THEREFORE ONLY
	      THE "RIGHT" STRING NEEDS TO BE PHYSICALLY MOVED,
	- SIMPLIFYING THE PROCEDURE CALLING SEQUENCE TO THAT DESCRIB-
	  ED BELOW, FROM ONE WHERE ALL REGISTERS WERE SAVED AT EVERY
	  CALL, AND RESTORED AT EVERY RETURN.

	VERSION 3 PRODUCES RELOCATABLE BINARY OUTPUT (AND, OPTIONALLY
MACRO-10 SOURCE AS WELL), AND COMPILES "COMPACTIFY" FROM A COMMON
LIBRARY SOURCE FILE.  "INLINE" FACILITY IS ALSO IMPLEMENTED.

	VERSION 4 RECOGNIZES THE COMPLETE XPL LANGUAGE, INCLUDING
TYPED PROCEDURES AND FACTORED DECLARATIONS.
	WHEREVER POSSIBLE, THE CHARACTERISTICS OF XPL AS DESCRIBED IN
"A COMPILER GENERATOR" BY MCKEEMAN, HORNING, AND WORTMAN, HAVE BEEN
RETAINED, EVEN AT THE EXPENSE OF PDP-10 EFFICIENCY OR CONVENTION.  FOR
EXAMPLE, THE DEFAULT RADIX FOR BIT STRINGS IS 16, RATHER THAN THE
MORE "NATURAL" 8.

	CAVEATS
	-------

	THE COMPILER IS NOT WARRANTED IN ANY WAY.

	THE EFFECTS OF VARIOUS RUN-TIME ERRORS ARE NOT KNOWN FROM 
TESTING.  THE RUNTIME PACKAGE WILL ABORT WITH A TERSE MESSAGE ON
CONDITIONS SUCH AS "ILLEGAL FILE NUMBER", OR "LOOKUP FAILURE".






	PLANNED IMPROVEMENTS
	--------------------

1. PROVISION OF A CROSS-REFERENCING FACILITY (A LA F40).

	CURRENT STATE OF THE COMPILER AND ITS LANGUAGE
	----------------------------------------------

1. THE COMPILER AND ITS RUNTIME PACKAGE ARE DESIGNED TO OPERATE UNDER
	THE CONTROL OF THE STANDARD DIGITAL EQUIPMENT CORP. PDP-10
	MONITOR.

2. RESTRICTIONS
   ------------
	- COMPILER WILL NOT HANDLE LOWER-CASE CHARACTERS PROPERLY,
	- MAX. NO. OF CASES IN A DO CASE = 175,
	- MAX. NO. OF DECLARED SYMBOLS = 420,
	- MAX. NO. OF MACROS (DECLARE LITERALLY) = 60,
	- MAX. NO. OF STRING DESCRIPTORS = 1000.

3. IMPLEMENTATION CHARACTERISTICS
   ----------------------------------

	- \ REPRESENTS THE "NOT" SYMBOL,
	- ^ REPRESENTS THE "VERTICAL BAR" SYMBOL,
	- _ REPRESENTS THE "UNDERSCORE" SYMBOL,
	- BYTE SIZE IS 9 BITS, 4 BYTES TO THE 36-BIT WORD,
	- BIT (1) TO BIT(9)   MAP TO BYTE
	  BIT (10) TO BIT(36) MAP TO FIXED,
	  BIT(>36) MAPS TO CHARACTER (A STRING OF 9-BIT BYTES),
	- DATE BUILT-IN PROCEDURE RETURNS THE DATE IN PDP-10
	  CONDENSED FORM, RIGHT-JUSTIFIED IN A 36-BIT WORD,
	- TIME BUILT-IN PROCEDURE RETURNS THE TIME OF DAY IN
	  MILLISECONDS SINCE MIDNIGHT,
	- RUNTIME BUILT-IN PROCEDURE RETURNS THE ACCUMULATED CPU TIME
	  FOR THE JOB IN MILLISECONDS,
	- FILE PSEUDO-ARRAY IS DIFFERENT.
		FILE (N)
	  CAUSES 1 36-BIT WORD TO BE RECEIVED FROM (PLACED IN) FILE N.
	  (0<N<16).
	- THE RUNTIME PACKAGE INITIALIZATION SETS UP A FREE STRING AREA
	  OF AT LEAST 12000 BYTES AND A STACK (PUSH-DOWN LIST) OF 1000
	  WORDS. (THIS MAY BE EXCESSIVE, BUT IT WORKS).
	- PROCEDURE CALLS (EXCEPT TO THE RUNTIME PACKAGE) ARE BY
		PUSHJ 15,XXXX
	  RETURNS FROM PROCEDURES ARE BY
		POPJ	15,0

	- XPL PROGRAMS USE REGISTERS 1-11 (DECIMAL) FOR EXPRESSION
	  EVALUATION, ETC.  FUNCTIONS RETURN VALUES IN REGISTER 0.
	  AT PROCEDURE CALLS, BUSY REGISTERS ARE SAVED IN THE STACK,
	  AND ARE RESTORED AFTER THE RETURN. E.G.:
		PUSH	15,1
		PUSH	15,2
		PUSHJ	15,XXX
		POP	15,2
		POP	15,1

	- CALLS TO THE RUN-TIME ROUTINES USE A DIFFERENT SEQUENCE:
		(LOAD	F,FILE #)	(IF SPECIFIED)
		(LOAD	R,DATUM)	(IF REQUIRED)
		CODE	R,0(F)		(CODE IS USER UUO)
		(STORE	R,RESULT)	(IF REQUIRED)

	- THE COMPILED PROGRAM LOADS INTO TWO SEGMENTS:
		LOW SEGMENT CONTAINS ALL DATA AND STRINGS,
		HIGH SEGMENT CONTAINS ALL INSTRUCTIONS.
	  THE PROGRAM MAY BE "SSAVED"" TO OBTAIN SHARABLE HIGH SEGMENTS.
	- INLINE BUILT-IN FUNCTION:
		CALL IS
		  INLINE (OPCODE,AC,INDIRECT,INDEX,LOC);
	  WHERE
		OPCODE, AC, INDIRECT, INDEX MUST ALL BE CONSTANTS,
		AND LOC MAY BE EITHER A CONSTANT OR <VARIABLE>.
	  THE VALUE OF "INLINE" IS RECOGNIZED AS "FIXED"
		IN REGISTER "AC".
	  E.G.	CALL INLINE ("(3)200,2,0,0,I);
		I = INLINE ("(3)201,3,0,0,23);

4. COMPILER SWITCHES (TOGGLES)
   ---------------------------

	THE COMPILER CONTROL SWITCHES IMPLEMENTED, AND THEIR FUNCTIONS
	ARE AS BELOW:

	SWITCH	INITIALLY	FUNCTION WHEN TRUE
	---------------------------------------------------------------
	A	FALSE	PRODUCE MACRO-10 SOURCE FILE FOR PROGRAM
	B	FALSE	LIST EMITTED DATA AND DESCRIPTORS
	C	FALSE	LIST EMITTED CONSTANTS
	D	TRUE	LIST MACROS AND COMPILER INFO AT END OF PROGRAM
	E	FALSE	LIST EMITTED CODE
	F	FALSE	(IF L = TRUE) LIST CODE, DATA, DESCRIPTOR ADDRESSES
	K	FALSE	KILL LISTING OUTPUT (INHIBITS L BEING SET)
	L	TRUE	PRODUCE LISTING WITH LINE #, CURRENT PROCEDURE, ETC
	M	FALSE	LIST JUST IMAGE OF INPUT SOURCE (OVERRIDES L)
	R	FALSE	DUMP PARSE STACK ON LISTING ON SYNTAX ERRORS
	S	TRUE	(IF L = TRUE) LIST SYMBOL TABLE FOR EACH PROC.
	X	FALSE	DO NOT INCLUDE CONTENTS OF 'XPL.LIB'

5. KNOWN PROBLEMS
   --------------
	- RUN-TIME ROUTINES DO NOT HANDLE ANY ERRORS, SUCH AS OVERFLOW,
	  STACK OVERFLOW, DIVIDE CHECK, ETC.  THESE WILL EITHER BE
	  IGNORED OR PRODUCE A MONITOR ERROR MESSAGE.
	- ANY ERROR ON ANY FILE WILL LOOK LIKE END-OF-FILE (WHICH CAUSES
	  A NULL STRING, OR A ZERO, TO BE RETURNED ON INPUT FILES).

	OPERATING PROCEDURES
	--------------------

	THE COMPILER (XPL) ASKS FOR A FILENAME ON THE TERMINAL.

IT THEN OPENS FOUR FILES:
	SYSIN:<FILENAME>.XPL	XPL SOURCE
	SYSOUT:<FILENAME>.LST	GENERATED LISTING
	DSK:<FILENAME>.REL	GENERATED RELOCATABLE BINARY FILE
	LIB:XPL.LIB		SOURCE FILE CONTAINING "COMPACTIFY"

IF THE "X" SWITCH IS SPECIFIED IN THE TERMINAL RESPONSE, THEN THE
LIBRARY FILE (LIB:XPL.LIB) IS NOT PROCESSED.  THIS SWITCH MAY ONLY
BE SPECIFIED FROM THE TERMINAL.

IF THE "A" SWITCH IS SPECIFIED IN THE TERMINAL RESPONSE, THEN THE
TWO FILES BELOW ARE ALSO OPENED:
	DSK:<FILENAME>.MAC	GENERATED MACRO ASSEMBLER SOURCE
	DSK:<FILENAME>.TMP	TEMPORARY WORK FILE

	IF DEVICES "SYSIN", "SYSOUT", OR "LIB" DO NOT EXIST,
 "DSK" IS USED.

	SWITCHES MAY BE SPECIFIED IN THE TERMINAL RESPONSE BY
PRECEDING EACH SWITCH BY A "/".
	E.G.	TEST/A		TO GENERATED MACRO-10 SOURCE
		TEST/L		TO LIST COMPACTIFY(NORMALLY
				SUPPRESSED).

1. COMPILE THE XPL SOURCE:
	.RUN DSK:XPL	
	FILE NAME TO BE COMPILED: XXXX

	EXIT
	^C
	.
		AT THIS POINT FILE XXXX.LST MAY BE PRINTED.

2. LOAD OR EXECUTE THE PROGRAM:
	.EX XXXX,HMON
	...
	...

	TO COMPILE THE COMPILER ITSELF, REPLACE "XXXX" BY "XCOM" ABOVE
	AND RUN XPL IN 35K (RU XPL 35). (THIS IS TO REDUCE THE CPU TIME
	WHEN COMPILING LARGE PROGRAMS.)

	THE RUN-TIME ROUTINES
	---------------------

	"HMON" IS A PACKAGE DESIGNED TO SUPPORT I/O FUNCTIONS
FOR GENERAL XPL PROGRAMS.  IT SUPPORTS BINARY I/O AS WELL
AS TEXT FILES, BOTH INPUT AND OUTPUT.
COMPLETELY GENERAL FILE DESCRIPTIONS MAY BE USED. UP TO 16 FILES MAY
BE OPEN AT ANY ONE TIME (ON LOGICAL NUMBERS 0-15).

	FILE 0  IS INPUT ONLY, IN TEXT MODE.
	FILE 1  IS OUTPUT ONLY, IN TEXT MODE.
	FILE -1 IS TELETYPE, IN OR OUT, USING TTCALL UUOS.
	     -2  "    "    , OUTPUT, WITHOUT <CARRIAGE RETURN><LINE FEED>
			     AT THE END OF THE STRING TYPED.

<STRING> = INPUT(N);	RETURNS THE NEXT LINE (TERMINATING WITH LF,
			FF, ETC.) FROM THE FILE CURRENTLY OPEN AS 
			LOGICAL FILE N, AS A STRING. IF AT END-OF-FILE,
			RETURN A NULL STRING, OTHERWISE RETURN AT LEAST
			1 BLANK. N=1 IS ILLEGAL. IF N OMITTED, USE 0.

OUTPUT(N) = <STRING>;	OUTPUT THE STRING TO THE FILE OPEN AS LOGICAL
			FILE N. IF N=0, OR N IS OMITTED, USE N=1,BUT
			WITH NO CARRIAGE CONTROL. IF N=1, FIRST CHAR
			IN STRING IS USED AS CARRIAGE CONTROL INDICATOR.

<FIXED> = FILE(N);	RETURNS THE NEXT 36-BIT WORD IN THE FILE OPEN
			AS LOGICAL FILE N. IF AT END-OF-FILE, RETURN 
			ZERO. N=0 AND N=1 ARE ILLEGAL.

FILE(N) = <FIXED>;	OUTPUTS THE 36-BIT VALUE AS THE NEXT WORD IN
			THE FILE OPEN AS LOGICAL FILE N. N=0 AND N=1
			ARE ILLEGAL.

FILENAME(N) = <STRING>;	MAKES THE NEXT INPUT, OUTPUT, OR FILE OPER-
			ATION ON LOGICAL FILE N USE THE FILE DESCRIBED
			BY <STRING>. <STRING> IS A NORMAL PDP-10 FILE
			DESCRIPTION:
				DEVICE:NAME.EXTENSION[PROJ,PROG]
			IF DEVICE IS OMITTED, USE "DSK"
			IF NAME   IS OMITTED, USE "XPLNN", NN=DECIMAL
				FILE NUMBER, 00-15;
			IF EXTENSION IS OMITTED, USE "DAT";
			IF [PROJ,PROG] IS OMITTED, USE [0,0] (I.E.
				DEFAULT TO OWN DIRECTORY).
			N.B. (1) IF A NULL EXTENSION IS DESIRED, SPECIFY
				AT LEAST 1 BLANK IN THE EXTENSION,
			     (2) IF [PROJ,PROG] IS INCLUDED, SPECIFY
				THE FILENAME TOO.

	FILES ARE ALWAYS CHECKED FOR CORRECT MODE AND DIRECTION BEFORE
EACH USE, AND WILL BE CLOSED AND REWOUND IF NECESSARY.

	FILES 0 AND 1 HAVE AN INITIAL DEVICE SPECIFICATION OF "SYSIN"
AND "SYSOUT", RESPECTIVELY, BUT THIS IS CHANGED TO "DSK" IF EITHER
THESE DEVICES ARE NOT AVAILABLE, OR FILENAME IS CALLED TO SPECIFY
ANYTHING FOR THESE FILES.

	AT THIS TIME, NO DELETE OR RENAME CAPABILITY EXISTS FOR XPL
PROGRAMS.