Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-05 - 43,50337/25/sutana.mac
There are 2 other files named sutana.mac in the archive. Click here to see a list.
	TITLE	SUTANA

	SALL

	SEARCH	SIMMAC

	EXTERN	MAP,PASSNO

	MACINIT

	TEN=^D10

	DEFINE	PUTBL(A)<EXEC	.PUTBL,<[A]>>
	DEFINE	PUT%(A,B)<EXEC	.PUT%,<A,B>>
	DEFINE	PUTD8(A)<EXEC	.PUTD,<A,[8]>>
	DEFINE	PUTD6(A)<EXEC	.PUTD,<A,[6]>>
	DEFINE	PUTD5(A)<EXEC	.PUTD,<A,[5]>>
	DEFINE	PUTD4(A)<EXEC	.PUTD,<A,[4]>>
	DEFINE	WRITE(TEXT)<PUTTEXT(<[ASCIZ/TEXT/]>)>

	DEFINE	PUTZERO<EXEC	.PUTZ>
	DEFINE	PUTCHAR(A)<
		SOSGE	BC
		EXEC	.WRITE
		IDPB	A,BP
	>
	DEFINE	PUTTEXT(A)<EXEC	.PUTT,<<[POINT 7,A]>>>
	DEFINE	OUTOPEN<
		OPEN	1,[0
			SIXBIT/DSK/
			XWD OBUFH,0]
		ERROR
		ENTER	1,[SIXBIT/ANALYS/
			SIXBIT/TRC/
			0
			0]
		ERROR
		OUTBUF	1,
		OUT	1,
		SKIPA
		ERROR
	>
	DEFINE	OUTCLOSE<
		CLOSE	1,
		RELEASE	1,
	>

	DEFINE	ON(A)<
	IFOFFA	A
	GOTO	FALSE>
	DEFINE	OFF(A)<
	IFONA	A
	GOTO	FALSE>

	DSW	(PASS,0,35,16)
	DSW	(ALLPAS,0,34,16)
	DSW	(FIRSTBLOCK,0,33,16)
	DSW	(LEADB,0,32,16)

	DEFINE ERROR(A)<GOTO [OUTSTR [ASCIZ/
?ERROR IN ANALYS
/]
	EXIT]
>
ENT::

	OUTOPEN
	OPEN	2,[16
		SIXBIT/DSK/
		0]
	ERROR(OPEN)
	L	XPDP,[IOWD 30,STACK.]
	SETONA	FIRSTBLOCK
	LI	2,3
	ST	2,PASSNO
	SETONA	ALLPAS
	LOOP
		EXEC	LUPTR
		SETOFA	ALLPAS
		L	PASINS
		ADDM	TOTINS
	AS
		SOSN	2,PASSNO
		GOTO	FALSE
		IFONA	ALLPAS
		GOTO	TRUE
	SA
	SETZM	PASSNO
	SETOFA	FIRSTBLOCK
	GOTO	DONE

LL:;READ TRACE.BIN
	CAIN	2,4
	SETOFA	ALLPAS
	EXEC	LUPTR
	GOTO	DONE
	HRRZS	HGHADR
	HRRZS	LOWADR
	LI	14
	PUTCHAR
	WRITE	(<
MODULE LENGTH LENGTH INSTRUCTIONS    MEAN  NO OF   NO OF     % I   % M   % B   % O   % OF  % OF
	      NODATA   EXECUTED		   3*MEAN 10*MEAN			     PASS  TOTAL
>)
	SETOFA	PASS
	WHILE
		EXEC	MAP
		GOTO	FALSE
	DO
		EXEC	STATIS
	OD
	L	3,PASSNO
	ASH	3,1
	LD	1,[ASCIZ/PASS:1/
		ASCIZ/PASS:2/
		ASCIZ/PASS:3/
		ASCIZ/RTSLOW/
		ASCIZ/SIMRTS/]-2(3)
	LD	3,LOWADR
	SUB	4,3
	SETONA	PASS
	WRITE	(<
>)
	EXEC	STATIS
	WRITE	(<

INSTRUCTIONS TRACED:>)
	PUTD8	PASINS
	WRITE	(<


SIMULA PROGRAM(S) TRACED:
>)
	LI	10,0
	WHILE
		SKIPN	2,SIMPRO(10)
		GOTO	FALSE
	DO
		IF
			TRNE	10,7
			GOTO	FALSE
		THEN
			WRITE(<
>)
		ELSE
			WRITE(<	>)
		FI
		LOOP
			LI	1,0
			LSHC	1,6
			ADDI	1,40
			PUTCHAR	1
		AS
			JUMPN	2,TRUE
		SA
		ADDI	10,1
	OD

DONE:
	AOS	2,PASSNO
	CAIG	2,5
	GOTO	LL
	RELEASE	2,
	OUTCLOSE
	EXIT
STATIS:	PROC

	L	5,3
	ADD	5,4
	CAML	3,LOWADR
	CAMLE	5,HGHADR
	RETURN

	WRITE(<
>)
	PUTTEXT	1
	SKIPG	4
	RETURN
	IF	ON	PASS
	THEN
		PUTBL	7
	ELSE
		PUTD6	4
	FI
;GET STATISTICS OF THE MODULE
	SUB	3,LOWADR
	MOVN	4,4
	HRL	3,4
	ST	3,COUNTW
	L	1,[XWD MTYP,MTYP+1]
	SETZM	MTYP
	BLT	1,MTYP+7
	LOOP
		IF	SKIPN	1,TAB(3)
			GOTO	FALSE
		THEN
			LDB	2,[POINT 9,1,8]
			TLZ	1,777K
			AOS	LNODAT
			ADDM	1,MODINS
			L	2,INSTAB(2)
			ADDM	1,MTYP(2)
		FI
	AS
		AOBJN	3,TRUE
	SA
	L	1,MODINS
	PUTD6	LNODAT
	SKIPN	LNODAT
	RETURN
	IDIV	1,LNODAT
	ST	1,MEAN
	IMULI	1,3
	ST	1,MEAN3
	L	1,MEAN
	IMULI	1,TEN
	ST	1,MEAN10
	PUTBL	3
	PUTD8	MODINS
	PUTBL	1
	PUTD6	MEAN
	L	3,COUNTW
	SETZB	4,5
	LOOP
		L	1,TAB(3)
		TLZ	1,777K
		CAML	1,MEAN3
		ADDI	4,1
		CAML	1,MEAN10
		ADDI	5,1
	AS
		AOBJN	3,TRUE
	SA
	PUTD6	4
	PUTBL	2
	PUTD5	5
	PUTBL	2
	PUT%	MTYP,MODINS
	PUT%	MTYP+1,MODINS
	PUT%	MTYP+2,MODINS
	PUT%	MTYP+3,MODINS
	PUTBL	1
	PUT%	MODINS,PASINS
	IF	ON	ALLPAS
	THEN
		PUT%	MODINS,TOTINS
	FI
	RETURN
	EPROC
.PUT%:	PROC	<A,B>
	SAVE	<1,2,3>
	L	1,A
	IMULI	1,^D2000
	IDIV	1,B
	ADDI	1,1
	ASH	1,-1
	IF	CAIGE	1,^D1000
		GOTO	FALSE
	THEN
		WRITE(< 100.0>)
	ELSE
		PUTBL	2
		IDIVI	1,TEN
		L	3,2
		IDIVI	1,TEN
		ADDI	1,60
		ADDI	2,60
		ADDI	3,60
		CAIN	1,60
		LI	1,40
		PUTCHAR	1
		PUTCHAR	2
		WRITE	(<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AT:0
MODINS:0
MEAN:0
MEAN3:0
MEAN10:0
COUNTW:0
TOTINS:0
LIT
DEFINE M(A,B,C)<
	IFB<C>,<A>
	IFNB<C>,<REPEAT C-B+1,<A>>
>
DEFINE M10<EXP 1,0,1,1,1,0,1,1>
DEFINE M100<REPEAT 4,<EXP 0,0,0,0,0,0,0,0
			EXP 1,1,1,1,1,1,1,1>
>

INSTAB:
M	3,0,132
M	2,133,137
M	3,140,177
M10
M10
M	3,220,247
M	1,250
M	3,251
M	0,252,255
M	3,256,257
M	1,260,267
M10
M100
REPEAT 20,<M10>
M100
M	3,700,777
IN:
PASINS:0
LOWADR:0
HGHADR:0
SIMPRO:BLOCK 400
TAB:BLOCK 37007

END ENT