The following example is from Computer Organization and Design: the Hardware/Software Interface: Fifth Edition. In the book, the author describes the resulting MIPS code, from compiling the C code, as a "basic block", which they define as
a sequence of instructions without branches, except possibly at the end, and without branch targets or branch labels, except possibly at the beginning.
So, given the following C code and the resulting MIPS code, what part(s) of the MIPS code is the entry, exit, branches, or branch targets? This code seems to not meet the definition because there is a branch statement before the end of the loop. It would help me to understand the definition if someone could provide another example of a basic block, or even better a non-example.
while (save[i] == k)
i += 1;
LOOP: sll $t1, $s3, 2
add $t1, $t1, $s6
lw $t0, 0($t1)
bne $t0, $s5, EXIT
addi $s3, $s3, 1
j LOOP
EXIT: