Control Structures Flashcards

1
Q

The following MIPS assembly code:

   beq $t0, $t1, label
   <a statement> label:  
   <another statement> Implements which C++ control structure:
A

if ($t0 != $t1)
{
//a statement
}
// another statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The following MIPS assembly code:

label: <a>
beq $t0, $t1, label
<another>
Implements which C++ control structure:</another></a>

A

do
{
//a statement
} while ($t0 == $t1)

// another statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The following MIPS assembly code:

   beq $t0, $t1, label1
   <statement1>
   J label2 label1:  
   <statement2> label2: Implements which C++ control structure:
A

if ($t0 != Tt1)
statement1
else
statement2
——————-​
​if ($t0 == Tt1)
statement2
else
statement1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The following MIPS assembly code:

label1: bne $t0, $t1, label
<a>
j label1
label2:
<another>
Implements which C++ control structure:</another></a>

A

while ($t0 == $t1) {
<a>
}</a>

<another>
</another>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The following MIPS assembly code:

    bne $t1, $t2, label 
    bne $t3, $t4, label2 label:  <a statement> label2: <another statement> Implements which C++ control structure:
A

if ($t1 != $t2) || ($t3 == $t4) {
<a>
}</a>

<another>
</another>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The following MIPS assembly code:

    bne $t1, $t2, label2 
    bne $t3, $t4, label2 label:  <a statement> label2: <another statement> Implements which C++ control structure:
A

if ($t1 == $t2) && ($t3 == $t4) {
<a>
}</a>

<another>
</another>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly