.ENABLE SUBSTITUTION
; DDT BUILD COMMAND FILE.
;	This command file generates versions of DDT with many options.
;however, REMEMBER that there are more options that are NOT generated here
;and, especially on IAS systems, you may wish to edit this file to produce
;a version of DDT that suits your needs. This file addresses only
;RSX11M, RSX11M-Plus, and IAS systems; DOS and RT11 users should assemble by
;making parameter files by hand...see the DDT listing.
.SETS IAS31 ";"
.SETF DBLSW
.SETF IMGG
.SETF MDBGS
.SETF CDBP
.SETF OVLQ
.SETF SRQ
.SETN SRQV 0
.SETF MPQ
.SETF CDQ
;DDT BUILD FILE FOR VARIOUS TYPES OF DDT
;If you select conditional breakpoints you may fill in a mask
;in the array D.BMSK with any nonzero mask and if the corresponding
;breakpoint is reached, that mask will be ANDed with the value at
;the location you specified to open at the breakpoint, and if the
;result is different from the value you specified in the array
;D.BTST at the corresponding position, the breakpoint will be
;ignored. The sign bit is a likely bit to test this way by setting
;the mask to 100000 octal and testing from 100000 or 000000.
.ASK CDBP WANT CONDITIONAL BREAKPOINT SUPPORT
.L1:
;DDT may be built to run as part of the user task (1-task DDT) or to
;run in a separate task DDT22M. The next question asks which you
;want to create here. Reply Yes for a version that runs as part of
;your task, No for the version that is a separate task.
.ASK SU BUILDING 1-TASK DDT
;DDT may be built to be able to display or insert 32 bit integers in
;storage order (low,high) using the addr$J command to display, and
; the addr$1Jnumber command to insert the numbers.
.ASK DBLSW Should DDT be able to handle 32 bit integer display/exam
.SETT MM
.SETT FLS
.IFF SU .GOTO XMMM
;If you wish to build a version of DDT that lives in your task but
;can access memory anywhere in the machine (via a common in the I/O page
;or being privileged), reply Yes next. If you will want to be able to access
;core image files you must reply yes.
.XMMM:
.IFT SU .ASK MM BUILDING MEMORY-ACCESS DDT
.IFF SU .ASK IMGG SHOULD DDT22M ISSUE ITS OWN $G TO START AUTOMATICALLY
.IFT SU .ASK FLS WANT ABILITY TO READ SYM TBL FILES
.ASKS OPSYS WHAT IS OPERATING SYSTEM (IAS,RSX11M,RSX11MPLUS)
.IF OPSYS NE "IAS" .GOTO NOWRN
.IFT SU .IFF MM .GOTO NOWRN
;NOTE FOR IAS USERS: This DDT version [2/19/1981] supports IAS V3.0
;data structures and can locate tasks in physical memory in IAS V3.0.
;HOWEVER, it may NOT access tasks' memory correctly in IAS V3.1 and in
;that case, you should specify access to other tasks' space either
;via pure send-receive directives [see below] or not at all. The
;code after DBG11M: will need to be altered for IAS V3.1 once it becomes
;clear how task memory use can be determined. Access to memory spaces
;such as "Kernel space" [or arbitrary spaces via setting PAR0-PAR7]
;is still legal in IAS V3.1.
;	FURTHER NOTE:
;DDT22M may need to run realtime to work. However, try building the target
;task with the /SR switch in your taskbuilds. It may be needed to get
;the DDT suspend/resumes to work. The /SR switch may be in IAS V3.1 only.
.NOWRN:
.ASK FP DO YOU HAVE FPU SUPPORT
;DDT may be used as a code profiler by setting PRFCTL to 1, setting
;PRFBAS to the base address to profile, setting PRFSHF to the shift
;count right (0,1,2,3,...) to shift address offsets to define bin size,
;and going into multiple single step mode to execute in single step and
;record executions of each address (or address bin) in a histogram
;area called PRFHST and of size (bytes) of PRFSIZ. This area can be
;examined by DDT in DDT space later.
.ASK PRFLR DO YOU WANT TO BE ABLE TO PROFILE CODE?
.IFT PRFLR .ASKS PFWS HOW MANY WORDS OF PROFILER HISTOGRAM WANTED?
.SETN COR 256
.IFT MM ;give the amount of memory on your machine followed by decimal point
.IFT MM .ASKN COR WHAT IS CORE SIZE IN K WORDS (K=1024)
.SETN COR8 COR*32.
.SETN COR8 COR8-1
.SETF FCSR
.SETF M32
.SETF DDBG
.SETF SAST
.SETT BIT22
.IFT SU .GOTO XSRQQ
;If you wish, DDT may have the option of either mapping into the target
;task's space directly for speed, but with some risk of error if the target
;task is shuffled/checkpointed, or via sends and receives exclusively. The
;send/receive method is much slower, but safe against shuffling, etc.
;If you select the ability to modify via send/rcv, the mapping ability
;remains and the state of variable SR.CTL determines which is used. If
;you answer Yes to the next question, you will be asked for the initial
;state to select a mapping method.
.XSRQQ:
.IFF SU .ASK SRQ MODIFY TASKS EXCLUSIVELY VIA SEND/RCV DATA
.IFT SRQ .ASKN SRQV WHAT IS INIT STATE OF SND/RCV CONTROL (1=0N,0=OFF)
;a special variable OVRBRK may be set to a breakpoint's address to
;prevent loading any other instructions back at that breakpoint only.
;It is intended that $ALBP2 be the location normally to allow a break
;in overlay load code (you then remove and reset breaks yourself)
;but the option may not always be desired.
.ASK OVLQ WANT SPECIAL OVERLAY-CODE BREAK FLAG
;DDT may examine memory image files as though they were core, when $UM
;mode is in effect and the $1L command has been used to open a memory
;image file. All other options remain if this is selected, but DDT
;will then need to do file access which will add to its size.
.ASK CDQ WANT ABILITY TO EXAMINE MEM IMAGE FILES
.SETF XMPRC
.IFT SRQ .GOTO TCDQ
.IFF CDQ .GOTO XDCDQ
.IFF SU .GOTO XDCDQ
.TCDQ:
;Normal assembly options require a DDT able to access memory image files
;to also have total memory access. This may be disabled optionally so
;the resulting DDT can access files or its own memory, but not arbitrary
;system memory.
;DDT also does not really need to access arbitrary memory if it may
;use send/receive to communicate with other tasks.
;Reply Y to the next question to prevent DDT from having
;access to arbitrary memory:
.ASK XMPRC DISABLE DDT ACCESS TO ARBITRARY MEMORY
.IFT XMPRC .SETT MDBGS
.XDCDQ:
.IFF SU .ASK DDBG WANT INTERNAL DDT DEBUG CAPABILITY (normal No)
.IFF SU .ASK SAST SHOULD MESSAGE ASTS BE DISABLED DURING BREAKS (Y NORMAL)
.IF OPSYS EQ "IAS" .GOTO XMPQ
.IFF SU .IFT MDBGS .SETF MPQ
.IFF SU .IFT MDBGS .GOTO XMPQV
.IFT SU .GOTO XMPQ
;Normally DDT22M maps to the target task at each break. You may get
;it to map at every reference, but at substantial time overhead cost
;by replying Yes to the next question. Normally reply No.
.XMPQ:
.IF OPSYS NE "IAS" .IFF SU .ASK MPQ MAP TO TARGET TASK AT EVERY READ/WRITE
.XMPQV:
.ASK CLENE CLEAN UP CREATED FILES
.IF COR GT 124. .GOTO B22Y
.IFT MM .ASK BIT22 IS YOUR MACHINE A 22-BIT PDP11 (11/44 OR 11/70)
.B22Y:
.IF OPSYS EQ "IAS" .GOTO DOIAS
.IF OPSYS EQ "RSX11M" .GOTO DO11M
.IF OPSYS EQ "RSX11MPLUS" .GOTO DOMPL
;OPERATING SYSTEM UNKNOWN... RETRY.
; operating system must be IAS (enter IAS for RSX11D), RSX11M, or RSX11MPLUS
.GOTO L1
.DOIAS:
.ASK V31 Is your system  IAS V3.1 ??
.IFT V31 .SETS IAS31 "I$AS31=0"
.SETT IAS
.SETF RMM
.SETF RMP
.SETF RXM
.GOTO DOCMN
.DO11M:
.SETF IAS
.SETT RMM
.SETF RMP
.SETT RXM
.GOTO DOCMN
.DOMPL:
.SETF IAS
.SETT M32
.SETF RMM
.SETT RMP
.SETT RXM
.DOCMN:
.IFT RMM .ASK M32 IS THIS RSX11M 3.2 OR LATER WITH FULL DUPLEX TT HANDLER
.IFT RMM .ASK FCSR IS THERE AN FCSRES TO LINK TO
.IFF CDQ .GOTO XXCDQ
;The Logical Unit you choose for core images should be one legal
;for the task you'll build DDT with. 3 is a good choice for DDT22M.
.XXCDQ:
.SETS CDLN "0"
.IFT CDQ .ASKS CDLN WHAT LUN SHOULD BE USED FOR CORE IMAGE FILES
.OPEN DDTPRM.MAC
.DATA X$RSX=0 ;LOCAL DEFS FOR RSX VERSION
.DATA Q$UIET=0 ;OMIT DDT ASSEMBLY PRINTS FOR NON-SUSPICIOUS CONDITIONS
.IFT IMGG .DATA IM$$G=0
.IFT CDBP .DATA CND$BK=0
.IFF BIT22 .DATA $ADR18=0 ;I/O PAGE IS UNIBUS TYPE.
.IFT CDQ .DATA CD$FIL=0 ;ALLOW CORE IMAGE DUMPS
.IFT CDQ .DATA CD.LUN='CDLN'
.IFT PRFLR .DATA PR$FIL=0 ;ALLOW PROFILER CODE
.IFT PRFLR .DATA PF$SZZ='PFWS' ;LENGTH IN WORDS OF HISTOGRAM
.IFT IAS .DATA 'IAS31'	;NULL OR CONDITIONAL FOR IAS V3.1 SUPPORT
.IFT MPQ .DATA MP$ONE=0 ;MAP AT EACH GETCAD OR PUTCAD TO TGT TASK
.IFT DBLSW .DATA DB$L=0 ;ALLOW 32 BIT INTEGER COMMANDS
.IFT XMPRC .DATA X$MPP=0 ;DISABLE ACCESS TO ARBITRARY MEMORY
.DATA $$RSX=0 ;SOME KIND OR RSX/IAS
.IFT SU .DATA MSX11D=0 ;NO DDT TRAP INSTRUCTION INTERCEPT IF DEFINED
.DATA D.MCRO=0 ;ALLOW DDT MACROS
.IFT RXM .DATA $RSXMM=0 ;RSX11M OR M+
.IFT RMP .DATA K$ID=0 ;RSX11M+ KNL I/D SPACE
.DATA MAXBK='COR8'.
.DATA $XOK=0	;ALLOW INST$X IN OTHER TASK
.IFT OVLQ .DATA X$OVL=0
.IFT OVLQ .DATA XX$OVL=0 ;NO SPECIAL ACTION ON RESTORE
.IFF SU .IFT SRQ .DATA SPC$MP='SRQV'
.IFT MM .DATA $VMEM=0
.IFF SU .DATA MU$DBG=0 ;INTERTASK DEBUGGER
.IFT FLS .DATA SM$FIL=0 ;ALLOW SYMBOL TBL LOOKUPS
.DATA MEM$BK=0	;ALLOW MEMORY BREAKS
.IFT MDBGS .GOTO XMDBGG
.IFF SU .IFT IAS .DATA R$XDDB=0 ;IAS INTERTASK FINDER VERSION
.IFF SU .IFT RXM .DATA R$XMDB=0 ;RSX11M/M+ INTERTASK FINDER VERSION
.XMDBGG:
.IFT FP .DATA $D$FPU=0
.IFT FP .DATA $FOP$=0
.IFT M32 .DATA MV3.2=0 ;RSX11M V3.2
.IFT M32 .DATA MMV3.2=0 ;TERMINAL HANDLING
.IFT DDBG .DATA ER$SV=0 ;ALLOW DDT INTERNAL ERROR DIAGNOSIS
.IFT M32 .DATA F$DPX=0 ;FULL DUPLEX NO-ECHO READ
.IFT IAS .DATA F$DPX=0 ;READ NO-ECHO AND DDT EXPLICIT TYPE OF ECHO
.IFF SU .DATA $$SDT=0 ;SYSTEM DEBUGGER OPTION
.DATA KDPAR0=172360
.DATA UDPAR0=177660
.CLOSE
.IFT SU .GOTO NOPR2
.OPEN DDTPRM2.MAC
.DATA X$RSX=0 ;LOCAL DEFS FOR RSX VERSION
.IFT SAST .DATA X$AST=0 ;TURN OFF ASTS IN TGT TSKS DURING BRKPTS
.IFT CDBP .DATA CND$BK=0
.DATA $$RSX=0 ;SOME KIND OR RSX/IAS
.IFT RXM .DATA $RSXMM=0 ;RSX11M OR M+
.IFT RMP .DATA K$ID=0 ;RSX11M+ KNL I/D SPACE
.IFT OVLQ .DATA X$OVL=0
.IFT OVLQ .DATA XX$OVL=0 ;NO SPECIAL ACTION ON RESTORE
.IFF SU .IFT SRQ .DATA SPC$MP='SRQV'
.IFT IAS .DATA 'IAS31'	;NULL OR CONDITIONAL FOR IAS V3.1 SUPPORT
.DATA SM$FIL=0 ;ALLOW SYMBOL TBL LOOKUPS
.DATA $VMEM=0
.DATA MU$DBG=0 ;INTERTASK DEBUGGER
.IFT MDBGS .GOTO XMDBGH
.DATA R$XMDB=0 ;UST THIS TO USE WHATEVER INTERTASK FINDER IS IN DDT
.XMDBGH:
.DATA $XOK=0
.IFT FP .DATA $D$FPU=0
.IFT FP .DATA $FOP$=0
.DATA MEM$BK=0	;ALLOW MEMORY BREAKS
.IFT M32 .DATA MV3.2=0 ;RSX11M V3.2
.IFT M32 .DATA MMV3.2=0 ;TERMINAL HANDLING
.IFT M32 .DATA F$DPX=0 ;FULL DUPLEX NO-ECHO READ
.IFT IAS .DATA F$DPX=0 ;READ NO-ECHO AND DDT EXPLICIT TYPE OF ECHO
.DATA $$SDT=0 ;SYSTEM DEBUGGER OPTION
.CLOSE
.NOPR2:
.IFF SU .IFT RXM MAC DDT22=LB:[1,1]EXEMC/ML,SY:'<UIC>'DDTPRM,DDT22
.IFT SU .IFT RXM MAC DDT22=DDTPRM,DDT22
.IFT IAS MAC DDT22=DDTPRM,DDT22
.IFF SU MAC DDTMU=DDTPRM2,DDTMU
.IFF SU MAC DDTKNL=DDTPRM2,DDTKNL
.IFT SU .IFT CLENE PIP DDTPRM.MAC;0/DE/NM
.IFT SU .GOTO ALLDUN
.SETS FPS "/FP"
.IFF FP .SETS FPS ""
;NOTE IF DDTPRM SPECIFIES FLOATING POINT ISSUE
;MAC DDTKNL=DDTKNL
;FOR NON-FLOATING-POINT TASKS DEBUGS
.OPEN DDT22MBLD.CMD
.IFT IAS .DATA DDT22M'FPS'/CP/PR=DDTMU,DDT22/DA,[11,17]EXECUTIVE.STB/SS
.IFT RXM .DATA DDT22M'FPS'=DDTMU,DDT22/DA,LB:[1,54]RSX11M.STB/SS
.DATA /
.DATA TASK=DDT22M
.IFT IAS .DATA LIBR=EXTCOM:RW
.IFT RXM .DATA COMMON=EXTCOM:RW:7
.IFT RMP .DATA SUPLIB=FCSFSL:SV
.IFT IAS .DATA ACTFIL=4
.IFT IAS .DATA LIBR=SYSRES:RO
.IFT RMM .IFT FCSR .DATA LIBR=FCSRES:RO
.DATA PRI=50
.DATA ASG=TI:1:2:3:4:5:6
.DATA //
.CLOSE
TKB @DDT22MBLD
.IFT CLENE PIP DDTPRM.MAC;0,DDTPRM2.MAC;0,DDT22MBLD.CMD;0/DE/NM
.IFT CLENE PIP DDTMU.OBJ;0,DDT22.OBJ;0/DE/NM
;DONE. LINK TO DDTKNL/DA TO USE. RUN DDT22M FIRST, WITH
;TASK NAME DDT22M. MUST ABORT DDT22M AFTER DONE.
.ALLDUN:
