The Gateway to Computer Science Excellence
+1 vote
Plz describe

Which addressing mode does this following line represents and how?

Index addressing mode, $X\left ( R_{1} \right )$, where $X$ is an offset represented in $2$'s complement $16$ bit representation
in CO and Architecture by Veteran (116k points) | 193 views
I did not understand the question correctly .But with whatever is given I can map it to Base register addressing ng mode. As. In indexed addressing mode we will add content of register R1 with Singed value of x. So register can be a base register and signed X is the displacement and it can work as base register addressing mode to jump from one location to another location during execution
why 2's complement 16 bit representation needed here?
Because in control transfer instructions, my program can jump up or down means if my current PC value is 1000, then my next instruction in case of jump, can be before 1000 say 700 or it can be after 1000 say 1040.So based upon this my displacement from current location can be - 300 or +40.In case of c program if you use some goto statement and you jump to location that is defined before goto then displacement will be negative, if that location is after goto then displacement will be positive. So we need signed representation and for that we use 2's complementsl.
yes, but same thing can be done in index addressing mode too

how do u know , it is not index adderessing mode , and only displacement addressing mode?
Question is asking , we have an index addressing ,and which addressing mode functionality is implemented by this index addressing mode.Can you tell me source of question or options if any?

ya it is a gate question


but I feel confused, how these 2 line represents displacement mode

1 Answer

+2 votes
Rahul explain right,

X(R1):- Here register R1 hold some base address, and X contains displacement.

If you are currently executing say line 1000 and wants to jump at 750 and X will store that displacement in 2's complement forn.
by Active (3.2k points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,666 questions
56,131 answers
93,308 users