Question: Problem 1 For the below code, if the label ONE is at address x2000, what are the addresses of the labels TWO, THREE and FOUR?

Problem 1

For the below code, if the label "ONE" is at address x2000, what are the addresses of the

labels TWO, THREE and FOUR?

ONE .FILL xF010

TWO .BLKW 10

THREE .STRINGZ "CS252"

FOUR .FILL x0004

Problem 2

Assume that we have a new interrupt service routine starting at memory location x1000,

which is shown below. This subroutine takes an argument from register R0, and prints "1" on

the console that many times. For example, if R0 is 4 when the service routine is called, it

prints 1111 on the console. Below is the code for this interrupt service routine:

.ORIG x1000

LD R1, PRINT_1

ADD R2, R0, #0

BRz RETURN

ADD R0, R0, #-1

OUT

RETURN RET

PRINT_1 .FILL x31

Assume that the trap table entry at location x0050 contains the value x1000.

a. Identify the instruction that would invoke this service routine.

b. What is the error in this service routine? How can you fix it?

c. Modify the service routine so as to make it callee saved.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!