1 votes 1 votes S1 : Relative mode is the addressing mode which can be used to write code in which reallocation is done at run time. S2 : Indirect addressing through registers can be used to access global variables. Which of the following option is correct? CO and Architecture co-and-architecture addressing-modes + – srestha asked Jan 7, 2017 • retagged Nov 13, 2017 by Arjun srestha 1.9k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Farida Shaikh commented Oct 2, 2019 reply Follow Share S2 : Indirect addressing through registers can be used to access global variables @Habibkhan This statement is True. Reference: Carl Hamacher - 5th Edition Page 52 2nd paragraph says Also,when absolute addressing is not available, indirect addressing through registers makes it possible to access global variables by first loading the operand's address in a register. 2 votes 2 votes `JEET commented Oct 2, 2019 reply Follow Share @Farida Shaikh But it says can be used. 0 votes 0 votes Please log in or register to add a comment.
Best answer 7 votes 7 votes Statement 1 is true since PC relative instructions are used to perform intrasegment transfer of control instructions whereas Base register addressing mode which is used in 8086 architecture is used to perform intersegment transfer of control and hence relocation of code more specificially between the segments.. Statement 2 is not true necessarily because a pointer may or may not be global variable as their working is different although they can be used to implement the same thing.. And specifically we use indirect addressing mode is used to implement pointers concept.So statement 2 should be false from this perspective.For more clarity : http://stackoverflow.com/questions/1892198/whats-the-difference-between-pointers-and-global-variables-in-c Habibkhan answered Jan 7, 2017 • selected Jan 7, 2017 by srestha Habibkhan comment Share Follow See all 4 Comments See all 4 4 Comments reply srestha commented Jan 7, 2017 reply Follow Share Can u elaborate S1 more? "relocation of code more specificially between the segments" Cannot understand this line 0 votes 0 votes Habibkhan commented Jan 7, 2017 reply Follow Share See in reference to 8086 architecture , we have 16 segments of memory ..So it is possible that the instruction performing at segment 1 may require to be relocated to segment 3.. So base address of segment 3 is required for this and address field of instruction is added to it to get the instruction address and PC is updated accordingly.. 0 votes 0 votes Adiaspirant commented Jan 15, 2017 reply Follow Share http://www.cs.iit.edu/~cs561/cs350/addressing/addsclm.html Taking an example- #include<stdio.h> int glob=7; int main() { int *alpha=&glob,q=5; printf("%d",glob); *alpha=q; printf("%d %d",glob,*alpha); } I think S2 is also corrct 0 votes 0 votes atul_21 commented Jan 5, 2018 reply Follow Share Statement 2: But @Habibkhan , in question they said 'can be used' . Is this change ur answer ?? OR "Indirect addressing through registers cannot be used to access global variables." Is this correct? 0 votes 0 votes Please log in or register to add a comment.