CS241 Study Guide - Lur, Increment And Decrement Operators
Document Summary
1 tutorial 1 topics: mips to machine code, how to write a mips loop, working with arrays. 2 problem 1 - convert mips to ml. Consider the following instructions: add , , sh. Solution: the format for an add instruction is: 0000 00ss ssst tttt dddd d000 0010 0000 in this case, d = 3(00011), s = 3(00011), t = 0(00000). The hexadecimal representation is: 0x00601820: slt , , . Solution: the format for a slt instruction is: 0000 00ss ssst tttt dddd d000 0010 1010 in this case, d = 3(00011), s = 20(10100), t = 30(11110). The hexadecimal representation is: 0x029e182a: beq sh, sh, -4. Solution: the format for an beq instruction is: 0001 00ss ssst tttt iiii iiii iiii iiii in this case, s = 0(00000), t = 0(00000), i = -4(1111 1111 1111 1100). Compute the machine language (32-bit binary, and hexadecimal) equivalent to these instructions. 3 problem 2 - how to write a mips loop.