Sat, 7th Nov 2015, 15:48 Re: trap and jsr instructions



A student writes:


> We encountered a test question in which a trap instruction was used in a
> sub routine (
> http://users.ece.utexas.edu/~patt/15f.306/Exams/OldExams/f06_exam2.pdf
> question 4). We found that the trap instruction replaced the content of R7
> so we are wondering does the trap instruction save and load the registers
> before and after its execution?
>
> Thank you for your time,
> A student who does not know what trap does


Thank you for coming up with your own "signature" so I don't have to
exhaust my creativity.  I will leave it to my students to decide whether
they prefer you giving yourself a signature or me creating one.

In any case, I see you are looking at old exams to prepare for the midterm.
Always a good idea, with one caveat.  I am introducing concepts this semester
in a different order than I did when I gave the midterm you are looking at.
This semester we have not yet talked about how the TRAP instruction works,
so you can be sure it will not be on the midterm next Wednesday.  At this
point in the course you know that the TRAP instruction enables you to get
the operating system to do your bidding, like TRAP x25 instructs the O/S to
halt the computer.  Beyond that, you will have to wait until after the
midterm to learn how it works.

Good luck preparing for the midterm.



Yale Patt