#!/usr/bin/expect -f # Set -h to emulate a human typist. set send_human {.3 .3 75 .3 9} set timeout -1 # Set this for a scratch build # N.B.: Only a scratch build is guaranteed to work! set rebuild 0 set rebuild 1 # Remove the old PQS8, for a clean start. spawn rm -f dt0.dt wait # Fire up a PDP-8, then walk it through the build steps. spawn pdp8 expect { {..$} { exp_continue } {.$} { send "DATE 30-JUL-99\r" } } expect -re {\n\.$} send "ASSIGN RKB0 TMP\r" expect -re {\n\.$} send "ASSIGN RKA1 A\r" expect -re {\n\.$} send "ASSIGN RKB1 B\r" expect -re {\n\.$} send "ASSIGN DTA1 SCR\r" if { $rebuild == 1 } { expect -re {\n\.$} send "ZERO TMP:\r" expect -re {\n\.$} send "SUBMIT PQSASM/T\r" expect -re {END BATCH\r\n\r\n\.$} } send "DIR TMP:/F\r" expect -re {\n\.$} if { $rebuild == 1 } { send "SUBMIT COMGEN/T\r" expect -re {END BATCH\r\n\r\n\.$} # # We will need "COMGEN.DU" and "DTAGEN.DU" later, and this seems # to be the only place to stash them. # Likewise the locally grown BYHAND.DU. send "COPY SCR: $} send -h "att dt0 dt2.dt\r" expect -re {\nsim> $} send -h "c\r" expect -re {\n$} send "ZERO DTA0:\r" expect -re {\n\.$} send "COPY DTA0: $} send -h "att dt0 dt0.dt\r" expect -re {\nsim> $} send -h "att dt2 dt2.dt\r" expect -re {\nsim> $} send -h "c\r" expect -re {\n$} # # We will need OS8CON.BN in the HSR later, for BIN. send "COPY PTP: } send "D SR 0\r" expect -re {\nsim> } send "C\r" expect -re {\nsim> } send "B DT\r" expect -re {\n\a\.$} # # BUGBUG: Why is PQS8 ignoring every other character? As a workaround, I'm # using send -h as necessary. # # Move the user files from block 300 to block 1000. # Otherwise, DUMP will over-write the user files while executing # the commands they contain! send -h "DUMP\r" expect -re {FUNCTION: $} send -h "ZA 0:16\r" expect -re {\n$} send -h "177/1000\r" expect -re {\n$} send -h "\033" expect -re {FUNCTION: $} send -h "EX" expect -re {\n\a\.$} # # Here we have a problem. We want to run DUMP with input from "comgen.du". # The only copy available to PQS8 is on unit 1 (formerly SCR:), after all # the binaries. # # OS8CON is in the high speed reader, so load it. # /F Use HSR; /P Load BIN tape; /V Use virtual loader. send -h "BIN % $} send -h "q\r" expect -re {file\r} expect -re {file\r} close exit 0