0 votes 0 votes To get branch address, do we need base register value or Program Counter value? CO and Architecture co-and-architecture + – srestha asked Apr 17, 2019 srestha 544 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply srestha commented Apr 17, 2019 reply Follow Share https://stackoverflow.com/questions/6950230/how-to-calculate-jump-target-address-and-branch-target-address 0 votes 0 votes SuvasishDutta commented Apr 30, 2019 reply Follow Share @srestha mam, it depends on the addressing mode used in the instruction. If relative addressing mode is used, then content of program counter register is used. On the other hand, if indexed addressing mode is used, then base register is used. 1 votes 1 votes srestha commented Apr 30, 2019 reply Follow Share @SuvasishDutta "Assume the base register contains $32856.$ The program counter is currently at $25687$ memory location. What is the branch address if address field of jump instruction contain $-30$ in address field and the instruction is designed with base register addressing mode?" What will be ans? Now here what is meaning of branch ?? 0 votes 0 votes SuvasishDutta commented Apr 30, 2019 reply Follow Share Mam, as in the question it is mentioned that the instruction is designed with base register addressing mode, to calculate any branch target address for any branch ( conditional or unconditional) instruction , we have to use base register and not program counter. It depends on the question. Had it been mentioned that instruction uses relative addressing mode, then we have to use program counter for calculating branch target address. Therefore in this question, Base register content is 32856. Branch target address for jump instruction = 32856-30 = 32826. 1 votes 1 votes srestha commented Apr 30, 2019 reply Follow Share ok, thanks :) 0 votes 0 votes SuvasishDutta commented Apr 30, 2019 reply Follow Share Ok mam 1 votes 1 votes Please log in or register to add a comment.