Trailing-Edge
-
PDP-10 Archives
-
decuslib20-03
-
decus/20-0078/rts/ss.mac
There is 1 other file named ss.mac in the archive. Click here to see a list.
comment;
Module SS (CLASS SIMSET)
========================
The SS module is concerned with attributes of the SIMSET class.
The following is contained in the SS module:
;
intern .SSCA ; Procedure CARDINAL.
intern .SSCL ; Procedure CLEAR.
intern .SSEY ; Procedure EMPTY.
intern .SSFO ; Procedure FOLLOW.
intern .SSHD ; Prototype of class HEAD.
intern .SSIT ; Procedure INTO.
intern .SSLG ; Prototype of class LINKAGE.
intern .SSLK ; Prototype of class LINK.
intern .SSOU ; Procedure OUT.
intern .SSPC ; Procedure PRECEDE.
intern .SSPD ; Procedure PRED.
intern .SSSC ; Procedure SUC.
ENTRY .SSST ; Prototype of class SIMSET.
; of class attributes in SIMSET or SIMULATION.
comment;
The following procedures are implemented by inline code:
FIRST, LAST, PREV
For most algorithms, see CB 14.1 ff. SIMSET, LINKAGE, HEAD and
LINK are treated as ordinary classes by the system. The linkage
part contains the two links ZLGSUC and ZLGPRE.
Author: Lars Enderin Feb 1974
VERSION: 1
;
SALL
SEARCH SIMMAC,SIMMCR,SIMRPA
RTITLE SS
ERRMAC SS
MACINIT
SUBTTL LINKAGE attributes
comment;
.SSPD pred
.SSSC suc
Purpose
-------
To implement the attributes of class LINKAGE.
Input
-----
Xtop is a reference to the linkage object.
Calling sequence:
MOVEI XTAC,Xtop
EXEC .SSxx
Output
------
REF(link) in Xtop.
Function
--------
.SSPD, .SSSC :
Load Xtop.ZLGPRE (.SSPD) or Xtop.ZLGSUC (.SSSC). If this reference is
to a subclass of LINK (.SSLK), return the reference in Xtop, otherwise
return NONE in Xtop.
;
.SSPD: PROC
L XSAC,(XTAC)
LF XSAC,ZLGPRE(XSAC)
GOTO SSPDSC
EPROC
.SSSC: PROC
L XSAC,(XTAC)
LF XSAC,ZLGSUC(XSAC)
SSPDSC: L XSAC
IF ;Not NONE
CAIN XSAC,NONE
GOTO FALSE
THEN
LF XSAC,ZBIZPR(XSAC)
WHILE
JUMPE XSAC,FALSE
DO
CAIN XSAC,.SSLK
GOTO SSPDOK
LF XSAC,ZCPZCP(XSAC)
OD
LI NONE
FI
SSPDOK: ST (XTAC)
RETURN
EPROC
SUBTTL HEAD attributes
comment;
.SSCA CARDINAL
.SSCL CLEAR
.SSEY EMPTY
Purpose
-------
To implement the HEAD attributes.
Input
-----
REF(HEAD) in Xtop according to the calling sequence:
MOVEI XTAC,Xtop
EXEC .SSxx
.SSCL, however, has its parameter in XWAC1 and is called:
EXEC .SSCL
since it is a pure procedure.
Output
------
.SSCA returns number of LINK objects.
.SSEY returns -1 if no LINK objects, otherwise 0.
Return value is in Xtop.
Function
--------
.SSCA: Follow ZLGSUC until ZLGSUC == THIS HEAD and count LINK
objects along the way.
.SSCL: Stepping along ZLGSUC links starting at ZLGSUC(XWAC1),
set ZLGSUC == ZLGPRE == NONE in all encountered LINK objects,
i e as long as ZLGSUC =/= XWAC1.
Set ZLGSUC(XWAC1) == ZLGPRE(XWAC1) == XWAC1.
.SSEY: True (-1) if ZLGSUC == ZLGPRE == THIS HEAD.
;
.SSCA: PROC
L XSAC,(XTAC)
SETZ
LOOP
LF XSAC,ZLGSUC(XSAC)
AS
CAME XSAC,(XTAC)
AOJA TRUE
SA
ST (XTAC)
RETURN
EPROC
.SSCL: PROC
L [NONE,,NONE]
LF XSAC,ZLGSUC(XWAC1)
WHILE
CAIN XSAC,(XWAC1)
GOTO FALSE
DO
LF XTAC,ZLGSUC(XSAC)
WSF ,ZLGSUC(XSAC)
L XSAC,XTAC
OD
SF XWAC1,ZLGPRE(XWAC1)
SF XWAC1,ZLGSUC(XWAC1)
RETURN
EPROC
.SSEY: PROC
L XSAC,(XTAC)
LF XSAC,ZLGSUC(XSAC)
SETZ
CAMN XSAC,(XTAC)
SETO
ST (XTAC)
RETURN
EPROC
SUBTTL LINK attributes
comment;
.SSFO FOLLOW
.SSIT INTO
.SSOU OUT
.SSPC PRECEDE
Purpose
-------
To implement the attributes of class LINK.
Input
-----
REF(link) in XWAC1. REF(linkage) in XWAC2 (not for .SSOU). Call:
EXEC .SSxx
Function
--------
See CB 14.1.3. .SSFO, .SSIT and .SSPC start by taking out
(.SSOU) the link object (XWAC1) from any set in which it is a
member. If XWAC2 is NONE, nothing more happens, otherwise XWAC1
is inserted in the set after (.SSFO) or before (.SSPC, .SSIT)
XWAC2. .SSIT is identical to .SSPC except for qualification of
XWAC2 and can share the same code.
.SSOU removes the linkage object represented by XWAC1 from any
set of which it is a member, i e if ZLGSUC(XWAC1) =/= NONE,
ZLGSUC(ZLGPRE(XWAC1)) :- ZLGSUC(XWAC1) and ZLGPRE(ZLGSUC(XWAC1))
:- ZLGPRE(XWAC1).
;
DEFINE .OUT. <LF XSAC,ZLGSUC(XWAC1)
CAIE XSAC,NONE
EXEC SSOUT
>
.SSFO: PROC
.OUT.
CAIN XWAC2,NONE
RETURN
LF XWAC3,ZLGSUC(XWAC2)
CAIN XWAC3,NONE
RETURN
SF XWAC2,ZLGPRE(XWAC1)
SF XWAC3,ZLGSUC(XWAC1)
SF XWAC1,ZLGPRE(XWAC3)
SF XWAC1,ZLGSUC(XWAC2)
RETURN
EPROC
.SSIT: ;SAME CODE AS .SSPC
.SSPC: PROC
.OUT.
CAIN XWAC2,NONE
RETURN
LF XWAC3,ZLGPRE(XWAC2)
CAIN XWAC3,NONE
RETURN
SF XWAC2,ZLGSUC(XWAC1)
SF XWAC3,ZLGPRE(XWAC1)
SF XWAC1,ZLGSUC(XWAC3)
SF XWAC1,ZLGPRE(XWAC2)
RETURN
EPROC
.SSOU: PROC
LF XSAC,ZLGSUC(XWAC1)
CAIN XSAC,NONE
RETURN
SSOUT: LF XTAC,ZLGPRE(XWAC1)
SF XTAC,ZLGPRE(XSAC)
SF XSAC,ZLGSUC(XTAC)
L [NONE,,NONE]
WSF ,ZLGSUC(XWAC1)
RETURN
EPROC
SUBTTL SIMSET, HEAD, LINKAGE, LINK
comment;
.SSHD HEAD
.SSLG LINKAGE
.SSLK LINK
.SSST SIMSET
Purpose
-------
Implement prototypes and corresponding actions for SIMSET and
related classes.
Function
--------
Used at object generation. The declaration coding for .SSLG,
denoted by SSLG%D, sets ZLGSUC==ZLGPRE==NONE. The initial
actions of .SSHD (SSHD%S) will make ZLGSUC==ZLGPRE==XRAC, i e ==
THIS linkage. Otherwise, no overt action is taken.
;
;======== LINKAGE ========
IFL <SSLG-400K>,<D%SSLG>
;ACTIONS:
SSLG%D: LI XSAC,0
L XWAC1,[NONE,,NONE]
WSF XWAC1,ZLGSUC(XCB)
JSP CPCD
SSLG%S:
LI XSAC,0
JSP CPCI
SSLG%I: JSP CPE0
SSLG%M= 0 ;map undefined
;SYMBOL TABLE
;------------
DZSMCL LINKAGE,SSLG
;[22] ADD ZSDSPI CODE AS SECOND PARAMETER
DZSD SUC,QISUC,QREF,,QPROCEDURE,2,.SSLK
DZSD PRED,QIPRED,QREF,,QPROCEDURE,2,.SSLK
DZSD PREV,QIPREV,QREF,,QPROCEDURE,2,.SSLG ;[12] Add PREV in the sym tab
Z
;======== HEAD ========
IFL <SSHD-400K>,<D%SSHD>
;ACTIONS:
SSHD%D: LI XSAC,1
JSP CPCD
SSHD%S: SF XCB,ZLGSUC(XCB)
SF XCB,ZLGPRE(XCB)
LI XSAC,1
JSP CPCI
SSHD%I: JSP CPE0
SSHD%M= 0 ;map undefined
;SYMBOL TABLE
;------------
DZSMCL HEAD,SSHD
DZSD FIRST,QIFIRST,QREF,,QPROCEDURE,2,.SSLK
DZSD LAST,QILAST,QREF,,QPROCEDURE,2,.SSLK
DZSD EMPTY,,QBOOLEAN,,QPROCEDURE,0
DZSD CARDINAL,,QINTEGER,,QPROCEDURE,0
DZSD CLEAR,,QNOTYPE,,QPROCEDURE,0
Z
;======== LINK ========
IFL <SSLK-400K>,<D%SSLK>
;ACTIONS:
SSLK%D: LI XSAC,1
JSP CPCD
SSLK%S:
LI XSAC,1
JSP CPCI
SSLK%I: JSP CPE0
SSLK%M= 0 ;map undefined
;SYMBOL TABLE
;------------
DZSMCL LINK,SSLK
DZSD OUT,,QNOTYPE,,QPROCEDURE,0
DZSD FOLLOW,,QNOTYPE,,QPROCEDURE,0
DZSD PRECEDE,,QNOTYPE,,QPROCEDURE,0
DZSD INTO,,QNOTYPE,,QPROCEDURE,0
Z
;======== SIMSET ========
IFL <SSST-400K>,<
EXTERN .SIMLV,.SIMVL
D%SSST>
;ACTIONS:
SSST%D: LI XSAC,0
JSP CPCD
SSST%S:
LI XSAC,0
JSP CPCI
SSST%I: JSP CPE0
SSST%M= 0 ;map undefined
;SYMBOL TABLE
;------------
.SSLK ;[151] Insert references to subclasses of SIMSET
.SSHD ;[151]
DZSMCL SIMSET,SSST
DZSD LINKAGE,,QNOTYPE,,QCLASS,0
DZSD HEAD,,QNOTYPE,,QCLASS,0
DZSD LINK,,QNOTYPE,,QCLASS,0
Z
LIT
END