Register2 goto l1 called condional branches mips goto

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r2) goto L1 bne register1, register2, L1 (condi4onal branch) if (register1!=register2) goto L1 j L1 (uncondi4onal branch) goto L1 slt reg1,reg2,reg3 if (reg2 < reg3) reg1 = 1; else reg1 = 0; MIPS Decision Instruc4ons • Decision instruc4on in MIPS: – beq register1, register2, L1 – beq is “Branch if (registers are) equal” Same meaning as (using C): if (register1==register2) goto L1 • Complementary MIPS decision instruc4on – bne register1, register2, L1 – bne is “Branch if (registers are) not equal” Same meaning as (using C): if (register1!=register2) goto L1 • Called condi:onal branches MIPS Goto Instruc4on •  In addi4on to condi4onal branches, MIPS has an uncondi4onal branch: j label •  Called a Jump Instruc4on: jump (or branch) directly to the given label without needing to sa4sfy any condi4on •  Same meaning as (using C): goto label •  Technically, it’s the...
View Full Document

This note was uploaded on 12/27/2011 for the course CMPSC 64 taught by Professor Zheng during the Fall '09 term at UCSB.

Ask a homework question - tutors are online