PS5 - Department of Electrical and Computer Engineering The...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Department of Electrical and Computer Engineering The University of Texas at Austin EE 306, Spring 2008 Problem Set 5 Due: Not To Be Turned In Ramesh Yerraballi, Instructor TAs: Jasveen Kaur, Nady Obeid Consider the following LC-3 assembly language program. Assumming that the memory locations DATA get filled before the program executes, what is the relationship between the final values at DATA and the initial values at DATA? .ORIG x3000 LEA R0, DATA AND R1, R1, #0 ADD R1, R1, #9 LOOP1 ADD R2, R0, #0 ADD R3, R1, #0 LOOP2 JSR SUB1 ADD R4, R4, #0 BRzp LABEL JSR SUB2 LABEL ADD R2, R2, #1 ADD R3, R3, #-1 BRp LOOP2 ADD R1, R1, #-1 BRp LOOP1 HALT DATA .BLKW #10 SUB1 LDR R5, R2, #0 NOT R5, R5 ADD R5, R5, #1 LDR R6, R2, #1 ADD R4, R5, R6 RET SUB2 LDR R4, R2, #0 LDR R5, R2, #1 STR R4, R2, #1 STR R5, R2, #0 RET .END 1. During the initiation of the interrupt service routine, the N, Z, and P condition codes are saved on the stack. By means of a simple example show how incorrect results would be generated if the condition codes were not saved. Also, clearly describe the steps required for properly handling an interrupt. 2. Fill in the missing blanks so that the subroutine below implements a stack multiply. That is it pops the top two elements off the stack, multiplies them, and pushes the result back on the stack. You can assume that the two
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/03/2008 for the course EE 306 taught by Professor Ambler during the Spring '07 term at University of Texas.

Page1 / 4

PS5 - Department of Electrical and Computer Engineering The...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online