perm filename SIMDS1.MAC[SIM,SYS]1 blob sn#460235 filedate 1979-07-20 generic text, type T, neo UTF8
	SEARCH	SIMRPA,SIMMCR,SIMMAC
	RTITLE SIMDDT
	SUBTTL	SIMDDT

	COMMENT;
	AUTHOR(S): I WENNERSTR@M
	
	VERSION:0
		[2] IS THE EDIT NUMBER OF THE FIRST UPDATE OF SIMDDT
			-THE DISPLAY AND INSPECT COMMANDS HAVE BEEN ADDED
			-SOME STANDARD PROCEDURES MAY BE REFERENCED
			-ALL SPECIAL CHARACTERS IN A TEXT VARIABLE IS
			 REPLACED WITH ↑LETTER

		[41] IS THE SECOND UPDATE OF SIMDDT
			-THE CLOSE, NOPROCEED AND @ COMMANDS HAVE BENN ADDED
			-THE NOARRAYS COMMAND HAS BEEN REMOVED
			-THIS AND QUA ARE ACCEPTED IN AN IDENTIFIER
			-COMPLETE BLOCKS CAN BE OUTPUT WITH * AS IDENTIFIER
			-/-GC, /-ARRAY, /-TEXT CAN BE SPECIFIED IN OUTPUT COMMANDS
			-IT IS POSSIBLE TO CONTINUE PROCESSING AFTER SOME ERRORS
			-↑C REENTER WILL END THE PROCESSING OF
			 THE CURRENT COMMAND
			-THE VARIABLES COMMAND WILL ALSO SHOW THE TYPE PROCEDURE
			 VALUES

			-THE PROCEDURE VALUE WILL BE OUTPUT 
	PURPOSES:
		SIMDDT IS THE DEBUGGING PROGRAM FOR SIMULA
		THE SIMULA LANGUAGE HANDBOOK PART 2 CONTAINS
		A DESCRIPTION OF THE SIMDDT PROGRAM.

	CONTENTS:
		SIMDDT CONSISTS OF THE FOLLOWING SOURCE MODULES:
			
		SIMDS1,SIMDS2,SIMDS3,SIMDS8,SIMEDS,SIMDS9 AND SIMDS7.
		THE MAIN ROUTINES ARE PLACED IN SIMDS1 AND SIMDS9

		DSIN	CONTAINS ALL ENTRY POINTS TO SIMDDT
			DSINI	START SIMDDT
			DSINB	ENTRY FROM BREAKPOINT
			DSINE	PROCESS ERROR
			DSINC	RETURN FROM RTS ROUTINE IF GARBAGE COLLECT MAY
				HAVE BEEN INVOKED
			DSINR	REENTER (OR CONTINUE) COMMAND
			DSINS	REMOVES ALL BREAKPOINTS
			DSINM	STARTS PROGRAM EXECUTION WHEN SIMDDT
				WAS LOADED TOGETHER WITH MAIN PROGRAM
		DSBP	BREAKPOINT PROCESSING
		DSCM	COMMAND ACCEPT AND DISPATCH
		DSST	STOP AT START OF COMMAND
		DSHE	HELP COMMAND
		DSAT	AT COMMAND
		DSDP	DISPLAY COMMAND
		DSOP	OUTPUT COMMAND
		DSIP	INPUT COMMAND
		DSRE	RESET COMMAND
		DSBR	BREAKS	COMMAND
		DSCL	CLOSE COMMAND
		DSPR	PROCEED	COMMAND
		DSUS	USE COMMAND
		DSCH	CHAIN	COMMAND
		DSVA	VARIABLES COMMAND
		DSSC	SCHEDULED COMMAND
		DSPC	INSPECT COMMAND
		DSAL	ALL COMMAND
		DSEX	EXIT COMMAND
		DSNOPR	NOPROCEED COMMAND
		DSGET	@ COMMAND


		THE MAIN ROUTINES CALL A NUMBER OF INTERNAL SUBROUTINES
		WHICH ARE PLACED IN THE SIMDS2 AND SIMDS3 MODULES.
	
		SIMDDT CALLS A NUMBER OF RTS ROUTINES
		CSQU,TXVA,TXRE,TXPI,TXGI,TXPR,TXGR,TXBL,TXCY,TXST,CSNA,SAGC,
		SUNE,IOOP,IOCL,IOOG,IOBO,IOIG,IOLN,CPNE,CSEN

		THE KEYWORD TABLE ZKW IS PLACED IN SIMDS1.

		THE ERROR TABLES YEDD,YEDL,YEDMI,YEDLL ARE PLACED IN THE
		SIMDS8 AND SIMEDS MODULES.					
		
		ZBR BREAKPOINT RECORD IS PLACED IN THE SIMDS7 MODULE

		
	;

	SALL
	
	RELOC	0
	MACINIT
	INTERN	DSSTART

	EXTERN	.MAIN			; SIMULA MAIN PROGRAM START ADDRESS
					; USED IF SIMDDT LOADED /LINKED TOGETHER
					; WITH SIMULA MAIN PROGRAM
	EXTERN	.JBSA,.JBUUO,.JBFF
	SUBTTL	LOCAL REGISTERS

XDBAS=14			;BASE REGISTER FOR SIMDDT MODULE
XDSTK=13			;SIMDDT STACK REGISTER
XDZBR=12			;BASE REGISTER FOR BREAKPOINT RECORD ZBR
XDINT=11			;INPUT TEXT POINTER
XDOUT=XDINT			;OUTPUT TEXT POINTER,REACHED VIA XDINT +ZTV%S
XDSYM1=5			;SIXBIT SYMBOL FIRST 6 CHARACTERS
XDSYM2=6			;SIXBIT SYMBOL LAST SIX CHARACTERS
XDBYTE=0			;INPUT BYTE CHARACTER
XDZKW=7				;KEYWORD TABLE POINTER
XDZSD=7				;SYMBOL TABLE POINTER
XDRTSR=7			;ADDRESS OF RTS ROUTINE 
				;USED WHEN GARBAGE COLLECT MAY BE INVOKED
XDSWIT=10			;SWITCH REGISTER
XDMN=4				;ERROR MESSAGE NUMBER FOR DSPM

	SETLOW			;XLOW=XIAC SEE RTS SYSTEM
$$BAS=XDBAS			;USED IN SIMMAC 
XDT3=3				;TEMPORARY WORK ACCUMULATOR
XDT2=2				;TEMPORARY WORK ACCUMULATOR
XDT4=4				;TEMPORARY WORK ACCUMULATOR
XDT5=5				;TEMPORARY WORK ACCUMULATOR
XDM1=XDSYM1
XDM2=XDSYM2
XDCNT=XDT3
XDM=XDT2
XDMN2=XDMN+1
XDM3=7
XDSTA=7				;STATEMENT ADDRESS
XDZLN=6				;ZLN POINTER
XDLIN=7				;LINE NUMBER
XDZBE=7				;ZBE POINTER
XDADR=3				;ADDRESS OF VARIABLE
XDTYP=2				;TYPE OF VARIABLE
XDZPR=5				;PROTOTYPE POINTER
	
XDTA=XDT2			;USED IN DSPR COPIED FROM COBDDT
XDTB=XDT3
XDTC=XDT4

XDARR=4				;ADDRESS OF VALUE  IN DSBP
	SUBTTL	ASSEMBLY TIME CONSTANTS

;ZKWTYP FIELD VALUES
QZKWTS=0			;VALID AT START OF COMMAND
QZKWTI=1			;VALID INSIDE COMMAND
QZKWTR=2			;VALID AS RELATIONAL OPERATOR
QZKWTQ=3			;VALID AS CONSTANT
QZKWTC=4			;[2] VALID AFTER / IN INSPECT


;ZAR RECORD OFFSETS,MOVE TO MCR
ZARBAO=2
ZARUPO=5

ZARLOO=4
;MESSAGE NUMBERS

;ALL MESSAGES GENERATED BY SIMDDT ARE LISTED IN THE SIMULA
;LANGUAGE HANDBOOK PART 2. ALL THE MESSAGES STARTING WITH
;ZYD ARE INITIATED FROM SIMDDT WHILE THE MESSAGES STARTING WITH ZYQ ARE
;INITIATED BY THE RTS SYSTEM. THE CROSSREFERENCE LISTING OF SIMDDT GIVES THE 
;STATEMENT (OR ROUTINE) WHICH GENERATES A SPECIAL MESSAGE.
;ALL MESSAGES HAVE AN INTERNAL NAME.

;THE MESSAGES 500 TO QMSUPN (547) WILL APPEAR WITHOUT THE ZYDNNN TAG.

QMPVCH=500			;CHAR
QMOPAS=501			;=
QMPCLI=502			;[2]  CURRENT BLOCK POINTER AT LINE 
QMPVLE=503			;LENGTH=
QMPVPO=504			;POS=
QMPVST=505			;SUBTEXT STARTS AT POSITION=

QMTCTP=512			;[41] TO CONTINUE TYPE PROCEED
QMGNIL=513			;[41] GIVE NEW INPUT LINE TO REPLACE THE LINE GIVEN ABOVE
QMGNIN=514			;[41] GIVE NEW INTEGER ARGUMENT
QMCLFI=515			;[41] FILE:
QMCLOD=516			;[41] CLOSED
QMVAPV=517			;[41] PROCEDURE VALUE

QMHEF=512			;FIRST HELP MESSAGE
QMHEL=537			;LAST HELP MESSAGE

QMINST=540			;SIMDDT STARTED
QMINER=541			;ERROR IN JOB
QMPVDE=542			;DETACHED
QMFADE=QMPVDE
QMFAAT=506			;TERMINATED
QMCHIN=507			;INSPECT BLOCK
QMSCEV=511			;EVTIME=
QMPSPB=510			;PREFIX BLOCK
QMSCHN=543			;NO SCHEDULED PROCESSES
QMSCH=544			;SCHEDULED PROCESSES
QMCHH=545			;OPERATING CHAIN
QMVAH=547			;VARIABLES
QMSUPN=547			;LAST ZYD MESSAGE WHERE ZYDNNN IS SUPRESSED
QMCM01=551			;NOT VALID AT START OF COMMAND
QMCM02=552			;NOT VALID IN DEBUG MODE
QMCM03=553			;NOT VALID IN ERROR MODE

QMPRNA=554			;[41] PROCEED NOT ALLOWED AFTER THIS ERROR

QMIPPR=556			;[2] ASSIGNMENT TO STANDARD PROCEDURES NOT POSSIBLE
QMNINM=557			;[2] TEXT ATTRIBUTE IS NOT MAIN

QMNIMP=677			;COMMAND OR FEATURE NOT IMPLEMENTED
QMITOW=550			;LINE OVERFLOW ON INPUT
QMPMNI=676			;INVALID MESSAGE NUMBER
QMNITL=560			;TYPE LABEL SYMBOL
QMNIMN=561			;MODE NAME SYMBOL
QMNIKP=562			;[2] KIND PROCEDURE SYMBOL AND NOT HANDLED
QMNIKC=563			;KIND CLASS SYMBOL
QMNIUN=564			;UNDEFINED SYMBOL
QMNINR=565			;[2] ILLEGAL DOT NOTATION
QMNIII=566			;IDENTIFIER EXPECTED IN INPUT
QMATII=QMNIII
QMNINV=567			;IDENTIFIER NOT VISIBLE IN SYMBOL TABLE
QMNINA=570			;SUBSCRIPTS IN  TEXT BUT SYMBOL IS NOT ARRAY
QMNINS=571			;SUBSCRIPTS MISSING AFTER ARRAY SYMBOL 
QMNISE=572			;, OR ) EXPECTED AFTER SUBSCRIPTS
QMNIID=573			;ATTRIBUTE IDENTIFIER EXPECTED AFTER DOT
QMLVSN=574			;WRONG NUMBER OF SUBSCRIPTS IN IDENTIFICATION
QMLVSL=575			;SUBSCRIPT LESS THAN LOWER BOUND
QMLVSU=576			;SUBSCRIPT GREATER THAN UPPER BOUND
QMOPCR=577			;CRLF OR , EXPECTED
QMFBOV=600			;NO MORE FREE ZBE ENTRIES
QMCSQE=601			;QUALIFICATION ERROR
QMATCR=602			;RELATION OPERATOR EXPECTED
QMATEI=603			;END OF INPUT EXPECTED
QMATLC=604			;MORE THAN ONE LOOP COUNTER
QMATNC=605			;INVALID COUNTER VALUE
QMATNF=606			;NO MORE FREE BREAKPOINT ENTRIES
QMGLCM=611			;COLON MISSING AFTER MODULE NAME
QMGVCE=612			;CHARACTER CONSTANT END ' MISSING
QMIPNA=613			;:= OR :- EXPECTED
QMIPND=614			;DENOTES ONLY VALID AFTER REF OR TEXT VARIABLE
QMIPNR=615			; := NOT VALID AFTER REF VARIABLE
QMIPTA=616			;STRING CONSTANT NOT VALID IN TEXT
				;REFERENCE ASSIGNMENT
QMGVTD=617			;DIFFERENT TYPES IN INPUT COMMAND OR AT COMMAND
QMRENB=620			;NO BREAKPOINT
QMRENA=621			;AT OR END OF INPUT EXPECTED
QMBREE=QMATEI			;END OF INPUT EXPECTED
QMBRRE=622			;RESET OR END OF INPUT EXPECTED
QMIPEI=QMATEI
QMINRE=623			;SIMDDT ENTERED VIA ↑C AND REENTER
QMGSSE=625			;FINAL " MISSING IN TEXT CONSTANT
QMIPTL=626			;LENGTH OF RHS>LHS IN TEXT VALUE ASSIGNMENT
QMNIIA=627			;ATTRIBUTE IDENTIFIER NOT FOUND IN SYMBOL TABLE
QMGVEL=630			;CONSTANT OR IDENTIFICATION OF RIGHT TYPE EXPECTED
QMNATE=631			;TYPE ERROR IN DYNAMIC RECORD
QMVANG=632			;GARBAGE COLLECT NOT CALLED
QMTXNN=633			;REAL OR LONG REAL VALUE NOT NORMALIZED
QMUSDB=635			;FILE ALREADY IN USE
QMGLEM=636			;INVALID MODULE NAME
QMGLIL=637			;INVALID LINE NUMBER
QMRANE=640			;TEXT OR REF VARIABLE ARRAY ELEMENT MISSING
				;ALL USED
QMATOP=641			;IDENTIFIER AND OPERATOR INCOMPATIBLE
QMATCI=642			;CLASS IDENTIFIER EXPECTED
QMNICI=QMATCI		;[41] CLASS IDENTIFIER EXPECTED AFTER THIS AND QUA
QMPVRI=643			;ARRAY POINTER NONE OR ARRAY OR REF POINTER ZERO
QMGVNS=644			;NOT POSSIBLE TO OPEN NEW FILE OR TO SAVE
QMINTB=645			;XCB POINTS AT TERMINATED BLOCK
QMUSNA=646			;USE FILE NOT ACCEPTED
				;STRING WHEN SIMDDT ENTERED VIA REENTER
				;GARBAGE COLLECTION IS NOT POSSIBLE
QMVSNB=QMGVNS
QMDPEL=647			;[2] - OR END OF LINE EXPECTED.DISPLAY COMMAND
QMDPLE=650			;[2] LINE INTRRVAL ERROR IN DISPLAY COMMAND
QMDPEO=651			;[2] LINE NOT FOUND IN MODULE
QMRUCE=652			; [2] RETURN OR UP NOT ALLOWED
QMPCCE=653			; [2] KEYWORD EXPECTED AFTER /
QMPCOR=654			; [2] OBJECT REFERENCE EXPECTED
QMLVET=655			;[2] VALUE NOT ACCESIBLE FROM TERMINATED BLOCK
QMNIST=656			;[41] STAR NOT ALLOWED IN IDENTIFIER
QMCLKE=657			;[41] CLOSE OR CRLF EXPECTED AS ANSWER
QMCHQS=660			;[41] GIVE NOPROCEED COMMAND AND REENTER CURRENT COMMAND
QMVAKE=661			;[41] INVALID KEYWORD AFTER / IN ALL ,VARIABLES
				;[41] AND OUTPUT COMMANDS
QMITTI=662			;[41] INPUT FROM TERMINAL



QMINNB=674			;BREAKPOINT NOT VALID
QMTERM=675			;SIMDDT TERMINATION ERROR
QMAS01=QMTERM
QMAS02=QMTERM


;MESSAGE NUMBER LIMITS ARE:

;QZYQFN=001 			;FIRST VALID ZYQ MESSAGE NUMBER
;QMSUPN=547 			;SEE ABOVE

QZYQLN=217			;[2] LAST VALID ZYQ MESSAGE NUMBER
				;CONSTANT ALSO USED IN SUTEDS
QZYDFN=500			;FIRST VALID ZYD MESSAGE NUMBER
QZYDLN=677			;LAST VALID ZYD NUMBER
;SIZE CONSTANTS FOR RECORDS

QDSTN=↑D36			;ELEMENTS IN ZDSTXT ARRAY
IFG <QDSTN-↑D36 > < PRINTX QDSTN TOO LARGE>
QZBEL=4				;LENGTH OF ZBE ENTRY
QZBEN=↑D40			;NUMBER OF ZBE ENTRIES
QDSRN=↑D36			;ELEMENTS IN ZDSREF ARRAY
IFG <QDSRN - ↑D36> <PRINTX QDSRN TOO LARGE>
QDSION=↑D135			;LENGTH OF INPUT /OUTPUT TEXT
QBRN=↑D20			;MAX NUMBER OF BREAKPOINT LINES
				;IN ZBR RECORD
QSTAKL=40			;SIMDDT STACK LENGTH
QNSDR=↑D8			;NUMBER OF SIGNIFICANT DIGITS IN REAL NUMBER
QNSDLR=↑D16			;...IN LONG REAL NUMBER




;CONSTANTS

QTEXTQ=042			;ASCII APOSTROPHE

QLINEM=1B19-1			;MAX LINE NUMBER ENTRY FOR STATEMENT
				;2↑16-1
				;LINE NUMBER FOR DECLARATION
				;HAS BIT ONE SET

;TYPE CONSTANTS FOR ZBE RECORD
;TYPE OF AT COMMAND
QBEAT=1
QBEATC=2
QBEATL=3
QBEATR=4
QBECON=0
;TYPE OF RELATIONAL OPERATOR
QACTOP=1			;ARITHMETIC,CHARACTER OR TEXT RELATION
QBOP=2				;EQV OPERATOR
QOOP=3				;IS OR IN OPERATOR
QOTOP=4				;== OR =/= OPERATOR
	SUBTTL	SWITCH DECLARATIONS

;	THE ACCUMULATOR XDSWIT HOLDS THE SWITCHES WHEN SIMDDT IS ACTIVE.
;	THE IMPORTANT STATUS SWITCHES ARE SAVED IN YDSWIT(XLOW) AND
;	THE SWITCHES ARE VALID EVEN IF SIMDDT IS NOT EXECUTING.

;	DSW	(YDSACT,YDSWIT,0)	;SIMDDT ACTIVE
;					;YDSACT DEFINED IN RPA
	DSW	(YDSITTY,0,1,XDSWIT)	;[41] INPUT FROM TTY
	DSW	(YDSDBG,0,4,XDSWIT)	;DEBUG MODE  ON,
					;ERROR MODE OFF
	DSW	(YDSINI,0,2,XDSWIT)	;SIMDDT INITIALIZED
	DSW	(YDSTTY,0,3,XDSWIT)	;CURRENT OUT FILE IS TTY
	DSW	(YDSTEM,0,5,XDSWIT)	;TEMPORARY HELP SWITCH
	DSW	(YDSLLF,0,6,XDSWIT)	;[2] LAST DISPLAY LINE ENDED WITH LF
	DSW	(YDSSNA,0,7,XDSWIT)	;[41] /-ARRAY FOUND IN COMMAND
	DSW	(YDSASG,0,8,XDSWIT)	;INPUT COMMAND OPERATOR IS := IF ON
					;			   :- IF OFF
	DSW	(YDSLIST,0,9,XDSWIT)	;IDENTIFICATION LIST FOUND
	DSW	(YDSCHG,0,10,XDSWIT)	;CHANGED FOUND IN AT COMMAND
	DSW	(YDSBOI,0,11,XDSWIT)	;[2] USE BREAKOUTIMAGE AND NO CRLF AT OUTPUT
	DSW	(YDSSTA,0,12,XDSWIT)	;SET ON BY DSINI TO FORCE
					;RETURN TO RTS FROM DSPR
	DSW	(YDSPBT,0,13,XDSWIT)	;OUTPUT TOTAL BREAKPOINT COMMAND IN DSPB
	DSW	(YDSREE,0,14,XDSWIT)	;SIMDDT ENTERED VIA DSINR
	DSW	(YDSTXR,0,15,XDSWIT)	;CALL TXGR
	DSW	(YDSACB,0,16,XDSWIT)	;[2] BLOCK ACTIVE ,USED IN INSPECT AND 
					;[2] CHAIN COMMANDS
	DSW	(YDSGCO,0,17,XDSWIT)	;RTS ROUTINE WHICH MAY INVOKE 
					;GARBAGE COLLECT CALLED
;
;	ALL SWITCHES IN RIGHT PART OF XDSWIT WILL BE SET TO ZERO IN DSCM

	DSW	(YDSTXC,0,18,XDSWIT)	;TEXT INPUT RTS ROUTINE CALLED
					;ERRORS ARE EXPECTED WHEN INPUT NOT CORRECT
	DSW	(YDSERE,0,19,XDSWIT)	;ERROR DETECTED BY RTS SYSTEM WHILE
					;SIMDDT ACTIVE
	DSW	(YDSUFR,0,20,XDSWIT)	;[2] OUTPUT/INPUT I/O RTS ROUTINE CALLED
	DSW	(YDSRLC,0,21,XDSWIT)	;RELATIONAL CHARACTER FOUND IN IDENTIFIER
	DSW	(YDSCSTOP,0,22,XDSWIT)	;STOP AT START OF COMMAND
					;SET IN DSPB ROUTINE
	DSW	(YDSIFF,0,23,XDSWIT)	;IF FOUND IN AT COMMAND
	DSW	(YDSSTRING,0,24,XDSWIT)	;TEXT VARIABLE IF ON
					;TEXT STRING IF OFF ,USED IN DSPV
	DSW	(YDSOBOTH,0,25,XDSWIT)	;OUTPUT TEXT TO TTY AND FILE IF
					;ANY SPECIFIED
	DSW	(YDSOCOM,0,26,XDSWIT)	;OUTPUT COMMAND WHICH MAY CONTAIN
					;ARRAY IDENTIFIER WITHOUT INDEX
	DSW	(YDSOAI,0,27,XDSWIT)	;ARRAY TO BE OUTPUT
	DSW	(YDSTOP,0,28,XDSWIT)	;STOP FOUND IN COMMAND
	DSW	(YDSALL,0,29,XDSWIT)	;ALL COMMAND ACTIVE
	DSW	(YDSINO,0,30,XDSWIT)	;SET ON WHEN THE INPUT BUFFER DOES
					;NOT CONTAIN ANY RELEVANT ERROR INFORMATION
	DSW	(YDSDOD,0,31,XDSWIT)	;[2] SOURCE LINE FOUND AND DISPLAYED
	;[2]
	DSW	(YDSUP,0,32,XDSWIT)	; [2] FIND STATIC ENCLOSING BLOCK
	DSW	(YDSRE,0,33,XDSWIT)	; [2] FIND DYNAMICALLY ENCLOSING BLOCK
	DSW	(YDSCH,0,34,XDSWIT)	; [2] FIND OPERATING CHAIN
	DSW	(YDSSGC,0,32,XDSWIT)	;[41] SKIP GARBAGE COLLECTION
	DSW	(YDSSKT,0,33,XDSWIT)	;[41] SKIP TEXT CHARACTERS IN OUTPUT
	DSW	(YDSOSB,0,31,XDSWIT)	;[41] OUTPUT VARIABLES IN BLOCK VIA *
	DSW	(YDSHEL,0,34,XDSWIT)	;[41] HELP COMMAND
	SUBTTL	LOCAL OPDEFS AND MACRO DEFINITIONS

	OPDEF	DSTACK	[PUSH	XDSTK,]
	OPDEF	DUNSTK	[POP	XDSTK,]
	OPDEF	DRETUR	[POPJ	XDSTK,]

;	LOCAL MACRO DEFINITIONS

DEFINE	$$RELO  (FL)	<DSSTAR(FL)>	
					;USED IN SIMMAC

DEFINE	LAB (FL) <FL-DSSTAR(XDBAS)>

DEFINE	LABB(FL) <FL-DSZBRS(XDZBR)>

DEFINE	DEXEC	(FR)
			<PUSHJ	XDSTK,LAB(<FR>)>

DEFINE	OUTCHA		<	
		MDSOCH
			>


DEFINE	OUTCHB	<
		DEXEC	DSOCB
	>
;MACROS FOR CALLING THE SUBROUTINES IN SIMDDT
;A M IS PLACED BEFORE THE ENTRY POINT NAME 

DEFINE MDSFK	
		<DEXEC	DSFK>
DEFINE	MDSFKI
		<DEXEC	DSFKI>
DEFINE	MDSTC
		<DEXEC	DSTCS>
DEFINE	MDSTCR
		<DEXEC	DSTCSR>
DEFINE	MDSIT
		<DEXEC	DSIT>
DEFINE	MDSOF
		<DEXEC	DSOF>
DEFINE	MDSOFT
		<DEXEC 	DSOFT>
DEFINE	MDSOFM	(FMNO)
		<IFNB <FMNO><LI	XDMN,FMNO
		>
		DEXEC	DSOFM>
DEFINE	MDSOBM	(FMNO)
		<IFNB <FMNO><LI	XDMN,FMNO
		>
		DEXEC	DSOBM>
DEFINE	MDSOT
		<DEXEC	DSOT>
DEFINE	MDSOTM	(FMNO)
		<IFNB <FMNO><LI	XDMN,FMNO
		>
		DEXEC	DSOTM>
DEFINE	MDSOEM	(FMNO)
		<IFNB <FMNO><LI	XDMN,FMNO
		>
		DEXEC	DSOEM
		>
DEFINE	MDSGL
		<DEXEC	DSGL>
DEFINE	MDSGI
		<DEXEC	DSGI>
DEFINE	MDSGIS
		<DEXEC	DSGIS>
DEFINE	MDSGIR
		<DEXEC	DSGIR>
DEFINE	MDSNI
		<DEXEC	DSNI>
DEFINE	MDSNIS
		<BRANCH	LAB(DSNIS)>
DEFINE	MDSGV
		<DEXEC	DSGV>
DEFINE	MDSGS
		<DEXEC	DSGS>
DEFINE	MDSLO
		<DEXEC	DSLO>
DEFINE	MDSLL
		<DEXEC	DSLL>
DEFINE	MDSLV
		<DEXEC	DSLV>
DEFINE	MDSPB
		<DEXEC	DSPB>
DEFINE	MDSPBT
		<DEXEC	DSPBT>
DEFINE	MDSPS
		<DEXEC	DSPS>
DEFINE	MDSPSP
		<DEXEC	DSPSP>
DEFINE	MDSPSK
		<DEXEC	DSPSK>
DEFINE	MDSPL
		<DEXEC	DSPL>
DEFINE	MDSPV
		<DEXEC	DSPV>
DEFINE	MDSPM	(FMNO)
		<IFNB <FMNO><LI	XDMN,FMNO
		>
		DEXEC	DSPM>
DEFINE	MDSPI
		<DEXEC	DSPI>
DEFINE	MDSNB
		<DEXEC	DSNB>
DEFINE	MDSNBW
		<DEXEC	DSNBW> 
DEFINE MDSFB
		<DEXEC	DSFB>
DEFINE	MDSFBW
		<DEXEC	DSFBW>
DEFINE	MDSRB
		<DEXEC	DSRB>
DEFINE	MDSRBD
		<DEXEC	DSRBD>
DEFINE	MDSRL
		<DEXEC	DSRL>
DEFINE	MDSRLB
		<DEXEC	DSRLB>
DEFINE	MDSIS
			<PUSHJ	XPDP,LAB(DSIS)>
				;NOTE SIMDDT STACK NOT YET DEFINED ,USE RTS STACK
DEFINE	MDSSCI
		<DEXEC	DSSCI>
DEFINE	MDSSKB
		<DEXEC	DSSKB>
DEFINE	MDSSUB
		<PUSHJ	XDSTK,@(XDSTK)>
DEFINE	MDSOCH
		<DEXEC	DSOCH>
DEFINE	MDSONL
		<DEXEC	DSONL>
DEFINE	 MDSINL
	<DEXEC	DSINL>
DEFINE	MDSICH
	<DEXEC	DSICH>
DEFINE	MDSTXB
	<DEXEC	DSTXB>
DEFINE	MDSPO
	<DEXEC	DSPO>
DEFINE	MDSPOC
	<DEXEC	DSPOC>
DEFINE	MDSVOM	(FMNO)
		<IFNB <FMNO><LI	XDMN,FMNO
			>
		DEXEC	DSVOM>
DEFINE	MDSVO
		<DEXEC	DSVO>
DEFINE	MDSFA
		<DEXEC	DSFA>
DEFINE	MDSSS
		<DEXEC	DSSS>
DEFINE	MDSTXI
		<DEXEC	DSTXI>
DEFINE	MDSTXO
		<DEXEC	DSTXO>
DEFINE	MDSCT
		<DEXEC	DSCT>
DEFINE	MDSVIV
		<DEXEC	DSVIV>
DEFINE	MDSVAR
		<DEXEC	DSVAR>
;	SIMDDT CALLS THE FOLLOWING RTS ROUTINES

DEFINE	MCSQU
		<DEXEC	DSCSQU>
DEFINE	MTXMN			;[2] USED IN DSSPV TO REFERENCE TEXT.MAIN
		<EXEC	TXMN>
DEFINE	MTXVA
		<EXEC	TXVA>
DEFINE	MTXRE
		<EXEC	TXRE>
DEFINE	MTXST
		<EXEC	TXST>
DEFINE	MTXPI	(FP)
	<
	IFNB<FP> <
		LI	XDCNT,FP
		 DEXEC	DSTXPI>
	IFB<FP> <
		DEXEC	DSTXPC>
	>
DEFINE	MTXPR
		<DEXEC	DSTXPR>
DEFINE	MTXGI
		<DEXEC	DSTXGI>
DEFINE	MTXGR
		<DEXEC	DSTXGR>
DEFINE	MTXBL
		<LI	XDRTSR,TXBL
		 DEXEC	DSCRTS>
DEFINE	MTXCY
		 <DSTACK	XDZBE
		 LI	XDRTSR,TXCY
 		 SETZM	,1+YDSINC(XLOW)
		 DEXEC	DSCRTP
		 DUNSTK	XDZBE
		>

DEFINE	MIOCLU
		<DEXEC	DSCLOU>
					;[2]
; IOLN,CPNE,CSEN,IOOP,IOOG USED

DEFINE	MSUNE
		<EXEC	@YSUNE(XLOW)>
DEFINE	MCSNA	(FTYP,FSUB,FUPB)
		<
		SETZB	XSAC,XWAC1
		LI	XWAC2,FUPB-1
		EXEC	CSNA
		XWD	FTYP,FSUB
		MOVE	XDBAS,YDSBAS(XLOW)
		L	XDSWIT,YDSWIT(XLOW)
		>
DEFINE	MSAGC
		<LI	XDRTSR,SAGC
		 DEXEC	DSCRTS>
	SUBTTL	ZDN RECORD FOR SIMDDT
DSSTAR:	;FIRST WORD IN SIMDDT MODULE, USED BY SUTABS PROGRAM
	;XDBAS MUST POINT TO THIS WORD WHEN SIMDDT IS EXECUTING.



;	ZDN RECORD FOR SIMDDT, NOT INCLUDING ZSDZTE
;	 MUST BE PLACED HERE
	<QZYS>B<%ZDNTYP>

	DSEND-DSSTART		;LENGTH OF SIMDDT
				;NOT INCLUDING ZSDZTE
	SUBTTL	DSIN MAIN ROUTINE

	COMMENT;

	PURPOSES:	PERFORM INITIALIZATION FOR  THE DIFFERENT TYPES OF ENTRIES
			TO SIMDDT.
		
	ENTRIES:
			DSINI,DSINE,DSINB,DSINR,DSINC,DSINM,DSINS

	NORMAL EXITS:
			DSCM ,ACCEPT COMMAND
			DSBP ,PROCESS BREAKPOINT
			RETUR VIA SIMDDT STACK IF ERROR FOUND IN RTS ROUTINE WHEN
			 CALLED FROM SIMDDT
			RETUR VIA RTS STACK IF  THE ↑C COMMAND INTERRUPTED 
			SIMDDT PROCESSING
			RETUR VIA SIMDDT STACK IF ENTRY IS DSINC
			RETUR VIA RTS STACK IF ENTRY IS DSINS
			BRANCH TO .MAIN+2 IF ENTRY IS DSINM

	ERROR EXIT:
			SEE ABOVE NORMAL EXITS

	I/O PERFORMED:
			OUTPUT TO TTY AND CURRENT FILE
			VIA OUTPUT SUBROUTINES



	USED SUBROUTINES:
			DSIS,DSO,DSPM,DSPLE,DSISRB,DSBUTX,DSPSKB AND IOOG
	;
	PROC
DSINI:

	IFN DSINI-DSSTAR-QDSINI <PRINTX	QDSINI MUST BE CHANGED>

	;STARTS SIMDDT PROCESSING IN DEBUG MODE.
	;CALLED FROM OCEI BEFORE USER PROGRAM EXECUTION HAS STARTED.
	;RETURN TO OCEI FROM DSPR.
	;EXIT TO DSCM

	;INITIALIZE SIMDDT
	MDSIS
	MDSOFM	QMINST		;TYPE SIMDDT STARTED
	SETONA	YDSSTA		;EXIT VIA RTS FROM PROCEED
	ST	XDSWIT,YDSWIT(XLOW)

	;ACCEPT COMMANDS
	BRANCH	LAB(DSCM)

DSINB:	GOTO	LAB(DSINB.)
	
DSINR:	GOTO	LAB(DSINR.)

DSINS:	GOTO	LAB(DSINS.)

DSINE:

	IFN DSINE-DSSTAR-QDSINE <PRINTX QDSINR MUST BE CHANGED>

	;CALLED FROM OCUU WHEN AN ERROR HAS BEEN DETECTED
	;NORMAL RETURN TO OCUU FROM DSEX WHEN AN ERROR IS NOT AN INTERNAL SIMDDT ERROR
	;EXIT FROM DSINE TO DSCM
	;
	;AFTER AN INTERNAL ERROR MESSAGE HAS BEEN PRODUCED
	;EXECUTION CONTINUES AT THE POINT WHERE RTS WAS CALLED
	;


	IF
		IFOFF	YDSACT(XLOW)
		GOTO	FALSE	
	THEN
		;HANDLE INTERNAL SIMDDT ERROR
		;ERROR FOUND IN RTS WHEN PROCESSING
		;CALL FROM SIMDDT

		L	XDSWIT,YDSWIT(XLOW)
	
		IF
			IFOFFA	YDSINI
			GOTO	FALSE			;ERROR DURING SIMDDT
							; INITIALIZATION
			SETONA	YDSERE			;ERROR ENTRY WHILE
							; SIMDDT ACTIVE
		THEN
			IF
				IFONA	YDSGCO
				GOTO	FALSE		;POSSIBLE GARBAGE COLLECT
			THEN
			IF
				IFONA	YDSTXC
				GOTO	FALSE		;TEXT CALL
			THEN
				;UNEXPECTED ERROR
				IF
					IFONA	YDSDBG
					GOTO	FALSE		
				THEN
					;ERROR MODE ALREADY
					;AVOID LOOP

					OUTSTR	LAB(DSINE1)

					BRANCH	OCEP		;[41] EXIT IF ERROR
								;PROCESSING
			
					DSINE1:	ASCIZ	/
?ZYD477 ERROR WHILE PROCESSING ERROR/

				FI
					;DEBUG MODE

					ST	XDSWIT,YDSWIT(XLOW)
					GOTO	LAB(DSINE2)	;PROCESS ERROR

			
			FI
				;ERROR IN TXGI OR TXGR ROUTINES
			
			FI
				;GARBAGE COLLECT MAY HAVE OCCURRED
			
				BRANCH	LAB(DSINC1)		;RESTORE AND
								;BUILD MESSAGE

	
		FI
			;SIMDDT ERROR NOT POSSIBLE TO INITIALIZE
			OUTSTR	LAB(DSINE3)

			BRANCH	OCEP		;[41] EXIT

			DSINE3:	ASCIZ	/
?ZYD476 ERROR WHILE INITIALIZING SIMDDT/

	FI

	;ERROR FROM RTS PROCESSING
	;UPDATE STATUS SWITCHES
	;INITIALIZE SIMDDT

DSINE2:	;FATAL ERROR IN DEBUG MODE
	MDSIS
	SETOFA	YDSDBG		;ERROR MODE

	;CHANGE CURRENT FILE
	IF
		IFOFFA	YDSTTY
		GOTO	FALSE				;CURRENT FILE IS NOT TTY
		L	XWAC1,YSYSOU(XLOW)			;SYSOUT FILE OBJECT
		IFOFF	ZFIOPN(XWAC1)
		GOTO	FALSE
		IFON	ZFITTY(XWAC1)
		GOTO	FALSE					;SYSOUT IS TTY
		HLLZ	X0,YDSENR(XLOW)				;[41]
		JUMPN	X0,FALSE				;[41] DO NOT CLOSE SYSOUT 
	THEN
		;OUTPUT SYSOUT IMAGE
		LI	XDRTSR,IOOG
		DEXEC	DSCRTU			;OUTPUT LAST IMAGE
		IFONA	YDSUFR
		GOTO	FALSE			;I/O ERROR

		;SET CURRENT FILE TO SYSOUT
		LD	XWAC2,ZTV%S(XDINT)
		STD	XWAC2,OFFSET(ZFIIMG)(XWAC1)

		ST	XWAC1,YDSUFO(XLOW)
		SETOFA	YDSTTY

	FI
	
	SETOFA	YDSUFR
	ST XDSWIT,YDSWIT(XLOW)

		;CREATE RTS ERROR MESSAGE

	SKIPE	0,YFOXCB(XLOW)
	L	XCB,YFOXCB(XLOW)		;UPDATE XCB IF FORTRAN EXTERNAL ROUTINE
	MDSOFT			;BLANK LINE IF NOT LAST LINE WAS BREAKOUTIMAGE
	MDSPM	QMINER		;FIRST PART OF MESSAGE
	PJOB	XWAC3,			;FIND JOB NUMBER

	MTXPI				;PUT INTEGER IN OUTTEXT
	OUTCHB
	LI	X1,LAB(ZKWAT)
	DEXEC	DSPSKB
	OUTCHB

	L	XDSTA,YDSEAD(XLOW)	;FETCH ADDRESS OF ERROR

	DEXEC	DSPLE		;PUT STATEMENT ID IN TEXT
				;AND UPDATE ENVIRONMENT


	MDSOFT			;OUTPUT FIRST LINE 
				;STANDARD ERROR TEXT

	;FETCH ERROR NUMBER
	HRRZ	XDMN,YDSENR(XLOW)
	MDSOBM			;CREATE ERROR TEXT

	IF
		IFOFF	ZDNTER(XCB)
		GOTO	FALSE		;XCB BLOCK NOT TERMINATED
	THEN
		LI	XDMN,QMINTB	;TERMINATED BLOCK
		MDSOBM
		SETON	SWNOGC(XLOW)
	FI

		;[41] GIVE MESSAGE: TO CONTINUE TYPE PROCEED
	HLLZ	X1,YDSENR(XLOW)
	IF
		JUMPE	X1,FALSE
	THEN	;PROCEED ALLOWED
		ST	X1,LABB(YDSSENR)		;SAVE IN CASE NEW ERROR OCCURS
		MDSVOM	QMTCTP
	FI			;[41] END

	;ACCEPT COMMANDS
	BRANCH	LAB(DSCM)
DSINB.:
	;STARTS SIMDDT PROCESSING AFTER A BREAKPOINT INSTRUCTION
	;HAS BEEN EXECUTED. CALLED FROM THE RTS ROUTINE
	;OCUU. LOCATES BREAKPOINT AND EXITS TO DSBP.


	MDSIS				;INITIALIZE
	;SAVE XIAC IN LOW SEG
	;BEFORE ENTRY ALL ACCUMULATORS ARE SAVED IN YUUOAC(XLOW)

	L	X1,YUUOAC+XLOW(XLOW)
	ST	X1,YDSIAC(XLOW)


	;FETCH BREAKPOINT NUMBER IN X1

	HRRZ	X1,.JBUUO

	ST	X1,LABB(YDSCZBR)	;SAVE CURRENT BREAKPOINT NUMBER


IF
	CAIL	X1,QBRN*2
	GOTO	TRUE		 	;NO BREAKPOINT
	
	;UPDATE YDSCZL
	ADDI	X1,LABB(DSZBRF)
	LF	XDZLN,ZBRZLN(X1)
	JUMPG	XDZLN,FALSE	
THEN
	;INVALID BREAKPOINT
	LI	XDMN,QMINNB
	MDSOBM
	BRANCH LAB(DSTERM)
FI
	

	LF	X0,ZBRINS(X1)		;FETCH BREAKPOINT INSTRUCTION
	ST	X0,LABB(YDSLEAVE)
	LF	X0,ZLNADR(XDZLN)
	AOJ	X0,
	ST	X0,YDSBCOM(XLOW)	;RETURN ADDRESS

	;CHECK IF YDSZLN AND YDSCZS ARE VALID
	L	X1,YDSZLN(XLOW)
IF
	CAMN	X1,YDSZLA(XLOW)
	GOTO	FALSE
THEN
	;EXTERNAL LINE NUMBER TABLE
	LF	X1,ZLNADF(X1)		;FETCH PROTOTYPE
	LF	X1,ZPRSYM(X1)		;FETCH SYMBOL TABLE
	LF	X1,ZSMZLN(X1)
FI
IF
	CAMGE	XDZLN,X1
	CAMG	XDZLN,LABB(YDSCZS)
	GOTO	FALSE				
THEN	;VALID ENVIRONMENT
	
	LOOP
		SOJ	XDZLN,
	AS
		SKIPL	0,(XDZLN)
		GOTO	TRUE
	SA

	ST	XDZLN,LABB(YDSCZL)
	DEXEC	DSPLEE		;[2] UPDATE VARIABLES
ELSE
	;LOCATE ENVIRONMENT
	LF	XDSTA,ZLNADR(XDZLN)
	DEXEC	DSPLE
	DEXEC	DSONL			;REMOVE TEXT FROM OUTPUT BUFFER
FI

	BRANCH	LAB(DSBP)		;TO BREAKPOINT PROCESSING
DSINR.:
	;STARTS SIMDDT PROCESSING AFTER THE USER PROGRAM EXECUTION WAS
	;INTERRUPTED VIA THE ↑C REENTER COMMANDS OR AFTER THE CONTINUE
	;COMMAND WAS ISSUED AFTER PROGRAM EXIT. CALLED FROM THE RTS-ROUTINE
	;OCRE. WRITES A MESSAGE GIVING THE INTERRUPION POINT.

	IF
		IFOFF	YDSACT(XLOW)
		GOTO	FALSE
	THEN
		;SIMDDT PROCESSING WAS INTERRUPTED
		;CONTINUE
		RETURN
	FI

	MDSIS				;INITIALIZE
	SETONA	YDSREE			;ENTRY VIA DSINR
	SETOM	,LABB(YDSSENR)		;[41] PROCEED POSSIBLE
	SETONA	YDSSTA			;EXIT VIA RTS FROM PROCEED
	IF
		HLRZ	X0,.JBSA
		CAME	X0,.JBFF
		GOTO	FALSE
	THEN
		SETOFA	YDSDBG			;ERROR MODDE IF PROGRAM EXIT
						; ALREADY PERFORMED
		SETONA	YDSTTY
	FI

	ST	XDSWIT,YDSWIT(XLOW)


	DEXEC	DSOFT			;CREATE CARRIAGE RETURN LINE FEED
	MDSPM	QMINRE
	L	XDSTA,YDSCAD(XLOW)	;ADDRESS OF ↑C INTERRUPT
					;FROM USER POINT OF VIEUW
	DEXEC	DSPLE			;PUT STATEMENT ID IN TEXT
					;AND UPDATE ENVIRONMENT
	MDSOFT
	BRANCH	LAB(DSCM)
DSINC:
	;THIS ROUTINE IS ENTERED VIA THE STATIC LOW AREA ON RETURN FROM
	;A RTS-ROUTINE THAT MAY CAUSE GARBAGE COLLECTION OR DETECT AN ERROR.
	;RELOCATES THE SIMDDT STACK AND I/O TEXT VARIABLES IF GARBAGE COLLECTION	
	;HAS BEEN PERFORMED WRITES ANY ERROR MESSAGES REPLACING ZYQ WITH ZYD.

	L	XDSWIT,YDSWIT(XLOW)
DSINC1:	;ENTRY AFTER ERROR  FROM DSINE ROUTINE

	LI	XDZBR,LAB(DSZBRS)
	LI	XDSTK,LABB(DSZBRK)
	HRLI	XDSTK,-QSTAKL+1		;RESTORE XDSTK
	L	X1,XDZBR
	SUB	X1,LABB(YDSOBR)		;CALCULATE GARBAGE COLLECTION MOVE

	L	X0,YSAGCN(XLOW)
	CAMN	X0,LABB(YDSOSAGCN)
	JUMPE	X1,LAB(DSINC2)		;NO GARBAGE COLLECT PERFORMED		
	ADDM	X1,LABB(YDSOST)		;UPDATE STACK POINTER

LOOP
	L	X0,1(XDSTK)		

	IF
		HRRZ	X2,1(XDSTK)
		SUB	X2,YDSBAS(XLOW)
		ADD	X2,X1		;[2R] YDSBAS WAS RELOCATED BY SAGC
		JUMPL	X2,FALSE
		CAIL	X2,QDSLG
		GOTO	FALSE
	THEN	;INSIDE SIMDDT
		L	X0,1(XDSTK)
		ADD	X0,X1
	FI
	DSTACK	X0			;ASSUME ALL STACK ENTRIES ARE TO BE
					;RELOCATED
AS
	CAME	XDSTK,LABB(YDSOST)
	GOTO	TRUE
SA
	DEXEC	DSBUTX			;INITIATE TEXT VARIABLES
DSINC2:
	L	XDSTK,LABB(YDSOST)
	SETOFA	YDSGCO

	IF
		IFOFFA	YDSERE
		GOTO	FALSE
	THEN
		;[2]
		HRRZ	X0,(XDSTK)
		CAIN	X0,LAB(DSOF02)
		SETONA	YDSTTY		;I/O ERROR DO NOT USE FILE AGAIN
		
		IF
			HRRZ	XDMN,YDSENR(XLOW)	;ERROR NUMBER
			CAIN	XDMN,76			;[41] too long line
			GOTO	FALSE			;SKIP MESSAGE IF ERROR
							;EXTERNAL IMAGE TOO LONG
		THEN
			;CREATE MESSAGE
			MDSOFT			;BLANK LINE
			HRRZ	XDMN,YDSENR(XLOW)	;[41]
			MDSOBM
		ELSE					;[41]
			SUBI	XWAC1,4			;[41] SEE ERROR RECOVERY IN IOIG
		FI

		UNSTK	X0			;LAST RTS STACK ENTRY NOT 
						;TO BE USED
		L	XPDP,LABB(YDSOXPDP)
		IFONA	YDSTXC
		BRANCH	LAB(DSCTX1)		;ERROR IN TEXT CALL

	ELSE
		SETOFA	YDSUFR			;SWITCH OFF ONLY IF I/O CALL OK
	FI
	ST	XDSWIT,YDSWIT(XLOW)
	DRETUR

DSINM::	;ENTRY POINT WHEN SIMDDT WAS LOADED/LINKED TOGETHER WITH MAIN PROGRAM
	;
	HRRZ	X1,.JBSA		;FETCH DSINM ADDRESS
	SUBI	X1,DSINM-DSSTART	;CALCULATE BASE ADDRESS DSSTART

	BRANCH	.MAIN+2			;TO MAIN PROGRAM START ADDRESS
					;X1 HOLDS SIMDDT BASE




DSINS.:	;CALLED FROM SIMRTS WHEN OLD BREAKPOINTS MUST BE RESET
	;THAT IS AT START AND REENTER AFTER PROGRAM EXIT
	;RETURN TO SIMRTS VIA XPDP STACK

	EXEC	LAB(DSISRB)
	RETURN
	EPROC
	SUBTTL	ZKW RECORDS

	;THE KEYWORD TABLE ZKW CONTAINS ONE ENTRY FOR EACH SPECIAL IDENTIFIER
	;OR OPERATOR THAT SIMDDT MUST RECOGNIZE WHILE SCANNING A COMMAND.
	;THE ENTRY CONTAINS NAME, CONTROL BITS, CONTROL CODES AND A ROUTINE
	;ADDRESS FOR THOSE KEYWORDS THAT MAY START A COMMAND.

DEFINE	CZKW	(MNM1,MNM2,MLNE,MDBG,MERR,MTYP,MCOD,MADR)
	<
		<MLNE>B0+<MDBG>B1+<MERR>B2+<MTYP>B5+<MCOD>B17+<MADR>B35
		IFNB <MNM1><SIXBIT	"MNM1">
		IFNB <MNM2><SIXBIT	"MNM2">
	>

	;CREATE TABLE
ZKW:
	CZKW	,,,1,,QZKWTR,QACTOP,<313000>	;CAMLE
	SIXBIT	"<"
	CZKW	,,,1,,QZKWTR,QACTOP,<311000>	;CAML
	SIXBIT	"<="
	CZKW	=,,,1,,QZKWTR,QACTOP,<316000>	;CAMN
	CZKW	=/=,,,1,,QZKWTR,QOTOP,<312000>	;CAME
	CZKW	==,,,1,,QZKWTR,QOTOP,<316000>	;CAMN
	CZKW	,,,1,,QZKWTR,QACTOP,<315000>	;CAMGE
	SIXBIT	">"
	CZKW	,,,1,,QZKWTR,QACTOP,<317000>	;CAMG
	SIXBIT	">="
	CZKW	@,,,1,1,QZKWTS,,<LAB(DSGET)>	;[41] DEFINE INPUT FILE
ZKWAT:	CZKW	AT,,,1,,QZKWTS,,<LAB(DSAT)>
	CZKW	ALL,,,1,1,QZKWTS,,<LAB(DSAL)>
ZKWSKA:	CZKW	ARRAY,,,1,1,QZKWTI		;[41]
	CZKW	BREAKS,,,1,1,QZKWTS,,<LAB(DSBR)>
	CZKW	CHAIN,,,1,1,QZKWTS,,<LAB(DSCH)>
ZKWCLO:	CZKW	CLOSE,,,1,1,QZKWTS,,<LAB(DSCL)>	;[41]
	CZKW	DISPLA,Y,1,1,1,QZKWTS,,<LAB(DSDP)>	;[2]
	CZKW	EQ,,,1,,QZKWTR,QACTOP,<316000>	;CAMN
	CZKW	EQV,,,1,,QZKWTR,QBOP,<316000>	;CAMN
	CZKW	EXIT,,,1,1,QZKWTS,,<LAB(DSEX)>
ZKWFAL:	CZKW	FALSE,,,1,,QZKWTQ,QBOOLEAN,0
ZKWSKG:	CZKW	GC,,,1,1,QZKWTI			;[41]
	CZKW	GE,,,1,,QZKWTR,QACTOP,<317000>	;CAMG
;	CZKW	GET,,,1,1,QZKWTS,,<LAB(DSNOTI)>	[41]
	CZKW	GT,,,1,,QZKWTR,QACTOP,<315000>	;CAMGE
	CZKW	HELP,,,1,1,QZKWTS,,<LAB(DSHE)>
	CZKW	I,,,1,,QZKWTS,,<LAB(DSIP)>	;[2] SHORT FORM OF INPUT
ZKWIS:	CZKW	IS,,,1,,QZKWTR,QOOP
ZKWIN:	CZKW	IN,,,1,,QZKWTR,QOOP
ZKWIF:	CZKW	IF,,,1,,QZKWTI
	CZKW	INPUT,,,1,,QZKWTS,,<LAB(DSIP)>
	CZKW	INSPEC,T,1,1,1,QZKWTS,,<LAB(DSPC)>	;[2]
ZKWIFC:	CZKW	IFCHAN,GED,1,1,,QZKWTI
	CZKW	LE,,,1,,QZKWTR,QACTOP,<311000>	;CAML
	CZKW	LT,,,1,,QZKWTR,QACTOP,<313000>	;CAMLE
	CZKW	NE,,,1,,QZKWTR,QACTOP,<312000>	;CAME
	CZKW	NOARRA,YS,1,1,1,QZKWTS,,<LAB(DSNOTI)>	;[41]
ZKWNON:	CZKW	NONE,,,1,,QZKWTQ,QREF,NONE
	CZKW	NOPROC,EED,1,1,1,QZKWTS,,<LAB(DSNOPR)>	;[41]
ZKWNOT:	CZKW	NOTEXT,,,1,,QZKWTQ,QTEXT,0
	CZKW	OUTPUT,,,1,1,QZKWTS,,<LAB(DSOP)>
ZKWPRO:	CZKW	PROCEE,D,1,1,1,QZKWTS,,<LAB(DSPR)>	;[41] ALLOW PROCEED IN ERROR MODE
	CZKW	RESET,,,1,1,QZKWTC,,<LAB(DSPCRT)>	; [2]
ZKWREM:	CZKW	REMOVE,,,1,,QZKWTS,,<LAB(DSRE)>
	CZKW	RETURN,,,1,1,QZKWTC,,<LAB(DSPCRN)>	; [2]
	CZKW	ST,,,1,1,QZKWTS,,<LAB(DSST)>		; [2] [41] SHORT FORM OF STOP
ZKWSTO:	CZKW	STOP,,,1,1,QZKWTS,,<LAB(DSST)>	;[41]
	CZKW	START,,,1,1,QZKWTC,,<LAB(DSPCST)>	; [2]
	CZKW	SCHEDU,LED,1,1,1,QZKWTS,,<LAB(DSSC)>
ZKWSKT:	CZKW	TEXT,,,1,1,QZKWTI		;[41]
ZKWTHI:	CZKW	THIS,,,1,1,QZKWTI		;[41]
ZKWTRU:	CZKW	TRUE,,,1,,QZKWTQ,QBOOLEAN,1
	CZKW	TTY,,,1,1,QZKWTI
	CZKW	UP,,,1,1,QZKWTC,,<LAB(DSPCUP)>	; [2]
	CZKW	USE,,,1,1,QZKWTS,,<LAB(DSUS)>
	CZKW	VARIAB,LES,1,1,1,QZKWTS,,<LAB(DSVA)>
ZKWQUA:	CZKW	QUA,,,1,1,QZKWTI
ZKWL:	;LAST ZKW ENTRY
	CZKW	,,,1,,QZKWTR,QACTOP,<312000>	;CAME
	SIXBIT	"\="

	;DUMMY ENTRY
ZKWBLOCK:CZKW	BLOCK,
ZKWMAIN:CZKW	MAIN,

	;[2]
	;SYMBOL TABLE ZSD ENTRY FOR MAIN TEXT PROCEDURE

DSZSDM:	DZSD	MAIN,QIMAIN,QTEXT,,QPROCEDURE,0
	SUBTTL	SIMDDT RECORDS 	,FIELD AND SWITCH DEFINITIONS
		;FIELD AND SWITCH DEFINITIONS

		;ZKW ,KEYWORD TABLE

	DSW	(ZKWLNE,0,0,XDZKW)	;FLAG SET IF ZKWNM2 PRESENT
	DSW	(ZKWDBG,0,1,XDZKW)	;FLAG SET IF KEYWORD ALLOWED IN DEBUG MODE
	DSW	(ZKWERR,0,2,XDZKW)	;FLAG SET IF KEYWORD ALLOWED IN ERROR MODE
	DF	(ZKWTYP,0,3,5)		;TYPE OF KEYWORD,QZKWTS,...
	DF	(ZKWCOD,0,12,17)	;XDBAS IS PLACED IN THIS FIELD
					;IF ZKWTYP IS QZKWTS
					;THIS FIELD GIVES THE TYPE OF A RELATIONAL
					;OPERATOR OR THE TYPE OF A CONSTANT
	DF	(ZKWADR,0,18,35)	;ADRESS OF COMMAND ROUTINE IF QZKWTS
					;INSTRUCTION (LEFT PART) TO BE USED
					;IF RELATIONAL OPERATOR ENTRY
	DF	(ZKWVAL,0,18,35)	;VALUE OF CONSTANTS TRUE, FALSE, NOTEXT 
					;AND NONE
	DF	(ZKWNM1,1,36,35)	;SIXBIT NAME, SIX FIRST LETTERS
	DF	(ZKWNM2,2,36,35)	;SIXBIT NAME, SIX LAST LETTERS


		;ZBR,BREAKPOINT RECORD

	DF	(ZBRZBE,0,18,17)	;POINTER TO ZBE ENTRY
	DF	(ZBRZLN,0,18,35)	;POINTER TO ZLN ENTRY
	DF	(ZBRINS,1,36,35)	;BREAKPOINT INSTRUCTION


		;ZBE,BREAKPOINT ENTRY

	DF	(ZBEZBE,0,18,17)	;POINTER TO NEXT ZBE ENTRY 
	DSW	(ZBESTO,0,18)		;STOP FOUND IN COMMAND
	DSW	(ZBESTB,0,19)		;STRING FOUND IN COMMAND
	DF	(ZBETYP,0,4,23)		;TYPE OF ZBE ENTRY
					;QBEAT,QBEATL,QBEATC,QBEATR OR QBECON
	DF	(ZBESTR,0,36,35)	;STRING FIRST 5 CHARACTERS
	DF	(ZBENIN,0,18,17)	;INITIAL VALUE OF COUNTER N
	DF	(ZBENVA,0,18,35)	;CURRENT VALUE OF COUNTER N
	DF	(ZBEZSD,0,18,35)	;POINTER TO ZSD ENTRY
	DSW	(ZBEIDL,0,0)		;NOT LAST IDENTIFICATION
	DSW	(ZBETHI,0,1)		;[41] THIS USED IN IDENTIFICATION
					;[41] ZBEZSD POINTS AT CLASS PROTOTYPE
	DSW	(ZBEQUA,0,14)		;[41] QUA USED IN IDENTIFICATION
	DSW	(ZBEIDD,0,2)		;DOT PRESENT AFTER IDENTIFIER1
	DSW	(ZBESTA,0,15)		;[41] * PRESENT INSTEAD OF IDENTIFIER
	DF	(ZBEEBL,0,7,9)		;EFFECTIVE BLOCK LEVEL
	DF	(ZBESUN,0,4,13)		;NUMBER OF SUBSCRIPTS
	DF	(ZBEVSU,0,36,35)	;SUBSCRIPT VALUE
	DF	(ZBEVAL,0,36,35)	;VALUE OF CONSTANT OR VARIABLE
	DF	(ZBEROP,0,18,17)	;POINTER TO RELATION OPERATOR ENTRY IN ZKW
	DSW	(ZBETCI,0,18)		;FLAG SET IF CONSTANT FOLLOWS 
					;RELATION OPERATOR
	;ERROR MESSAGE DEFINITIONS
	;SIMEDS CONTAINS TABLE
	;START OF TABLES  IS DSERRM
YDSDLN=DSERRM			;NUMBER OF WORDS  IN EDL TABLE
YDSDN=DSERRM+1			;NUMBER OF WORDS IN ED TABLE
YDSMN=DSERRM+2			;NUMBER OF WORDS IN EM TABLE
YDSMIN=DSERRM+3			;NUMBER OF WORDS IN EMI TABLE
YDSEDL=DSERRM+4			;START OF EDL TABLE
YDSED=YDSEDL+↑D15		;START OF ED TABLE ,MAX LENGTH OF WORD IS 15

DF	(YDSDLC,0,18,17)	;NUMBER OF  PRECEDING CHARS.
DF	(YDSDLW,0,18,35)	;NUMBER OF PRECEDING WORDS


	;[2] DUMMY LINE NUMBER TABLE TO BE USED WITH STANDARD CLASSES
YDSZLS:	XWD	520000,0		;CLASSZPROTOTYPE ENTRY
	XWD	0,0		;DUMMY LINE 0
	XWD	600000,0	;END OF TABLE ,ADDRESSES FILLED BY DSPC ROUTINE