; Load DUS-III from the tape.


; Set up the log(s).

set -N console log=ADCCWRITE.log
set -N console debug=ADCCWRITE-debug.log

set imba debug=csrw;data
set adcc debug,nodebug=pserv
set cpp  debug


; Establish the initial environment.

echo
echo Configuring the simulation environment.

set CPU 512K,CIS

set console DEL=177

set IMBA ENABLED

break delay 30 milliseconds


; Set up the ADCC.

attach ADCC 1054

! start E:\Simulation\QCTerm\qcterm.exe F:\Simulation\HP 700\Config\mux.qct

set ADCC CONNECT


echo
echo
echo -----------------------------
echo Diagnostic Utility System III
echo -----------------------------
echo
echo Loading DUS-III.


; Cold load the DUS-III tape.

attach -e -r MS0 DUS-III.tape
boot MS0


echo
echo Configuring the diagnostic.

deposit SWCH 2


; Load and start the diagnostic.
;
; The diagnostic loads from tape and then waits for a <CR>.

echo
echo Starting the diagnostic.

reply "\r" delay 2 seconds

go until "\r\n:" ; reply "AID\r"


; write a text string to ADCC port 1
;
; CC(0) = 98--H (Secondary 1 = reset | 8 bit)
; CC(1) = 0818H (Secondary 6 = xmit 9600 baud | recv 9600 baud)
; CC(2) = 0400H (Secondary 3 = enable mask 0 } disable mask 0)
; CC(3) = 0602H (Secondary 3 = enable mask 2 } disable mask 2)

; sec 1 data %230
; sec 3 data 4,6
; sec 6 data %10,%30
; sec 0 data <text>

; Line 10
go until "\r\n> " ; reply 'DB &PP,80\r'
go until "\r\n> " ; reply 'DB CC,10,0\r'
go until "\r\n> " ; reply 'ASSIGN CC(0),!980D,!0818,!0400,!0602\r'
go until "\r\n> " ; reply 'LET CHANNEL:=2,DEVICE:=1\r'
go until "\r\n> " ; reply 'BSIO II              . INITIALIZATION\r'
go until "\r\n> " ; reply 'WB !1,CC(0),1        . UART CONTROL\r'
go until "\r\n> " ; reply 'WB !6,CC(1),1        . BAUD RATE\r'
go until "\r\n> " ; reply 'WB !6,CC(1),1,,,R    . BAUD RATE\r'
go until "\r\n> " ; reply 'IN H\r'
go until "\r\n> " ; reply 'RSIO\r'
go until "\r\n> " ; reply 'BSIO PP\r'
go until "\r\n> " ; reply 'WB !3,CC(2),1        . ENABLE SERVICE MASK\r'
; Line 130
go until "\r\n> " ; reply 'WB !0,&PP(0),0       . WRITE UART\r'
go until "\r\n> " ; reply 'JUMP 170             . DONE\r'
go until "\r\n> " ; reply 'WAIT                 . WAIT UNTIL READY\r'
go until "\r\n> " ; reply 'JUMP 130             . CONTINUE\r'
; Line 170
go until "\r\n> " ; reply 'WB !3,CC(2),1,,,R    . DISABLE SERVICE MASK\r'
go until "\r\n> " ; reply 'IN H\r'

go until "\r\n> " ; reply 'ESIO\r'
go until "\r\n> " ; reply 'LET &PP(0,18):="HELLO FROM THE ADCC"\r'
go until "\r\n> " ; reply 'LET P:=19\r'
go until "\r\n> " ; reply 'LET &PP(P):=13\r'
go until "\r\n> " ; reply 'LET P:=P+1\r'
go until "\r\n> " ; reply 'LET &PP(P):=10\r'
go until "\r\n> " ; reply 'LET P:=P+1\r'
go until "\r\n> " ; reply 'LET PP(35):=P         . SET THE COUNT INTO PROGRAM COPY 0\r'
go until "\r\n> " ; reply 'RSIO PP\r'
go until "\r\n> " ; reply 'END\r'

go until "\r\n> " ; reply "RUN\r"
go until "\r\n> " ; reply "LIST %B,PP\r"


; Exit

go until "\r\n> " ; reply "EXIT\r"
go until "?"      ; reply "YES\r"

go until "\r\n:"

exit