\documentclass{article}
\input{6828-preamble}

\begin{document}
\psetnum{5}
\date{2004/09/22}

\begin{pset}
  \begin{problem}
    The initial value of SR is 0. After setting it to 1, the kernel
    then prints
\begin{verbatim}
6.828 kernel
mem = 1035  
\end{verbatim}
    before the login prompt. Setting the switch to a non-zero value
    enables printing to the console (in putchar). (It was very sneaky
    to write 6.828 in octal in the source.)
  \end{problem}

  \begin{problem}
    When the kernel is stopped at address 40, the next instruction is
    \texttt{JMP 3316}. After it executes, the PC is 003316.

    Instructions have variable lengths. The \texttt{BIT \#1,177572}
    instruction is 8 words long, longer than the 2-word-long
    \texttt{BNE 3316} instruction.

    A transcript follows.

\begin{verbatim}
sim> reset
sim> d break 40
sim> boot rk0
@unix
        
Breakpoint, PC=000040  (JMP 3316)
R0=137000 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tnZvc)
        
sim> s  
        
Step expired, PC: PC=003316  (BIT #1,177572)
R0=137000 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tnZvc)
        
sim> e 003316-003336
3316:   032767
3320:   000001
3322:   174246
3324:   001374
3326:   000005
3330:   012700
3332:   172340
3334:   012701
3336:   172300
sim> e -m 003316-003336
3316:   BIT #1,177572
3324:   BNE 3316
3326:   RESET
3330:   MOV #172340,R0
3334:   MOV #172300,R1
sim>  t 5
PC=003316  (BIT #1,177572)
R0=137000 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tnZvc)
        
PC=003324  (BNE 3316)
R0=137000 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tnZvc)
        
PC=003326  (RESET)
R0=137000 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tnZvc)
        
PC=003330  (MOV #172340,R0)
R0=137000 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tnZvc)
        
PC=003334  (MOV #172300,R1)
R0=172340 R1=177404 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000344 (CM=0,PM=0,IPL=7,tNzvc)
        
        
Step expired, PC: PC=003340  (MOV #200,R4)
R0=172340 R1=172300 R2=071000 R3=136064 R4=135030 R5=135770
KSP=136776 USP=177756 PSW=000350 (CM=0,PM=0,IPL=7,tNzvc)
        
sim> d break 177777
sim> c  
6.828 kernel
mem = 1035

login:  
\end{verbatim}
  \end{problem}
\end{pset}

\end{document}