<<< Logical expression example 1 | Index | Flow control >>> |
# Pseudocode: # c = (a < b) && ((a+b) % 3) == 2 # Register mappings: # a: t0, b: t1, c: t2 # tmp1: t3, tmp2: t4 add $t3, $t0, $t1 # tmp1 = a+b li $t4, 3 # tmp1 = tmp1 % 3 div $t3, $t4 mfhi $t3 seq $t3, $t3, 2 # tmp1 = tmp1 == 2 slt $t4, $t0, $t1 # tmp2 = a < b and $t2, $t3, $t4 # c = tmp2 & tmp1
<<< Logical expression example 1 | Index | Flow control >>> |