Tue, 19 Nov 2013, 04:21



A student writes:  
 
 
> Dear Professor Yale Patt,
>
> I have three Questions about program 4,


I will answer each of his three questions in-line:

 
> For the Nim program,
>
> 1. Once all the rocks have been taken out of either row A, B, or C.
> Should my program print, for example without the quotation marks
> shown, "ROW B: " or "ROW B:" (without a space) as I cannot tell from
> the sample?


"With a space."

 
> 2. Should there be an enter after the HALT instruction prints "-
> Halting the processor - " as the sample does not show it?


We want to see the following:

Player 2 Wins.
- Halting the processor -

That is,
a. the line announcing the winner, followed by
b. a line feed, followed by
c. the line "- Halting the processor -"

and that is it!

 
> 3. For debugging purposes, when a JSR instruction is executed, does
> the program change to supervisor mode? If so, how will I be able to
> debug my subroutine code?


No, neither the JSR instruction nor the subroutine itself requires privilege
to execute.  User Mode is fine.  So testing and debugging your subroutine
is not a problem.  You might find some of the information in the tutorial 
on the Simulator useful by the way with respect to JSR.

Subroutines are part of your user program so it would not make sense to
treat them different from other instructions in your user program.  i.e.,
no privilege required.

 
> Thanks,
> <<name withheld to protect the student is getting started on Prog 4 today>>


You are welcome.
Yale Patt