Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the LC - 3 assembly code below which defines the HALT service routine: . ORIG x 0 5 2 0 ; Where this routine

Consider the LC-3 assembly code below which defines the HALT service routine:
.ORIG x0520 ; Where this routine resides
ST R1, SaveR1 ; R1: a temp for MC register
ST R0, SaveR0 ; R0 is used as working space
;
; print message that machine is halting
;
LD R0, ASCIINewLine TRAP x21
LEA R0, Message TRAP x22
LD R0, ASCIINewLine TRAP x21
;
; clear bit 15 at xFFFE to stop the machine
;
LDI R1, MCR ; Load MC register into R1
LD R0, MASK ; R0= x7FFF
AND R0, R1, R0 ; Mask to clear the top bit
STI R0, MCR ; Store R0 into MC register
;
; return from HALT routine.
;
LD R1, SaveR1 ; Restore registers LD R0, SaveR0
RTI
;
; Some constants
;
ASCIINewLine .FILL x000A SaveR0.BLKW 1
SaveR1.BLKW 1
Message .STRINGZ "Halting the machine."
MCR .FILL xFFFE ; Address of MCR
MASK .FILL x7FFF ; Mask to clear the top bit
.END
a)(2.5 points) What starts the clock after the machine is HALTed? Hint: How can the HALT
service routine return after bit [15] of the Master Control Register is cleared?
b)(2.5 points) Which instruction actually halts the machine?
c)(2.5 points) What is the first instruction executed when the machine is started again?
d)(2.5 points) Where will the RET of the HALT routine return to?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

What steps should be taken to address any undesirable phenomena?

Answered: 1 week ago