简体   繁体   中英

Labeling in MIPS with branches statements

Does a label still execute if it is not specifically called?

Assuming I have

beq $t0, $t1, LABEL1
LABEL1: add $t0,$t2,$t1
beq $t0, $t3, LABEL2
LABEL2: add $t0, $t3, $t4

When I run this, will LABEL2 happen even if $t0 and $t3 are not equal?

When I run this, [will] LABEL2 happen even if $t0 and $t3 are not equal?

Yes.
Although a label doesn't really execute: a label is just a name that you've given to a specific location in your program, which helps you refer to that location in a simple manner. It's the instructions that are executed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM