Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

what is the range of Branch instruction in mips?

So I have this question that say, beq instruction is executing from 0x80000000 address, what is the lowest destination address you can reach.

the answer is 0x7ffe0004, but I couldn’t figure out how to get to this result. any help please?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The offset is a 16-bit signed field, ranging from -32768 to +32767. That offset is in words, so it is multipied by 4. The PC will already have been advanced, so the new address is PC + 4 + 4*offset. 4 x 32768 is 0x20000. 0x80000000 + 4 – 0x20000 is 0x7ffe0004.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading