Question

QUESTION 1 Convert the following code fragment to assembly code fragment, using instructions discussed in class....

QUESTION 1

Convert the following code fragment to assembly code fragment, using instructions discussed in class.

if X > Y then Y=X

else X=Y

2 QUESTION

Suppose a user wants to do a system call. Assume that the service routine of this system call is at physical address 500. Suppose the user knows this address of the service routine. So instead of executing a system call, the user simply jumps to this location 500

(by executing “JMP 500”).

Assume that logical and physical addresses are the same and no memory protection is in place, i.e., cpu does not check that this address 500 is beyond the user’s memory space.

Will something go wrong while the service routine executes?

Explain in less than 100 words.

QUESTION 3

    1. Suppose content of a byte is AC in hexadecimal.

    a) Write it down as an 8 bit sequence.

    (b) What is the basic motivation to have a DMA?

Homework Answers

Answer #1

Q1)

MOV B, X

LDA Y

CMP B, A

JC LOOP

MOV A, B

HLT

LOOP: MOV B,A

HLT

Q2)

If CPU does not check that this address 500 is beyond the user’s memory space then while the service routine executes, it will go in wait state and a deadlock will occur.

Q3 a)

(AC)16 = ()2

A = 10 = 1010

C = 12 =1100

(AC)16=(10101100)2

Q3 b)

DMA means Direct memory access. It is used when large amount of data transfer is required from an external peripheral device to CPU/Processor. Processor uses instructions to ask for access to memory which is acknowledged by processor.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Suppose a user wants to do a system call. Assume that the service routine of this...
Suppose a user wants to do a system call. Assume that the service routine of this system call is at physical address 500. Suppose the user knows this address of the service routine. So instead of executing a system call, the user simply jumps to this location 500 (by executing “JMP 500”). Assume that logical and physical addresses are the same and no memory protection is in place, i.e., cpu does not check that this address 500 is beyond the...
IV.Translate the following C code fragment to ARM assembly instructions. Assume t, x, y, and z...
IV.Translate the following C code fragment to ARM assembly instructions. Assume t, x, y, and z are stored in registers r0, r1, r2, and r3. unsigned int x, y, z, t; do { x = x + 1; z = t + (z << 1); y = y - x; } while (y != x); V. What does the following sequence of instructions do? Why? RSB r2, r3, r3, LSL #4 RSB r2, r2, r2, LSL #3 VI. Write a...
(MIPS Assembly Language): Write the following sequence of code using *native* MIPS instructions: x = x...
(MIPS Assembly Language): Write the following sequence of code using *native* MIPS instructions: x = x - y[0] + y[1]; In memory x, y are stored beginning at 0x010000cc. Use registers $s1 for x,  and $s2 for the base address of y. Make sure your code includes all necessary declarations such that it could run in SPIM.
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue...
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue = red + 2 * 5 red++; blue = blue + red; cout << blue; 4 points    QUESTION 2 Is the following statement true or false? The Boolean expression in the following if statement will be true for all values of x in the range from 10 to 20 (including the endpoints) and false for all other values: int x; if (x >=...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in...
Write a sequence of two instructions that copies bits 0-5 from AL to bits 0-5 in BL. Bits 6-7 in BL should be cleared, and AL should be unchanged             Mov al, bl       And 00111111, bl       Write a sequence of two instructions that copies the integer in bits 4-7 from AL register into bits 0-3 of the BL register. Upper 4 bits of AL and BL will be cleared             Shr al, 4       Mov bl,...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT