Answered step by step
Verified Expert Solution
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 assembly code below which defines the HALT service routine:
ORIG x ; Where this routine resides
ST R SaveR ; R: a temp for MC register
ST R SaveR ; R is used as working space
;
; print message that machine is halting
;
LD R ASCIINewLine TRAP x
LEA R Message TRAP x
LD R ASCIINewLine TRAP x
;
; clear bit at xFFFE to stop the machine
;
LDI R MCR ; Load MC register into R
LD R MASK ; R xFFF
AND R R R ; Mask to clear the top bit
STI R MCR ; Store R into MC register
;
; return from HALT routine.
;
LD R SaveR ; Restore registers LD R SaveR
RTI
;
; Some constants
;
ASCIINewLine FILL xA SaveRBLKW
SaveRBLKW
Message STRINGZ "Halting the machine."
MCR FILL xFFFE ; Address of MCR
MASK FILL xFFF ; Mask to clear the top bit
END
a points What starts the clock after the machine is HALTed? Hint: How can the HALT
service routine return after bit of the Master Control Register is cleared?
b points Which instruction actually halts the machine?
c points What is the first instruction executed when the machine is started again?
d points Where will the RET of the HALT routine return to
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started