int main() { int b; for(b=1; b<=30; b++) { printf("\t\t# b = %d (generated)\n",b); if ((b-7)>0) { printf("\t\tsrl $t0, $s0, %d\n", b-7); printf("\t\tand $t0, $t0, 0x1c0\n"); } else if ((b-7)<0) { printf("\t\tsll $t0, $s0, %d\n", 7-b); printf("\t\tand $t0, $t0, 0x1c0\n"); } else { printf("\t\tand $t0, $s0, 0x1c0\n"); } if ((b-4)>0) { printf("\t\tsrl $t1, $s1, %d\n", b-4); printf("\t\tand $t1, $t1, 0x38\n"); } else if ((b-4)<0) { printf("\t\tsll $t1, $s1, %d\n", 4-b); printf("\t\tand $t1, $t1, 0x38\n"); } else { printf("\t\tand $t1, $s1, 0x38\n"); } if ((b-1)>0) { printf("\t\tsrl $t2, $s2, %d\n", b-1); printf("\t\tand $t2, $t2, 0x7\n"); } else if ((b-1)<0) { printf("\t\tsll $t2, $s2, %d\n", 1-b); printf("\t\tand $t2, $t2, 0x7\n"); } else { printf("\t\tand $t2, $s2, 0x7\n"); } printf("\t\tor $t0, $t0, $t1\n" "\t\tor $t0, $t0, $t2\n" "\t\tlbu $t3, fate($t0)\n" "\t\tsll $t3, $t3, %d\n" "\t\tor $t9, $t9, $t3\n\n", b); } }