EEE230_DebraCallis_Test 1 Notes

EEE230_DebraCallis_Test 1 Notes - .data .word 7 #a .word 12...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
.data .word 7 #a 1. initialize the register $s1 to 15 .word 12 #b 2. copy the value in b the register $2 .word 8 #c 3. exchange or swap the values in $s1 and $s2 .word 1 #d 4. set $s3 to the values in c + 3 .text 5. add $s1 and $s2 together and store the result in a; do not change $s1 or $s2 .globl main 6. copy the value in a into b 7. set b to b - 4 main: 8. clear c 9. set the value in d to -d addi $s1, $s1, 15 # The numerical value of 15 is inputted in register s1. lui $s0, 0x1001 # The value of b (12) is loaded in register s2. lw $s2, 4($s0) addi $t1,$s2, 0 # Registers s1 and s2 are interchanged. add $s2, $s1,$0 add $s1,$t1,$0 lw $s3,8($s0) # 3 is added the value of c (8). addi $s3, $s3,3 add $t0,$s1,$s2 # Registers s1 and s2 are added and then stored in a. sw $t0,0($s0) lw $t2, 0($s0) # The value of 'a' is stored in b. sw $t2, 4($s0) lw $t3, 4($s0) # 4 is subtracted from b. addi $t3, $t3, -4 sw $t3, 4($s0) # c is set to zero. sw $0, 8($s0)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

EEE230_DebraCallis_Test 1 Notes - .data .word 7 #a .word 12...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online