My professor taught us the bare basics and gives us questions on our homework that we essentially have to teach ourselves have to do. Any help would be appreciated! (use this for MIPS reference : http://www.mrc.uidaho.edu/mrc/people...al/MIPSir.html)
Here goes:
1. Write the binary representation of the smallest integer number that can be represented in 16-bit two's complement machine.
(I know that means 16 0's and 1's, but I do not know how to determine the smallest. Do I need to write it normally in binary and then convert or what?)
2. Write the machine instruction code (in hex) of the foloowing assembly code:
lw $t0, 0X46($10)
add $t2, $t0, $0
(I converted it into binary and got:
100011 01010 01000 00000 00001 01110
100000 01000 01010 00000 00000 00000
but that's totally wrong)
3. What does the following MIPS code do?
li $v0, 0
li $t1, 0
li $t2, 0
loop:
beq $t2, 6, endloop
lb $ $v1, AA($t1)
addu $v0, $v0, $v1
addi $t2, $t2, 1
addi $t1, $t1, 1
j loop
endloop:
....
.data
AA: .byte 8, 15, -3, 4, 12, 2, 9
(I put that it adds up the values in array 'AA' and stores the result in $v0 and got 5/7 points, but I do not know what else it could be doing)
4. Given the memory locations and addresses, fill in the blanks to place the word at 0X00405008 into $t1.
Memory Addresses
00000010 00405010
0000000C 0040500C
00000008 00405008
00000004 00405004
00000000 00405000
lui $s1, 0X____________
ori $s1, $s1, 0X___________
lw $t1, 0X________($s1)
(I don't know how to do this one at all)