edited by
605 views
5 votes
5 votes

Assume that memory is byte addressable with word size of 32 bits. The program has been loaded in memory 300(decimal) Address onwards. If an interrupt is occurred during the execution of HALT which is stored at 328. What will be the return Address pushed on to the stack?

edited by

3 Answers

Best answer
3 votes
3 votes

We know PC points to next instruction which is going to be executed..So when an interrupt occurs , after execution of current execution cycle , the interrupt is serviced ..

So PC holds the address of next instruction which is going to be executed as we know..So in context of interrupt occurence also , after interrupt is serviced the instruction pointed by PC is performed..

And one thing we know that internal meaning of HALT means looping in itself ..So branch address is the address of instruction itself..So the location of HALT itself will be placed on the stack as a return address.

Hence the address pushed on the stack = 328

selected by
6 votes
6 votes

Whenever an Interrupt occurs during an execution of any Instruction, first the current instruction is executed till the end and then the Interrupt is handled. The Program Counter value (in this case the address of Instruction after the HALT Instruction) will be pushed onto the stack, even if it is a HALT instruction.

So the answer must be 332, Assuming the size of the instruction is 32 bits.

For more details : http://electronics.stackexchange.com/questions/277735/what-happens-if-the-interrupt-occurs-during-the-execution-of-halt-instruction

0 votes
0 votes
ANS : 328
Whenever a HALT Will occur then program counter will store starting address of HALT ... here HALT store at address 328 . So, program counter will store 328 ( i.e starting address of HALT instruction) in stack.

Related questions

0 votes
0 votes
0 answers
1
dd asked Sep 13, 2018
411 views
Give an example each for a hardware interrupt, an explicit software interrupt, and an implicit software interrupt, and discuss the possible operations as part of the inte...
2 votes
2 votes
1 answer
4
kimaya asked Jul 8, 2017
795 views
The solution says that the answer should be 80, but applying the formula (x/y)*100, where x is 250 and y is 200 fraction comes out to be greater than 1. Am i making a mis...