Google
 

Trailing-Edge - PDP-10 Archives - klad_sources - klad.sources/dskda2.mac
There are no other files named dskda2.mac in the archive.
SUBTTL	SIMULATOR MACHINE REGISTER PRINT
; **********************************************************************

IFNDEF	SIMLST,<XLIST>

T=1				;RESET T'S AC DEFINITION

; **********************************************************************
;*SENTRY - SIMULATOR INITIALIZATION AND BREAK SETUP
; **********************************************************************

SENTRY:	SETZM	PNTCTL#		;CLEAR PRINT CONTROL

	SKIPN	USER		;USER MODE ?
	JRST	.+5		;NO
	MOVEI	0
	SKIPN	MONTYP		;YES, TOPS-10 ?
	CALL	[SIXBIT/SETUWP/] ;YES
	JFCL

	SKIPE	SIMONE#		;SET BREAK ONLY ON LOAD
	JRST	SX1

	MOVE	0,SIMBRK	;PATCH TO SIMULATOR FOR PRINTOUT
	MOVEM	0,SIMPN1+1

	MOVE	0,[JRST SIMPN1]
	MOVEM	0,SIMBRK

	MOVE	0,[JRST	ERRPNT]
	MOVEM	0,ERR+1

	SETOM	SIMONE
; **********************************************************************
;*SX1 - CLEAR SIMULATOR PSEUDO REGISTERS
; **********************************************************************

SX1:	SETZB	AR,SVAR#	;CLEAR PSEUDO REGISTERS
	SETZB	MQ,SVMQ#
	SETZB	BR,SVBR#
	SETZB	AD,SVAD#
	SETZB	MB,SVMB#
	SETZB	PC,SVPC#
	SETZB	MA,SVMA#
	SETZB	SC,SVSC#
	SETZM	ARX
	SETZM	FE
	SETZM	SA
	SETZM	AB
	SETZM	ADX
	SETZM	SVADX#
	SETZM	SVFM#
	SETZM	SVARX#
	SETZM	SVFE#
	SETZM	SVSA#
	SETZM	SVAB#
	JRST	SIMGO		;GO TO SIMULATOR

SIMPN1:	GO	MRPNT
	0
	JRST	SIMBRK+1
	IFNDEF	SIMASB,<

; **********************************************************************
;*MUOEXC - SPECIAL USER MODE MONITOR UUO EXECUTION
; **********************************************************************

MUOEXC:	777000,,USR424		;MUUO EXECUTE INSTRUCTION
	JRST	2,@USR425	;RETURN TO OBJECT SEQUENCE

USR420:	HALT			;PAGE FAULT TRAP
USR421:	JFCL			;ARITH TRAP
USR422:	HALT			;PDL OV TRAP
USR423:	HALT			;TRP 3 TRAP

USR424:	0			;MUUO STORAGE
USR425:	0			;C(PC) OF MUUO

USR427:	0			;USER PAGE FAIL WORD

USR436:	MUOEXC			;MUUO EXECUTION ADR, PUBLIC, NO TRAP
USR437:	MUOEXC			;		     PUBLIC, TRAP
>

INPC:	0,,30000		;EXEC MODE, STARTING ADDRESS
MASK:	-1
INSTR:	0
CNTLPC:	0
UPRPC:	0,,-1
SWITCH:	0

ACS:	BLOCK	20		;SIMULATED AC'S
; **********************************************************************
;*MRPNT - MACHINE REGISTER PRINT
;*	THIS ROUTINE PRINTS THE CONTENTS OF THE SEVERAL
;*	PSEUDO MACHINE REGISTERS AT VARIOUS TIMES IN
;*	THE INSTRUCTION CYCLE.
; **********************************************************************

MRPNT:	PUT	0		;SAVE 5 AC'S
	PUT	T
	PUT	T1
	PUT	T2
	PUT	T3

	HRRZ	T,STATE		;GET STATE REGISTER
	CAMN	T,STATSV#	;SAME AS PREVIOUS STATE ?
	JRST	HUNGCK		;YES, CHECK FOR HUNG

	MOVEM	T,STATSV
	MOVEI	0,^D260		;SETUP MAXIMUM TIME
	MOVEM	0,HNGCNT#	;FOR ONE TIME STATE

MRPNT3:	CAIN	T,IT0		;IS STATE IT0
	GO	IRPNT		;YES, PRINT PC AND INSTRUCTION

	SKIPN	PNTCTL		;PRINT CONTROL SET ?
	JRST	MRPNT2		;NO,EXIT

	HRRZ	T,STATE
	CAIN	T,IT1		;IS STATE IT1 ?
	GO	INTPNT		;YES, SAVE INITIAL CONDITIONS

	MOVE	0,CONSW
	TRNN	0,PNTMS		;PRINT MACHINE STATES ?
	JRST	MRPNT2		;NO, EXIT

	HRRZ	T,STATE
	CAIE	T,SCT2		;IS STATE SCT2 ?
	JRST	.+3		;NO
	TRNE	0,INHSCT	;INHIBIT SCT2 PRINTOUT ?
	JRST	MRPNT2		;YES, EXIT
	MOVSI	T1,-^D96
	IFNDEF	SIMASB,<
	MOVSI	T1,-^D120	;CONVERT STATE TO SYMBOLIC >
	CAMN	T,STAB(T1)
	JRST	FOUND
	AOBJN	T1,.-2

	MOVEI	0,[ASCII/XXX--/]
MRPNT1:	PNTA			;PRINT SYMBOLIC STATE
	PTAB

	SETOM	PNTSPC		;SET PRINT SPACE FLAG
	SKIPE	DBLAF		;DBL ARITH ?
	JRST	MRPNT4		;YES

	MOVE	0,PC
	CAMN	0,SVPC
	GO	DITTO6
	MOVEM	0,SVPC
	PNT6			;PRINT PC

	MOVE	0,MA
	CAMN	0,SVMA
	GO	DITTO6
	MOVEM	0,SVMA
	PNT6			;PRINT MA

	MOVE	0,AB
	CAMN	0,SVAB
	GO	DITTO6
	MOVEM	0,SVAB
	PNT6			;PRINT AB

	MOVE	0,MB
	CAMN	0,SVMB
	GO	DITTO
	MOVEM	0,SVMB
	PNTOCT			;PRINT MB
MRPNT5:	MOVE	0,AD
	CAMN	0,SVAD
	GO	DITTO
	MOVEM	0,SVAD
	PNTOCT			;PRINT AD

	MOVE	0,AR
	CAMN	0,SVAR
	GO	DITTO
	MOVEM	0,SVAR
	PNTOCT			;PRINT AR

	MOVE	0,CONSW		;DO FORMATTING FOR EITHER LPT OR TERMINAL
	TLNE	PNTLPT
	JRST	.+3
	PCRL
	JRST	.+2
	PNTMSG	[ASCII/    /]

	MOVE	0,@FMREG
	CAMN	0,SVFM
	GO	DITTO
	MOVEM	0,SVFM
	PNTOCT			;PRINT FM

	MOVE	0,BR
	CAMN	0,SVBR
	GO	DITTO
	MOVEM	0,SVBR
	PNTOCT			;PRINT BR

	MOVE	0,MQ
	CAMN	0,SVMQ
	GO	DITTO
	MOVEM	0,SVMQ
	PNTOCT			;PRINT MQ

	MOVE	0,SC
	CAMN	0,SVSC
	GO	DITTO3
	MOVEM	0,SVSC
	PNT3			;PRINT SC
	MOVE	0,FE
	CAMN	0,SVFE
	GO	DITTO3
	MOVEM	0,SVFE
	PNT3			;PRINT FE

	MOVE	0,SA
	CAMN	0,SVSA
	GO	DITTO3
	MOVEM	0,SVSA
	PNT3			;PRINT SA
	PCRL

MRPNT2:	GET	T3		;RESTORE AC'S
	GET	T2
	GET	T1
	GET	T
	GET	0
	RTN			;EXIT

FOUND:	MOVEI	0,STAB1(T1)	;GET SYMBOLIC STATE
	JRST	MRPNT1

MRPNT4:	MOVE	0,AB
	CAMN	0,SVAB
	GO	DITTO6
	MOVEM	0,SVAB
	PNT6			;PRINT AB

	MOVE	0,ADX
	CAMN	0,SVADX
	GO	DITTO
	MOVEM	0,SVADX
	PNTOCT			;PRINT ADX

	MOVE	0,ARX
	CAMN	0,SVARX
	GO	DITTO
	MOVEM	0,SVARX
	PNTOCT			;PRINT ARX

	PSP
	JRST	MRPNT5
DITTO:	JUMPE	0,DITTO0
	PNTMSG	[ASCIZ/*            /]
	AOS	(P)
	AOS	(P)
	RTN

DITTO0:	PNTMSG	[ASCIZ/0            /]
	JRST	DITTO+2

DITTO6:	JUMPE	0,DITT60
	PNTMSG	[ASCIZ/*      /]
	JRST	DITTO+2

DITT60:	PNTMSG	[ASCIZ/0      /]
	JRST	DITTO+2

DITTO3:	JUMPE	0,DITT30
	PNTMSG	[ASCIZ/*   /]
	JRST	DITTO+2

DITT30:	PNTMSG	[ASCIZ/0   /]
	JRST	DITTO+2

; **********************************************************************
;*IRPNT - INSTRUCTION PRINT
;*	THIS ROUTINE PRINTS THE PC AND THE INSTRUCTION
;*	AT IT0 OF THE INSTRUCTION CYCLE.
; **********************************************************************

IRPNT:	SKIPE	IRLTCH		;FIRST IT0
	RTN			;NO

	SKIPE	PNTCTL		;PREVIOUS INSTRUCTION PRINTED ?
	GO	INTFNL		;YES, PRINT PREVIOUS INIT/FINAL

	SKIPN	SNGLIN#		;SINGLE INSTRUCTION OPERATION ?
	JRST	IRPNT1+1	;NO

	SKIPN	SNGL2#		;START OF SECOND INSTRUCTION ?
	JRST	IRPNT1		;NO

	SKIPE	XCTF		;INST BEING EXECUTED ?
	JRST	IRPNT1		;YES, SIM IT TO.

	GET	0		;RETURN TO CALLING PROGRAM
	GET	T3
	GET	T2
	GET	T1
	GET	T
	GET	0
	GET	0
	RTN

IRPNT1:	SETOM	SNGL2		;SET FIRST INSTR INDICATION
	SETZM	PNTCTL		;CLEAR PRINT CONTROL

	IFNDEF	SIMASB,<
	MOVE	0,MB		;IS THIS SPECIAL LEAVE SIMULATION INST ?
	CAMN	0,[776000,,SEXIT1]
	JRST	@0		;YES, RETURN TO COMMAND OPERATION

	TTALTM
	JRST	.+2		;IF ALTMODE, GO TO DDT
	JRST	DDTEX5		;CONTINUE WITH "SIMCON$G">
SIMCON:	AOS	SEQ#

	MOVE	0,MB		;PRINT THIS INSTRUCTION
	AND	MASK
	CAME	INSTR
	RTN			;NO

	HRRZ	0,PC
	CAMGE	0,CNTLPC	;PC PAST LOWER LIMIT ?
	RTN			;NO

	CAMLE	0,UPRPC		;PC ABOVE UPPER LIMIT ?
	RTN			;YES

	SETOM	PNTCTL		;NO, SET PRINT CONTROL

	MOVE	0,CONSW
	TRNN	0,SEQPNT	;PRINT SEQUENCE NUMBERS ?
	JRST	.+5		;NO
	GO	PCRX
	PNTMSG	[ASCIZ/SEQUENCE # = /]
	MOVE	0,SEQ
	PNTDEC

	GO	IRPNT2
	JRST	HDPNT

IRPNT2:	SWITCH
	TRNN	INHIF		;INHIBIT INITIAL/FINAL RESULTS ?
	GO	PCRX		;NO, DOUBLE SPACE

	PNTCI	"*"

	SETOM	PNTSPC
	MOVE	0,PC
	MOVEM	0,SVPC1#
	PNT6			;PRINT PC
	PSP

	GO	PNTINS		;GO PRINT INSTRUCTION
	PTAB

ACPNT:	SKIPE	CONNF#
	JRST	DVCPNT		;I/O PRINT DEVICE CODE

	SETZM	PNTSPC

	MOVE	0,MB
	ROT	0,-^D23
	ANDI	0,17
	MOVEM	0,SVAC#
	PNTOCS			;PRINT AC
	PNTCI	","

EFPNT:	MOVE	0,MB
	TLNE	0,20		;INDIRECT BIT ON
	PNTCI	"@"		;YES, PRINT AN AT SIGN

	MOVE	0,MB
	PUT	PNTSPC
	SETZM	PNTSPC
	PNT6			;PRINT MB
	GET	PNTSPC

IDXPNT:	MOVE	0,MB		;LOOK FOR INDEXING
	TLNN	0,17
	JRST	IDXPN1

	PNTCI	"("
	MOVE	0,MB
	LSH	0,-^D18
	ANDI	0,17
	PNTOCS			;PRINT INDEX REGISTER
	PNTCI	")"

IDXPN1:	PCRL
	RTN
HDPNT:	MOVE	T,CONSW
	TRNN	T,PNTMS		;PRINT MACHINE STATES ?
	RTN			;NO

	MOVEI	HDER1
	SKIPE	DBLAF		;DBL ARITH ?
	MOVEI	HDER2		;PRINT HEADER 1ST PART
	PNTAL

	TLNE	T,PNTLPT	;PRINT ON LPT ?
	PNTMSG	[ASCIZ/               /]
	TLNN	T,PNTLPT
	PCRL

	PNTMSG	HDER3		;PRINT HEADER 2ND PART

	SETZM	SVAR		;SET TO PRINT ALL REGS AT IT0
	SETZM	SVADX
	SETZM	SVFM
	SETZM	SVMQ
	SETZM	SVBR
	SETZM	SVAD
	SETZM	SVMB
	SETZM	SVPC
	SETZM	SVMA
	SETZM	SVSC
	SETZM	SVARX
	SETZM	SVFE
	SETZM	SVSA
	SETZM	SVAB
	RTN			;RETURN TO MRPNT

DVCPNT:	MOVE	0,MB		;I/O, PRINT DEVICE CODE
	ROT	0,-^D24
	ANDI	0,774
	PNTOCS
	PNTCI	","
	JRST	EFPNT
HUNGCK:	SOSE	HNGCNT		;IS SIMULATOR HUNG ?
	JRST	MRPNT3		;NO, NOT YET

	PNTMSG	[ASCIZ/
INSTRUCTION HUNG UP/]
	JRST	ERRPNT+3

ERRPNT:	PNTMSF	[ASCIZ/
SIMULATOR ERROR AT PC = /]
	MOVE	0,ERR
	PNT6F

	PNTMSF	[ASCIZ/
SIMULATED INSTRUCTION /]

	GO	IRPNT2

	IFNDEF	SIMASB,<
	JRST	VMCONT-2>
	IFDEF	SIMASB,<
	ERRHLT
	JRST	BEGIN>

HDER1:	ASCIZ?
STATE   PC     MA     AB     MB           AD           AR?
HDER2:	ASCIZ?
STATE   AB     ADX          ARX           AD           AR?

HDER3:	ASCIZ?FM           BR           MQ           SC  FE  SA
?
; **********************************************************************
;*PNTINS - INSTRUCTION SYMBOLIC CONVERSION
;*	THIS ROUTINE CONVERTS THE INSTRUCTION TO SYMBOLIC
;*	AND PRINTS IT OUT.
; **********************************************************************

PNTINS:	SETZM	CONNF#
	SETZM	DBLAF#		;CLEAR DOUBLE ARITHMETIC FLAG

	HLRZ	T,MB		;MOVE THE INSTRUCTION CODE TO RH OF T
	LSH	T,-^D9		;CLEAR AC,I,X
	MOVE	T1,T
	ANDI	T,77

	CAIN	T1,777
	JRST	MUOXT		;MONITOR UUO EXECUTE INST

	CAIL	T1,700
	JRST	CONN		;I/O INSTRUCTIONS

	CAIL	T1,600
	JRST	TTTST		;TEST INSTRUCTIONS

	CAIL	T1,500
	JRST	HTST		;HALF WORD INSTRUCTION

	CAIL	T1,400
	JRST	BOTST		;BOOLE INSTRUCTIONS

	CAIL	T1,300
	JRST	COMTST		;COMPARE INSTRUCTIONS

	CAIL	T1,200
	JRST	MOVTST		;MOVE INSTRUCTIONS

	CAIL	T1,140
	JRST	FLTTST		;FLOATING INSTRUCTIONS

	CAIL	T1,130
	JRST	BYTST		;BYTE INSTRUCTIONS

	CAIL	T1,100
	JRST	NEWTST		;NEW INSTRUCTIONS

	CAIL	T1,40
	JRST	MUOTST		;MONITOR UUO'S

	CAIE	T1,0
	JRST	UUOTST		;LOCAL UUO'S

	JRST	MUOTST		; 0 - ILLEGAL INSTRUCTION
	IFDEF	SIMASB,<
CONN:	ERRHLT
	JRST	BEGIN >

FLTTST:	ANDI	T,37		;FLOATING POINT
	ROT	T,-2
	MOVEI	0,TBLFLT(T)
	PNTA

	ROT	T,2
	ANDI	T,7
	MOVE	T2,FLTTAB(T)
	MOVEI	0,TBLAD1(T)

INSOUT:	PNTA
	MOVEM	T2,PTINDX#
	RTN

BYTST:	ANDI	T,7		;UFA,DFN,FSC,BYTE
	MOVE	T2,BYTTAB(T)
	MOVEI	0,TBLBYT(T)
	JRST	INSOUT

MOVTST:	ANDI	T,77
	CAIGE	T,70
	CAIGE	T,40
	JRST	.+4		;MOVE,ADD,SUB,MUL,+ETC

	MOVE	T2,MOTAB-40(T)
	MOVEI	0,TBLMO-40(T)	;SHIFTS,PUSH,POP,+ETC
	JRST	INSOUT

	SETZ	T1,
	ROTC	T,-2
	CAIL	T,10
	SUBI	T,6		;ADD,SUB
	MOVEI	0,TBLMV(T)
	PNTA

	ROTC	T,2
	CAIL	T,20
	JRST	IMLTST

	ANDI	T,3
	MOVE	T2,MOVTAB(T)
	MOVEI	0,TBLMOV(T)
	JRST	INSOUT

IMLTST:	CAIL	T,40
	JRST	ADDTST

	ANDI	T,3		;IMUL,MUL,IDIV,DIV
	MOVE	T2,MULTAB(T)
	MOVEI	0,TBLAD1+4(T)
	JRST	INSOUT

ADDTST:	ANDI	T,3		;ADD, SUB
	MOVE	T2,FLTTAB+4(T)
	MOVEI	0,TBLAD1+4(T)
	JRST	INSOUT

COMTST:	ROT	T,-3		;MEM AND AC MOD AND TEST
	MOVE	T2,COMTAB(T)
	MOVEI	0,TBLCOM(T)
	PNTA

	ROT	T,3
	ANDI	T,7
	MOVEI	0,TBLCM(T)
	JRST	INSOUT

BOTST:	ROT	T,-2		;BOOLE
	MOVEI	0,TBLBOL(T)
	PNTA

	ROT	T,2
	ANDI	T,3
	MOVE	T2,FLTTAB+4(T)
	MOVEI	0,TBLAD1+4(T)
	JRST	INSOUT

HTST:	MOVEI	0,H.		;HALF WORD TRANSFERS
	PNTA
	ROT	T,-2
	MOVEI	0,TBLH(T)
	PNTA

	ROT	T,2
	ANDI	T,3
	MOVE	T2,MOVTAB(T)
	MOVEI	0,TBLMOV(T)
	JRST	INSOUT
TTTST:	MOVEI	0,T.		;TEST
	PNTA

	MOVE	T2,[XWD	16,1]
	TRNE	T,10
	MOVE	T2,[XWD	2,1]
	TRNE	T,1
	JRST	TTODD

	ROT	T,-3
	MOVEI	0,TBLTA(T)
TTSTA:	PNTA
	ROT	T,2
	ANDI	T,3
	MOVEI	0,TBLTA1(T)
	JRST	INSOUT

TTODD:	ROT	T,-3
	MOVEI	0,TBLTB(T)
	JRST	TTSTA

	IFNDEF	SIMASB,<
CONN:	SETOM	CONNF
	HLRZ	T,MB		;I/O
	ROT	T,-5
	ANDI	T,7
	MOVE	T2,CONTAB(T)
	MOVEI	0,TBLCON(T)
	JRST	INSOUT >

NEWTST:	ANDI	T,17		;DOUBLE, FIX, + ETC
	CAIL	T,10		;DOUBLE ARITHMETIC ?
	SETOM	DBLAF		;YES

	MOVE	T2,NEWTAB(T)
	MOVEI	0,TBLNEW(T)
	JRST	INSOUT

UUOTST:	MOVE	T2,UUOTAB
	MOVEI	0,TBLUUO	;UUO'S
	JRST	INSOUT

MUOTST:	MOVE	T2,UUOTAB
	MOVEI	0,TBLMUO	;MONITR UUO'S
	JRST	INSOUT

MUOXT:	MOVE	T2,MUOTAB	;MUUO EXECUTE INST
	MOVEI	0,TBLMUX
	JRST	INSOUT
; **********************************************************************
;*INTPNT - INITIAL/FINAL AC,E PRINTOUT
; **********************************************************************

INTPNT:	SKIPE	BYF5
	JRST	IT12

	HRRZ	T2,AB		;GET E ADDRESS
	MOVEM	T2,SVAB1#

	SETZM	INIT1A#
	SETZM	INIT2A#
	SETZM	INIT3A#
	SETZM	INIT4A#

	HLRZ	T2,PTINDX	;GET PRINT INDEX, INITIAL
	GO	@SETLST(T2)	;SETUP INITIAL CONDITIONS
	RTN

IT12:	HRRZ	T3,AB		;PICKUP C(C(E))
	MOVEM	T3,SVAB2#
	JRST	CCE+1

SETLST:	INDX0
	INDX1
	INDX2
	INDX3
	INDX4
	INDX5
	INDX6
	INDX7
	INDX10
	INDX11
	INDX12
	INDX13
	INDX14
	INDX15
	INDX16
	INDX17
	INDX20
INDX0:	RTN			;DON'T PRINT

INDX1:	GO	CAC		;PRINT C(AC)
	RTN

INDX2:	GO	CAC		;PRINT C(AC)
	GO	CE		;PRINT C(E)
	RTN

INDX3:	GO	CAC		;PRINT C(AC)
	GO	CAC1		;PRINT C(AC+1)
	RTN

INDX4:	GO	CAC		;PRINT C(AC)
	GO	CAC1		;PRINT C(AC+1)
	GO	CE		;PRINT C(E)
	RTN

INDX5:	GO	CAC		;PRINT C(AC)
	GO	CACR		;PRINT C(C(ACR))
	RTN

INDX6:	GO	CAC		;PRINT C(AC)
	GO	CACR1		;PRINT	C(C(ACR+1))
	RTN

INDX7:	GO	CAC		;PRINT C(AC)
	GO	CE		;PRINT C(E)
	GO	CCE		;PRINT C(C(E))
	RTN

INDX10:	GO	CAC		;PRINT C(AC)
	GO	CAC1		;PRINT C(AC+1)
	GO	CE		;PRINT C(E)
	GO	CE1		;PRINT C(E+1)
	RTN

INDX11:	GO	CE		;PRINT C(E)
	RTN

INDX12:	GO	CE		;PRINT C(E)
	GO	CE1		;PRINT C(E+1)
	RTN

INDX13:	GO	CAC		;PRINT C(AC)
	GO	CACR		;PRINT C(C(ACR))
	GO	CE		;PRINT C(E)
	RTN

INDX14:	GO	CAC		;PRINT C(AC)
	GO	CACR1		;PRINT C(C(ACR+1))
	GO	CE		;PRINT C(E)
	RTN

INDX15:	GO	CAC		;PRINT C(AC)
	GO	CACL		;PRINT C(C(ACL))
	RTN

INDX16:	GO	CAC		;PRINT C(AC)
	GO	E		;PRINT E
	RTN

INDX17:	GO	CAC		;PRINT C(AC)
	GO	CAC1		;PRINT C(AC+1)
	GO	E		;PRINT E
	RTN

INDX20:	GO	E		;PRINT E
	RTN
CAC:	MOVE	T3,SVAC
	MOVE	0,ACS(T3)
	MOVEM	0,INIT1#
	MOVEI	[ASCIZ/C(AC)= /]
	MOVEM	INIT1A
	RTN

CAC1:	ADDI	T3,1
	ANDI	T3,17
	MOVE	0,ACS(T3)
	MOVEM	0,INIT2#
	MOVEI	[ASCIZ/C(AC+1)= /]
	MOVEM	INIT2A
	RTN

CACR:	HRRZ	T3,INIT1
	GO	CADR
	MOVE	0,0(T3)
	MOVEM	0,INIT2
	MOVEI	[ASCIZ/C(C(ACR))= /]
	MOVEM	INIT2A
	RTN

CACR1:	HRRZ	T3,INIT1
	GO	CADR
	MOVE	0,1(T3)
	MOVEM	0,INIT2
	MOVEI	[ASCIZ/C(C(ACR+1))= /]
	MOVEM	INIT2A
	RTN

CACL:	HLRZ	T3,INIT1
	GO	CADR
	MOVE	0,0(T3)
	MOVEM	0,INIT2
	MOVEI	[ASCIZ/C(C(ACL))= /]
	MOVEM	INIT2A
	RTN
E:	MOVE	0,SVAB1
	MOVEM	0,INIT3
	MOVEI	[ASCIZ/    E= /]
	MOVEM	INIT3A
	RTN

CE:	MOVE	T3,SVAB1
	GO	CADR
	MOVE	0,0(T3)
	MOVEM	0,INIT3#
	MOVEI	[ASCIZ/ C(E)= /]
	MOVEM	INIT3A
	RTN

CE1:	MOVE	0,1(T3)
	MOVEM	0,INIT4#
	MOVEI	[ASCIZ/ C(E+1)= /]
	MOVEM	INIT4A
	RTN

CCE:	HRRZ	T3,SVAB2
	CAML	T3,VMEM
	RTN
	GO	CADR
	MOVE	0,0(T3)
	MOVEM	0,INIT4
	MOVEI	[ASCIZ/C(C(E))= /]
	MOVEM	INIT4A
	RTN

CADR:	CAIG	T3,17		;IF GREATER THAN 17
	JRST	.+3

	ADDI	T3,OFFSET	;ADD IN OFFSET, PROG IN HIGH SEGMENT
	RTN

	ADDI	T3,ACS		;IF NOT, POINT TO SIM AC'S
	RTN
INTFNL:	SWITCH
	TRNE	INHIF		;INHIBIT INITIAL/FINAL RESULTS ?
	RTN			;YES

	GO	PCR
	PNTMSG	[ASCIZ?FLAGS - INT/FINAL   ?]
	MOVE	0,SVPC1
	HLR	0,PC
	PNTHW
	GO	PCR

INTFN1:	PNTMSG	[ASCIZ/INITIAL/]
	GO	PCR

	SETOM	PNTSPC		;SET PRINT SPACE AFTER OCTALS CONTROL

	GO	IFPNT		;PRINT INITIAL CONDITIONS

	SETZM	INIT1A
	SETZM	INIT2A
	SETZM	INIT3A
	SETZM	INIT4A

	HRRZ	T2,PTINDX	;GET PRINT INDEX, FINAL
	JUMPE	T2,INTFN2	;IF ZERO, NO FINAL

	GO	PCR
	PNTMSG	[ASCIZ/FINAL/]
	GO	PCR

	GO	@SETLST(T2)	;SETUP FINAL CONDITIONS

	GO	IFPNT		;PRINT

INTFN2:	GO	PCR
	PNTMSG	[ASCIZ/----------/]
	GO	PCR
	RTN
IFPNT:	SKIPN	INIT1A
	JRST	.+5

	MOVE	INIT1A
	PNTAL
	MOVE	INIT1
	PNTHW			;PRINT C(AC)

	SKIPN	INIT2A
	JRST	.+5

	MOVE	INIT2A
	PNTAL
	MOVE	INIT2
	PNTHW			;PRINT C(AC+1), C(C(ACR)), C(C(ACR+1)), C(C(ACL))
	MOVE	0,CONSW
	TLNN	PNTLPT
	GO	PCR

	SKIPN	INIT3A
	JRST	.+5

	MOVE	INIT3A
	PNTAL
	MOVE	INIT3
	PNTHW			;PRINT C(E), E

	SKIPN	INIT4A
	JRST	.+5

	MOVE	INIT4A
	PNTAL
	MOVE	INIT4
	PNTHW			;PRINT C(E+1), C(C(E))
	RTN
; **********************************************************************
;*THE INDEX NUMBERS IN THE FOLLOWING TABLE
;*INFORM THE PROGRAM WHICH REGISTERS TO PRINT
;*THE NUMBERS HAVE THE FOLLOWING SIGNIFICANCE.
;*
;*INDEX	REGISTERS
;*0	NONE
;*1	C(AC)
;*2	C(AC)			C(E)
;*3	C(AC)	C(AC+1)
;*4	C(AC)	C(AC+1)		C(E)
;*5	C(AC)	C(C(ACR))
;*6	C(AC)	C(C(ACR+1))
;*7	C(AC)			C(E)	C(C(E))
;*10	C(AC)	C(AC+1)		C(E)	C(E+1)
;*11				C(E)
;*12				C(E)	C(E+1)
;*13	C(AC)	C(C(ACR))	C(E)
;*14	C(AC)	C(C(ACR+1))	C(E)
;*15	C(AC)	C(C(ACL))
;*16	C(AC)						E
;*17	C(AC)	C(AC+1)					E
;*20							E
; **********************************************************************
FLTTAB:	XWD	2,1		;FAD
	XWD	4,3		;FADL
	XWD	2,11		;FADM
	XWD	2,2		;FADB
	XWD	2,1		; -
	XWD	16,1		; I
	XWD	2,11		; M
	XWD	2,2		; B

BYTTAB:	XWD	4,4		;UFA
	XWD	2,2		;DFN
	XWD	16,1		;FSC
	XWD	11,11		;BYTES
	XWD	7,7
	XWD	7,7
	XWD	7,7
	XWD	7,7

MOTAB:	XWD	16,1		;ASH
	XWD	16,1		;ROT
	XWD	16,1		;LSH
	XWD	3,3		;JFFO
	XWD	17,3		;ASHC
	XWD	17,3		;ROTC
	XWD	17,3		;LSHC
	XWD	0,0		;ERR
	XWD	2,2		;EXCH
	XWD	16,1		;BLT
	XWD	16,1		;AOBJP
	XWD	16,1		;AOBJN
	XWD	20,0		;JRST
	XWD	20,0		;JFCL
	XWD	20,11		;XCT
	XWD	16,1		;MAP
	XWD	6,5		;PUSHJ
	XWD	14,5		;PUSH
	XWD	13,2		;POP
	XWD	5,1		;POPJ
	XWD	11,11		;JSR
	XWD	16,1		;JSP
	XWD	2,2		;JSA
	XWD	15,1		;JRA

MOVTAB:	XWD	2,1		; -
	XWD	16,1		; I
	XWD	2,11		; M
	XWD	2,2		; S

MULTAB:	XWD	4,3		; -
	XWD	17,3		; I
	XWD	4,11		; M
	XWD	4,4		; B

COMTAB:	XWD	16,0		;CAI
	XWD	2,0		;CAM
	XWD	16,0		;JUMP
	XWD	2,1		;SKIP
	XWD	16,1		;AOJ
	XWD	2,2		;AOS
	XWD	16,1		;SOJ
	XWD	2,2		;SOS

NEWTAB:	XWD	10,3		;DMOVE
	XWD	10,3		;DMOVN
	XWD	2,1		;FIX
	0
	XWD	10,12		;DMOVM
	XWD	10,12		;DMNNM
	XWD	2,1		;FIXR
	XWD	2,1		;FLTR
	XWD	10,3		;DFAD
	XWD	10,3		;DFSB
	XWD	10,3		;DFMP
	XWD	10,3		;DFDV
	0
	0
	0
	0

UUOTAB:	XWD	20,0		;LUUO

MUOTAB:	XWD	12,12		;MUUO EXECUTION
	IFNDEF	SIMASB,<
CONTAB:	XWD	7,7		;BLKI
	XWD	11,11		;DATAI
	XWD	7,7		;BLKO
	XWD	11,0		;DATAO
	XWD	20,0		;CONO
	XWD	11,11		;CONI
	XWD	20,0		;CONSZ
	XWD	20,0		;CONSO
>
; **********************************************************************
;*SIMULATOR SYMBOL TABLE
; **********************************************************************
								SALL
DEFINE	INX	(A)<
	ASCII /A/>

TBLFLT:	INX	FAD;		;140
	INX	FADR;		;144
	INX	FSB;		;150
	INX	FSBR;		;154
	INX	FMP;		;160
	INX	FMPR;		;164
	INX	FDV;		;170
	INX	FDVR;		;174

TBLBYT:	INX	UFA;		;130
	INX	DFN;		;131
	INX	FSC;		;132
	INX	IBP;		;133
	INX	ILDB;		;134
	INX	LDB;		;135
	INX	IDPB;		;136
	INX	DPB;		;137

TBLMV:	INX	MOVE;		;200
	INX	MOVS;		;204
	INX	MOVN;		;210
	INX	MOVM;		;214
	INX	IMUL;		;220
	INX	MUL;		;224
	INX	IDIV;		;230
	INX	DIV;		;234
	INX	ADD;		;270
	INX	SUB;		;274

TBLMOV:	ASCII / /		;0,4
	INX	I;		;1,5
	INX	M;		;2,6
	INX	S;		;3,7
TBLMO:	INX	ASH;		;240
	INX	ROT;		;241
	INX	LSH;		;242
	INX	JFFO;		;243
	INX	ASHC;		;244
	INX	ROTC;		;245
	INX	LSHC;		;246

	INX	ERR;		;247
	INX	EXCH;		;250
	INX	BLT;		;251
	INX	AOBJP;		;252
	INX	AOBJN;		;253
	INX	JRST;		;254
	INX	JFCL;		;255
	INX	XCT;		;256
	INX	MAP;		;257
	INX	PUSHJ;		;260
	INX	PUSH;		;261
	INX	POP;		;262
	INX	POPJ;		;263
	INX	JSR;		;264
	INX	JSP;		;265
	INX	JSA;		;266
	INX	JRA;		;267

TBLAD1:	ASCII / /		;0
	INX	L;		;1
	INX	M;		;2
	INX	B;		;3
	ASCII / /		;0,4
	INX	I;		;1,5
	INX	M;		;2,6
	INX	B;		;3,7
TBLCOM:	INX	CAI;		;300
	INX	CAM;		;310
	INX	JUMP;		;320
	INX	SKIP;		;330
	INX	AOJ;		;340
	INX	AOS;		;350
	INX	SOJ;		;360
	INX	SOS;		;370

TBLCM:	ASCII / /		;0
	INX	L;		;1
	INX	E;		;1
	INX	LE;		;3
	INX	A;		;4
	INX	GE;		;5
	INX	N;		;6
	INX	G;		;7

TBLBOL:	INX	SETZ;		;400
	INX	AND;		;404
	INX	ANDCA;		;410
	INX	SETM;		;414
	INX	ANDCM;		;420
	INX	SETA;		;424
	INX	XOR;		;430
	INX	IOR;		;434
	INX	ANDCB;		;440
	INX	EQV;		;444
	INX	SETCA;		;450
	INX	ORCA;		;454
	INX	SETCM;		;460
	INX	ORCM;		;464
	INX	ORCB;		;470
	INX	SETO;		;474
H.:	INX	H;		;5XX
TBLH:	INX	LL;		;500
	INX	RL;		;504
	INX	LLZ;		;510
	INX	RLZ;		;514
	INX	LLO;		;520
	INX	RLO;		;524
	INX	LLE;		;530
	INX	RLE;		;534
	INX	RR;		;540
	INX	LR;		;544
	INX	RRZ;		;550
	INX	LRZ;		;554
	INX	RRO;		;560
	INX	LRO;		;564
	INX	RRE;		;570
	INX	LRE;		;574
T.:	INX	T;		;6XX
TBLTA:	INX	RN;		;600
	INX	DN;		;610
	INX	RZ;		;620
	INX	DZ;		;630
	INX	RC;		;640
	INX	DC;		;650
	INX	RO;		;660
	INX	DO;		;670
TBLTA1:	ASCII / /		;0,1
	INX	E;		;2,3
	INX	A;		;4,5
	INX	N;		;6,7

TBLTB:	INX	LN;		;601
	INX	SN;		;611
	INX	LZ;		;621
	INX	SZ;		;631
	INX	LC;		;641
	INX	SC;		;651
	INX	LO;		;661
	INX	SO;		;671
	IFNDEF	SIMASB,<
TBLCON:	INX	BLKI;		;70000
	INX	DATAI;		;70004
	INX	BLKO;		;70010
	INX	DATAO;		;70014
	INX	CONO;		;70020
	INX	CONI;		;70024
	INX	CONSZ;		;70030
	INX	CONSO;		;70034
>
TBLNEW:	INX	DMOVE;		;120
	INX	DMOVN;		;121
	INX	FIX;		;122
	INX	ERR;		;123
	INX	DMOVM;		;124
	INX	DMVNM;		;125
	INX	FIXR;		;126
	INX	FLTR;		;127
	INX	DFAD;		;110
	INX	DFSB;		;111
	INX	DFMP;		;112
	INX	DFDV;		;113
	INX	ERR;		;114
	INX	ERR;		;115
	INX	ERR;		;116
	INX	ERR;		;117

TBLUUO:	INX	LUUO;		;001-037

TBLMUO:	INX	MUUO;		;0, 040-077

TBLMUX:	INX	MUOEX;		;MUUO EXECUTION
; **********************************************************************
;*STAB - MACHINE STATES, K1-10
; **********************************************************************

STAB:	IT0			;INSTRUCTION TIME
	IT1
	IT2
	ET0S			;EXECUTE TIME
	ET1S	
	ET2S
	FT1			;FETCH TIME
	FT2
	FT3
	FT4
	FT5
	FT6
	FT7
	ST1			;STORE TIME
	ST2
	ST3	
	ST4
	ST5
	FAT1			;FLOATING ADD TIME
	FAT2
	FAT3
	FAT4
	FMT1			;FLOATING MULTIPLY TIME
	FMT2
	FDT0			;FLOATING DIVIDE TIME
	FDT1	
	FDT2
	FDT3
	FDT4
	FDT5
	FDT6
	FDT7
	FIXT1			;FIX TIME
	FIXT2
	SCT1			;SHIFT COUNT TIME
	SCT2
	SRT1			;SHIFT ROUTINE TIME
	DST1			;DIVIDE SUBROUTINE TIME
	DST2
	DST3
	DST4
	DST5
	DST6
	NRT1			;NORMALIZE ROUTINE TIME
	NRT2
	NRT3
	NRT4
	NRT5
	NRT6
	DMOVT1			;DOUBLE MOVE TIME
	DMVNT1
	DMVNT2
	DMVNT3
	DFAT1			;DOUBLE FLOATING ADD TIME
	DFAT2
	DFAT3
	DFAT4
	DFAT5
	DFMT1			;DOUBLE FLOATING MULTIPLY TIME
	DFMT2			
	DFMT3
	DFDT0			;DOUBLE FLOATING DIVIDE TIME
	DFDT1
	DFDT2
	DFDT3
	DFDT4
	DFDT5
	DFDT6
	DFDT7
	DFDT8
	DFDT9
	DFDT10
	DFDT11
	DFDT12
	DNT1			;DOUBLE NORMALIZE TIME
	DNT2	
	DNT3
	DNT4
	DNT5
	DNT6
	DNT7
	DNT8
	DNT9
	BLTT0
	BLTT1			;BLT TIME
	BLTT2
	BLTT3
	BLTT4
	BLTT5
	BLTT6
	BLTT7
	BLTT8
	BLTT9
	JFFOT1			;JFFO TIME
	MEMST			;MEMORY ROUTINE
	INDONE			;INSTRUCTION DONE TIME
	IFNDEF	SIMASB,<
	TTYDI			;TTY I/O TIME
	TTYDO
	TTYCO
	TTYCI
	TTYCNZ
	TTYCNO

	APRDI			;APR I/O TIME
	APRDO
	APRCO
	APRCI
	APRCNZ
	APRCNO

	PIDI			;PI I/O TIME
	PIDO
	PICO
	PICI
	PICNZ
	PICNO

	PGDI			;PAG I/O TIME
	PGDO
	PGCO
	PGCI
	PGCNZ
	PGCNO
>
; **********************************************************************
;*STAB1 - SYMBOLIC MACHINE STATES
; **********************************************************************

STAB1:	INX	IT0
	INX	IT1
	INX	IT2
	INX	ET0
	INX	ET1
	INX	ET2
	INX	FT1
	INX	FT2
	INX	FT3
	INX	FT4
	INX	FT5
	INX	FT6
	INX	FT7
	INX	ST1
	INX	ST2
	INX	ST3
	INX	ST4
	INX	ST5
	INX	FAT1
	INX	FAT2
	INX	FAT3
	INX	FAT4
	INX	FMT1
	INX	FMT2
	INX	FDT0
	INX	FDT1
	INX	FDT2
	INX	FDT3
	INX	FDT4
	INX	FDT5
	INX	FDT6
	INX	FDT7
	INX	FIXT1
	INX	FIXT2
	INX	SCT1
	INX	SCT2
	INX	SRT1
	INX	DST1
	INX	DST2
	INX	DST3
	INX	DST4
	INX	DST5
	INX	DST6
	INX	NRT1
	INX	NRT2
	INX	NRT3
	INX	NRT4
	INX	NRT5
	INX	NRT6
	INX	DMVT1
	INX	DMVN1
	INX	DMVN2
	INX	DMVN3
	INX	DFAT1
	INX	DFAT2
	INX	DFAT3
	INX	DFAT4
	INX	DFAT5
	INX	DFMT1
	INX	DFMT2
	INX	DFMT3
	INX	DFDT0
	INX	DFDT1
	INX	DFDT2
	INX	DFDT3
	INX	DFDT4
	INX	DFDT5
	INX	DFDT6
	INX	DFDT7
	INX	DFDT8
	INX	DFDT9
	INX	DFD10
	INX	DFD11
	INX	DFD12
	INX	DNT1
	INX	DNT2
	INX	DNT3
	INX	DNT4
	INX	DNT5
	INX	DNT6
	INX	DNT7
	INX	DNT8
	INX	DNT9
	INX	BLTT0
	INX	BLTT1
	INX	BLTT2
	INX	BLTT3
	INX	BLTT4
	INX	BLTT5
	INX	BLTT6
	INX	BLTT7
	INX	BLTT8
	INX	BLTT9
	INX	JFFO1
	INX	MEMST
	INX	INDON
	IFNDEF	SIMASB,<
	INX	DATAI
	INX	DATAO
	INX	CONO
	INX	CONI
	INX	CONSZ
	INX	CONSO
	INX	DATAI
	INX	DATAO
	INX	CONO
	INX	CONI
	INX	CONSZ
	INX	CONSO
	INX	DATAI
	INX	DATAO
	INX	CONO
	INX	CONI
	INX	CONSZ
	INX	CONSO
	INX	DATAI
	INX	DATAO
	INX	CONO
	INX	CONI
	INX	CONSZ
	INX	CONSO
>
								LALL