




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: Machine Dependent Prog; Subject: Engineering Computer Science; University: University of California - Davis; Term: Summer 2007;
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





LDA# $E OUTB $ INB $ HLT
What does the Accumulator contain after the HLT instruction is executed?
.EQU @,$ LDA# $ L0: LDX# 7 L1: STC L L2: LDX# 8 LDC S .WORD $ STC L L3: HLT S1: .WORD $3F001A S2: .WORD $ S3: .WORD $9DA .END
What memory locations and registers are altered by the execution of this program? Show the values of the registers and memory locations that have changed when the program ter- minates. Assume the program begins execution at location 000.
ACC = XR = PC = SP = FP = MEM[ ] = MEM[ ] = MEM[ ] = MEM[ ] = MEM[ ] =
.EQU @,$ .EQU CNT, .EQU ARR, .EQU LENTH,
PAR: BGN# 3 PSHA PSHX ( Write down Contents of Stack at this point, as well as the value of the Stack Pointer and the Frame Pointer ) Mem Address Mem Contents
.EQU INTERRUPT_ENA,$ .EQU BELL,$ .EQU STACKTOP,$E
MAIN: LDA# INTERRUPT_ENA ; enable kbd interrupts OUTB KBD_DATA
LOOP: NOP JMP LOOP
KBD_ISR: PSHA ; save registers INB KBD_DATA ; read keystroke LDA# BELL ; ring bell OUTB CRT_DATA
EXIT: POPX ; restore registers RTN
.END
Keyboard Register Bit Number Interpretation 7654 3210
Control x--- ---- 1 = enable interrupts, 0 = disable interrupts -x-- ---- 1 = flush buffer, 0 = no operation --xx xxxx unused (no affect)
Status x--- ---- 1 = ready (data available) -x-- ---- 1 = interrupt enabled --xx xxxx unused (always zero)
Interrupt Addr $FF
Tape Drive Register Bit Number Interpretation 7654 3210 Control x--- ---- 1 = enable interrupts, 0 = disable interrupts -x-- ---- 1 = clear interrupt request, 0 = no operation --xx ---- 00 = no operation 01 = read record 10 = write record 11 = rewind tape ---- xxxx unused (no affect) Status x--- ---- 1 = ready (to begin new operation) -x-- ---- 1 = interrupt enabled --x- ---- 1 = tape mounted ---x ---- 1 = interrupt pending ---- 1--- 1 = end of tape encoutered on read ---- -xxx unused (always zero) Interrupt Addr $FFA
Printer Register Bit Number Interpretation 7654 3210
Control x--- ---- 1 = enable interrupts, 0 = disable interrupts -x-- ---- 1 = clear interrupt request, 0 = no operation --xx xxxx unused (no affect)
Status x--- ---- 1 = ready (to receive character) -x-- ---- 1 = interrupt enabled --x- ---- 1 = printer on-line ---x ---- 1 = interrupt pending ---- xxxx unused (always zero)
Interrupt Addr $FF
Timer Register Bit Number Interpretation 7654 3210 Control x--- ---- 1 = enable interrupts, 0 = disable interrupts -x-- ---- 1 = clear ready bit, 0 = no operation --xx ---- 00 = no operation 01 = start timer (after loading counter) 10 = stop timer 11 = start timer (without loading counter) ---- xxxx unused (no affect) Status x--- ---- 1 = ready (count complete) -x-- ---- 1 = interrupt enabled --xx xxxx unused (always zero) Interrupt Addr $FFB