Google
 

Trailing-Edge - PDP-10 Archives - bb-h138f-bm - 7-sources/symsub.mac
There are 18 other files named symsub.mac in the archive. Click here to see a list.
;<4.UTILITIES>SYMSUB.MAC.4, 12-Mar-79 14:28:06, Edit by KONEN
;UPDATE COPYRIGHT FOR RELEASE 4
;<PERF-TOOLS>SYMSUB.MAC.3, 29-Sep-77 15:24:59, EDIT BY MURPHY
;<PERF-TOOLS>SYMSUB.MAC.2, 20-Sep-77 15:55:07, EDIT BY HURLEY
;<1HURLEY>SYMSUB.MAC.2, 29-Mar-77 15:02:24, EDIT BY HURLEY

;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976,1977,1978,1979 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	TITLE SYMSUB
	SALL

	SEARCH MONSYM,MACSYM
	.REQUIRE SYS:MACREL

;SUBROUTINES TO SUPPORT SYMBOL TRANSLATIONS

	T1=1
	T2=2
	T3=3
	T4=4
	Q1=5
	Q2=6
	Q3=7
	P1=10
	P2=11
	P3=12
	P4=13
	CX=16
	P=17

;INS2ST - INSTRUCTION TO STRING
;ACCEPTS IN 1/	POINTER TO STRING TO RECEIVE ANSWER
;	    2/	INSTRUCTION
;	    3/	RADIX-50 NAME OF MODULE

;RETURNS +1:	ERROR
;	 +2:	SUCCESSFUL

INS2ST::TLC T1,-1
	TLCN T1,-1
	HRLI T1,(POINT 7,0)
	ASUBR <INS2SB,INS2SI,INS2SP>
	MOVE T1,INS2SI
	MOVEI T2,0
	CALL LKADR
	 JRST INS2S1
	JUMPN T2,INS2S1
	MOVE T2,T1
	MOVE T1,INS2SB
	CALL SYM2ST
	RETSKP

INS2S1:	MOVE T1,INS2SB
	MOVE T2,INS2SI
	MOVE T3,INS2SP
	CALL OPC2ST
	 RET
	MOVEI T2," "
	IDPB T2,T1
	MOVE T2,INS2SI
	MOVE T3,INS2SP
	CALL AC2ST
	 RET
	MOVE T2,INS2SI
	MOVEI T3,"@"
	TLNE T2,(1B13)
	IDPB T3,T1
	MOVE T3,INS2SP
	CALL EAD2ST
	 RET
	MOVE T2,INS2SI
	MOVE T3,INS2SP
	CALL IDX2ST
	 RET
	MOVEI T2,0
	MOVE T3,T1
	IDPB T2,T3
	RETSKP


AC2ST::	TLC T2,700000
	TLCN T2,700000
	JRST AC2ST1
	LDB T2,[POINT 4,T2,12]
	JUMPE T2,RSKP
	CALL ADR2ST
	 RET
	MOVEI T2,","
	IDPB T2,T1
	MOVEI T2,0
	MOVE T3,T1
	IDPB T2,T3
	RETSKP

AC2ST1:	LDB T4,[POINT 7,T2,9]
	HRRO T2,DEVTAB(T4)
	SETZ T3,
	SOUT
	 ERJMP R
	RETSKP


EAD2ST::HRRZS T2
	CALL ADR2ST
	 RET
	RETSKP


IDX2ST::LDB T2,[POINT 4,T2,17]
	JUMPE T2,IDX2S1
	MOVEI T4,"("
	IDPB T4,T1
	CALL ADR2ST
	 RET
	MOVEI T4,")"
	IDPB T4,T1
IDX2S1:	RETSKP


OPC2ST::TLC T2,700000
	TLCN T2,700000
	JRST OPC2S1
	LDB T4,[POINT 9,T2,8]
	HRRO T2,OPCTAB(T4)
	SETZ T3,
	SOUT
	 ERJMP R
	RETSKP

OPC2S1:	LDB T4,[POINT 3,T2,12]
	HRRO T2,IOTAB(T4)
	SETZ T3,
	SOUT
	 ERJMP R
	RETSKP
;ST2ADR - STRING TO ADDRESS
;ACCEPTS IN 1/	POINTER TO STRING
;	    2/	RADIX-50 NAME OF MODULE

;RETURNS +1:	ERROR
;	 +2:	ADDRESS IN T2

ST2ADR::STKVAR <ST2ADB,ST2ADA,ST2ADO,ST2ADN,ST2ADP,<ST2ADS,10>>
	MOVEM T2,ST2ADP
	SETZM ST2ADA
	TLC T1,-1
	TLCN T1,-1
	HRLI T1,(POINT 7,0)
	MOVEM T1,ST2ADB
	SETZM ST2ADO
ST2AD0:	SETZM ST2ADN
	MOVE T1,[POINT 7,ST2ADS]
	SETZM ST2ADS
ST2AD1:	ILDB T2,ST2ADB
	JUMPE T2,ST2AD3
	CAIL T2,"A"+40
	CAILE T2,"Z"+40
	SKIPA
	SUBI T2,40
	CAIL T2,"A"
	CAILE T2,"Z"
	CAIN T2,"."
	JRST ST2AD2
	CAIL T2,"0"
	CAILE T2,"9"
	CAIN T2,"%"
	JRST ST2AD2
	CAIE T2,"$"
	JRST ST2AD3
ST2AD2:	IDPB T2,T1
	CAIG T2,"7"
	CAIGE T2,"0"
	SETOM ST2ADN
	JRST ST2AD1

ST2AD3:	SKIPN ST2ADS
	JRST ST2AD6
	MOVEI T2,0
	IDPB T2,T1
	SKIPE ST2ADN
	JRST ST2AD4
	HRROI T1,ST2ADS
	MOVEI T3,8
	NIN
	 JRST ST2AD4
	MOVE T1,T2
	JRST ST2AD5

ST2AD4:	HRROI T1,ST2ADS
	CALL ST2SYM
	MOVE T2,ST2ADP
	CALL LKSYM
	 RET
ST2AD5:	SKIPE ST2ADO
	MOVNS T1
	ADDM T1,ST2ADA
ST2AD6:	LDB T2,ST2ADB
	JUMPE T2,ST2AD7
	CAIE T2,15
	CAIN T2,12
	JRST ST2AD7
	CAIE T2,14
	CAIN T2,"Z"-100
	JRST ST2AD7
	CAIN T2,":"
	JRST ST2AD7
	SETZM ST2ADO
	CAIN T2,"-"
	SETOM ST2ADO
	CAIE T2,"+"
	CAIN T2,"-"
	JRST ST2AD0
	CAIE T2," "
	CAIN T2,11
	JRST ST2AD0
	RET

ST2AD7:	MOVE T1,ST2ADB
	ILDB T3,ST2ADB
	CAIN T3,12
	CAIE T2,15
	SKIPA
	MOVE T1,ST2ADB
	MOVE T2,ST2ADA
	RETSKP
;ADR2ST - ADDRESS TO STRING
;ACCEPTS IN 1/	POINTER TO STRING TO RECEIVE ANSWER
;	    2/	ADDRESS
;	    3/	RADIX-50 MODULE NAME

;RETURNS +1:	ALWAYS

ADR2ST::STKVAR <AD2STB,AD2STD,AD2STA>
	TLC T1,-1
	TLCN T1,-1
	HRLI T1,(POINT 7,0)
	MOVEM T1,AD2STB
	MOVEM T2,AD2STA
	MOVE T1,T2
	MOVE T2,T3
	CALL LKADR
	 JRST ADR2S1
	MOVEM T2,AD2STD
	MOVE T2,T1
	MOVE T1,AD2STB
	CALL SYM2ST
	SKIPN T2,AD2STD
	RETSKP
	MOVE T3,[NO%SGN+8]
	NOUT
	 RET
	RETSKP

ADR2S1:	MOVE T1,AD2STB
	MOVE T2,AD2STA
	MOVEI T3,8
	NOUT
	 RET
	RETSKP
;ST2SYM - STRING TO SYMBOL
;ACCEPTS IN 1/	POINTER TO STRING

;RETURNS +1:	ALWAYS - RADIX-50 SYMBOL IN T1

ST2SYM::STKVAR <ST2SYB>
	TLC T1,-1
	TLCN T1,-1
	HRLI T1,(POINT 7,0)
	MOVEM T1,ST2SYB
	SETZ T1,
	MOVEI T4,6
ST2SY1:	ILDB T2,ST2SYB
	JUMPE T2,ST2SY2
	CAIE T2,15
	CAIN T2,12
	JRST ST2SY2
	CAIE T2," "
	CAIN T2,11
	JRST ST2SY2
	CAIL T2,"A"+40
	CAILE T2,"Z"+40
	SKIPA
	SUBI T2,40
	SETZ T3,
	CAIL T2,"0"
	CAILE T2,"9"
	SKIPA
	MOVEI T3,1-"0"(T2)
	CAIL T2,"A"
	CAILE T2,"Z"
	SKIPA
	MOVEI T3,13-"A"(T2)
	CAIN T2,"."
	MOVEI T3,45
	CAIN T2,"$"
	MOVEI T3,46
	CAIN T2,"%"
	MOVEI T3,47
	IMULI T1,50
	ADD T1,T3
	SOJG T4,ST2SY1
ST2SY2:	RET
;SYM2ST - SYMBOL TO STRING
;ACCEPTS IN 1/	POINTER TO STRING TO RECEIVE ANSWER
;	    2/	RADIX-50 SYMBOL

;RETURNS +1:	ALWAYS

SYM2ST::TLC T1,-1
	TLCN T1,-1
	HRLI T1,(POINT 7,0)
	TLZ T2,740000
SYM2S1:	IDIVI T2,50
	PUSH P,T3
	SKIPE T2
	CALL SYM2S1
	POP P,T2
	JUMPE T2,SYM2S2
	ADDI T2,"0"-1
	CAILE T2,"9"
	ADDI T2,"A"-72
	CAILE T2,"Z"
	SUBI T2,134-44
	CAIN T2,43
	MOVEI T2,"."
	IDPB T2,T1
	MOVE T4,T1
	MOVEI T3,0
	IDPB T3,T4
SYM2S2:	RET
;LKSYM - LOOKUP A SYMBOL IN MONITOR SYMBOL TABLE
;ACCEPTS IN 1/	RADIX-50 SYMBOL
;	    2/	RADIX-50 MODULE NAME

;RETURNS +1:	NOT FOUND
;	 +2:	ADDRESS IN 1

LKSYM::	MOVE T3,T2
	MOVE T2,T1
	MOVEI T1,.SNPSY
	SNOOP
	 RET
	MOVE T1,T2
	RETSKP


;LKADR - LOOKUP ADDRESS IN SYMBOL TABLE
;ACCEPTS IN 1/	ADDRESS
;	    2/	RADIX-50 NAME OF THE MODULE

;RETURNS +1:	ERROR
;	 +2:	1/	RADIX-50 VALUE OF NEAREST SYMBOL
;		2/	DIFFERENCE BETWEEN THIS SYMBOL AND DESIRED ADR

LKADR::	ASUBR <LKADRA,LKADRP,LKADRS,LKADRD>
	MOVE T3,T2
	MOVE T2,T1
	MOVEI T1,.SNPAD
	SNOOP
	 RET
	MOVE T1,T2
	MOVE T2,T3
	SKIPE LKADRP
	JUMPN T2,LKADR1
	JRST LKADR3

LKADR1:	MOVEM T1,LKADRS
	MOVEM T2,LKADRD
	MOVE T2,LKADRA
	MOVEI T3,0
	MOVEI T1,.SNPAD
	SNOOP
	 RET
	JUMPN T3,LKADR2
	MOVE T1,T2
	MOVE T2,T3
	JRST LKADR3

LKADR2:	MOVE T1,LKADRS
	MOVE T2,LKADRD
LKADR3:	CAILE T2,200
	RET
	RETSKP
;OPCODE TABLES

DEFINE ASC (A),<
	EXP [ASCIZ/A/]>

IOTAB:	ASC BLKI
	ASC DATAI
	ASC BLKO
	ASC DATAO
	ASC CONO
	ASC CONI
	ASC CONSZ
	ASC CONSO

DEVTAB:	ASC APR
	ASC PI
	ASC 10
	ASC 14
	ASC 20
	ASC 24
	ASC 30
	ASC 34
	ASC 40
	ASC 44
	ASC 50
	ASC 54
	ASC 60
	ASC 64
	ASC 70
	ASC 74
	ASC 100
	ASC 104
	ASC 110
	ASC 114
	ASC 120
	ASC 124
	ASC 130
	ASC 134
	ASC 140
	ASC 144
	ASC 150
	ASC 154
	ASC 160
	ASC 164
	ASC 170
	ASC 174
	ASC 200
	ASC 204
	ASC 210
	ASC 214
	ASC 220
	ASC 224
	ASC 230
	ASC 234
	ASC 240
	ASC 244
	ASC 250
	ASC 254
	ASC 260
	ASC 264
	ASC 270
	ASC 274
	ASC 300
	ASC 304
	ASC 310
	ASC 314
	ASC 320
	ASC 324
	ASC 330
	ASC 334
	ASC 340
	ASC 344
	ASC 350
	ASC 354
	ASC 360
	ASC 364
	ASC 370
	ASC 374
	ASC 400
	ASC 404
	ASC 410
	ASC 414
	ASC 420
	ASC 424
	ASC 430
	ASC 434
	ASC 440
	ASC 444
	ASC 450
	ASC 454
	ASC 460
	ASC 464
	ASC 470
	ASC 474
	ASC 500
	ASC 504
	ASC 510
	ASC 514
	ASC 520
	ASC 524
	ASC 530
	ASC 534
	ASC 540
	ASC 544
	ASC 550
	ASC 554
	ASC 560
	ASC 564
	ASC 570
	ASC 574
	ASC 600
	ASC 604
	ASC 610
	ASC 614
	ASC 620
	ASC 624
	ASC 630
	ASC 634
	ASC 640
	ASC 644
	ASC 650
	ASC 654
	ASC 660
	ASC 664
	ASC 670
	ASC 674
	ASC 700
	ASC 704
	ASC 710
	ASC 714
	ASC 720
	ASC 724
	ASC 730
	ASC 734
	ASC 740
	ASC 744
	ASC 750
	ASC 754
	ASC 760
	ASC 764
	ASC 770
	ASC 774

OPCTAB:	ASC 0
	ASC 1
	ASC 2
	ASC 3
	ASC 4
	ASC 5
	ASC 6
	ASC 7
	ASC 10
	ASC 11
	ASC 12
	ASC 13
	ASC 14
	ASC 15
	ASC 16
	ASC 17
	ASC 20
	ASC 21
	ASC 22
	ASC 23
	ASC 24
	ASC 25
	ASC 26
	ASC 27
	ASC 30
	ASC 31
	ASC 32
	ASC 33
	ASC 34
	ASC 35
	ASC 36
	ASC 37
	ASC 40
	ASC 41
	ASC 42
	ASC 43
	ASC 44
	ASC 45
	ASC 46
	ASC 47
	ASC 50
	ASC 51
	ASC 52
	ASC 53
	ASC 54
	ASC 55
	ASC 56
	ASC 57
	ASC 60
	ASC 61
	ASC 62
	ASC 63
	ASC 64
	ASC 65
	ASC 66
	ASC 67
	ASC 70
	ASC 71
	ASC 72
	ASC 73
	ASC 74
	ASC 75
	ASC 76
	ASC 77
	ASC 100
	ASC 101
	ASC 102
	ASC 103
	ASC JSYS
	ASC ADJSP
	ASC 106
	ASC 107
	ASC DFAD
	ASC DFSB
	ASC DFMP
	ASC DFDV
	ASC DADD
	ASC DSUB
	ASC DMUL
	ASC DDIV
	ASC DMOVE
	ASC DMOVN
	ASC FIX
	ASC EXTEND
	ASC DMOVEM
	ASC DMOVNM
	ASC FIXR
	ASC FLTR
	ASC UFA
	ASC DFN
	ASC FSC
	ASC IBP
	ASC ILDB
	ASC LDB
	ASC IDPB
	ASC DPB
	ASC FAD
	ASC FADL
	ASC FADM
	ASC FADB
	ASC FADR
	ASC FADRI
	ASC FADRM
	ASC FADRB
	ASC FSB
	ASC FSBL
	ASC FSBM
	ASC FSBB
	ASC FSBR
	ASC FSBRI
	ASC FSBRM
	ASC FSBRB
	ASC FMP
	ASC FMPL
	ASC FMPM
	ASC FMPB
	ASC FMPR
	ASC FMPRI
	ASC FMPRM
	ASC FMPRB
	ASC FDV
	ASC FDVL
	ASC FDVM
	ASC FDVB
	ASC FDVR
	ASC FDVRI
	ASC FDVRM
	ASC FDVRB
	ASC MOVE
	ASC MOVEI
	ASC MOVEM
	ASC MOVES
	ASC MOVS
	ASC MOVSI
	ASC MOVSM
	ASC MOVSS
	ASC MOVN
	ASC MOVNI
	ASC MOVNM
	ASC MOVNS
	ASC MOVM
	ASC MOVMI
	ASC MOVMM
	ASC MOVMS
	ASC IMUL
	ASC IMULI
	ASC IMULM
	ASC IMULB
	ASC MUL
	ASC MULI
	ASC MULM
	ASC MULB
	ASC IDIV
	ASC IDIVI
	ASC IDIVM
	ASC IDIVB
	ASC DIV
	ASC DIVI
	ASC DIVM
	ASC DIVB
	ASC ASH
	ASC ROT
	ASC LSH
	ASC JFFO
	ASC ASHC
	ASC ROTC
	ASC LSHC
	ASC 247
	ASC EXCH
	ASC BLT
	ASC AOBJP
	ASC AOBJN
	ASC JRST
	ASC JFCL
	ASC XCT
	ASC MAP
	ASC PUSHJ
	ASC PUSH
	ASC POP
	ASC POPJ
	ASC JSR
	ASC JSP
	ASC JSA
	ASC JRA
	ASC ADD
	ASC ADDI
	ASC ADDM
	ASC ADDB
	ASC SUB
	ASC SUBI
	ASC SUBM
	ASC SUBB
	ASC CAI
	ASC CAIL
	ASC CAIE
	ASC CAILE
	ASC CAIA
	ASC CAIGE
	ASC CAIN
	ASC CAIG
	ASC CAM
	ASC CAML
	ASC CAME
	ASC CAMLE
	ASC CAMA
	ASC CAMGE
	ASC CAMN
	ASC CAMG
	ASC JUMP
	ASC JUMPL
	ASC JUMPE
	ASC JUMPLE
	ASC JUMPA
	ASC JUMPGE
	ASC JUMPN
	ASC JUMPG
	ASC SKIP
	ASC SKIPL
	ASC SKIPE
	ASC SKIPLE
	ASC SKIPA
	ASC SKIPGE
	ASC SKIPN
	ASC SKIPG
	ASC AOJ
	ASC AOJL
	ASC AOJE
	ASC AOJLE
	ASC AOJA
	ASC AOJGE
	ASC AOJN
	ASC AOJG
	ASC AOS
	ASC AOSL
	ASC AOSE
	ASC AOSLE
	ASC AOSA
	ASC AOSGE
	ASC AOSN
	ASC AOSG
	ASC SOJ
	ASC SOJL
	ASC SOJE
	ASC SOJLE
	ASC SOJA
	ASC SOJGE
	ASC SOJN
	ASC SOJG
	ASC SOS
	ASC SOSL
	ASC SOSE
	ASC SOSLE
	ASC SOSA
	ASC SOSGE
	ASC SOSN
	ASC SOSG
	ASC SETZ
	ASC SETZI
	ASC SETZM
	ASC SETZB
	ASC AND
	ASC ANDI
	ASC ANDM
	ASC ANDB
	ASC ANDCA
	ASC ANDCAI
	ASC ANDCAM
	ASC ANDCAB
	ASC SETM
	ASC SETMI
	ASC SETMM
	ASC SETMB
	ASC ANDCM
	ASC ANDCMI
	ASC ANDCMM
	ASC ANDCMB
	ASC SETA
	ASC SETAI
	ASC SETAM
	ASC SETAB
	ASC XOR
	ASC XORI
	ASC XORM
	ASC XORB
	ASC IOR
	ASC IORI
	ASC IORM
	ASC IORB
	ASC ANDCB
	ASC ANDCBI
	ASC ANDCBM
	ASC ANDCBB
	ASC EQV
	ASC EQVI
	ASC EQVM
	ASC EQVB
	ASC SETCA
	ASC SETCAI
	ASC SETCAM
	ASC SETCAB
	ASC ORCA
	ASC ORCAI
	ASC ORCAM
	ASC ORCAB
	ASC SETCM
	ASC SETCMI
	ASC SETCMM
	ASC SETCMB
	ASC ORCM
	ASC ORCMI
	ASC ORCMM
	ASC ORCMB
	ASC ORCB
	ASC ORCBI
	ASC ORCBM
	ASC ORCBB
	ASC SETO
	ASC SETOI
	ASC SETOM
	ASC SETOB
	ASC HLL
	ASC HLLI
	ASC HLLM
	ASC HLLS
	ASC HRL
	ASC HRLI
	ASC HRLM
	ASC HRLS
	ASC HLLZ
	ASC HLLZI
	ASC HLLZM
	ASC HLLZS
	ASC HRLZ
	ASC HRLZI
	ASC HRLZM
	ASC HRLZS
	ASC HLLO
	ASC HLLOI
	ASC HLLOM
	ASC HLLOS
	ASC HRLO
	ASC HRLOI
	ASC HRLOM
	ASC HRLOS
	ASC HLLE
	ASC HLLEI
	ASC HLLEM
	ASC HLLES
	ASC HRLE
	ASC HRLEI
	ASC HRLEM
	ASC HRLES
	ASC HRR
	ASC HRRI
	ASC HRRM
	ASC HRRS
	ASC HLR
	ASC HLRI
	ASC HLRM
	ASC HLRS
	ASC HRRZ
	ASC HRRZI
	ASC HRRZM
	ASC HRRZS
	ASC HLRZ
	ASC HLRZI
	ASC HLRZM
	ASC HLRZS
	ASC HRRO
	ASC HRROI
	ASC HRROM
	ASC HRROS
	ASC HLRO
	ASC HLROI
	ASC HLROM
	ASC HLROS
	ASC HRRE
	ASC HRREI
	ASC HRREM
	ASC HRRES
	ASC HLRE
	ASC HLREI
	ASC HLREM
	ASC HLRES
	ASC TRN
	ASC TLN
	ASC TRNE
	ASC TLNE
	ASC TRNA
	ASC TLNA
	ASC TRNN
	ASC TLNN
	ASC TDN
	ASC TSN
	ASC TDNE
	ASC TSNE
	ASC TDNA
	ASC TSNA
	ASC TDNN
	ASC TSNN
	ASC TRZ
	ASC TLZ
	ASC TRZE
	ASC TLZE
	ASC TRZA
	ASC TLZA
	ASC TRZN
	ASC TLZN
	ASC TDZ
	ASC TSZ
	ASC TDZE
	ASC TSZE
	ASC TDZA
	ASC TSZA
	ASC TDZN
	ASC TSZN
	ASC TRC
	ASC TLC
	ASC TRCE
	ASC TLCE
	ASC TRCA
	ASC TLCA
	ASC TRCN
	ASC TLCN
	ASC TDC
	ASC TSC
	ASC TDCE
	ASC TSCE
	ASC TDCA
	ASC TSCA
	ASC TDCN
	ASC TSCN
	ASC TRO
	ASC TLO
	ASC TROE
	ASC TLOE
	ASC TROA
	ASC TLOA
	ASC TRON
	ASC TLON
	ASC TDO
	ASC TSO
	ASC TDOE
	ASC TSOE
	ASC TDOA
	ASC TSOA
	ASC TDON
	ASC TSON

	END