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
a) Write it down as an 8 bit sequence.
(b) What is the basic motivation to have a DMA?
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.
Get Answers For Free
Most questions answered within 1 hours.