779 views
0 votes
0 votes

A CPU has 24 bit instructions and we have to calculate the sum of n number by using below code:

The value of X, if target address of branch is loop, when instruction is uses PC relative addressing mode is ________. (Assume memory is byte addressable)

1 Answer

Best answer
0 votes
0 votes
X=-12 because each instruction in the memory is 3 bytes, if we the program is stored in the memory block starts from 800(say) as address then loop label is having address 806 and the instruction where PC is used as instruction's operand is having address 815,so PC contains 818,so displacement X=(818-806)=12, i.e. -12[PC]
edited by

Related questions

0 votes
0 votes
0 answers
1
Ray Tomlinson asked Aug 22, 2023
248 views
is this formula is correct if it is correct then in gate 2006 Question 75 why they not used this formulahttps://gateoverflow.in/43565/gate-cse-2006-question-75
2 votes
2 votes
1 answer
2
0 votes
0 votes
1 answer
4
Mrityudoot asked May 22, 2023
199 views
Under what category does Universal Serial Bus fall: System Bus or a Network connection or something else?