hw3.asm - CSE/EEE230 Spring 2017 Autumn Schuelka Homework...

This preview shows page 1 - 2 out of 2 pages.

# CSE/EEE230 Spring 2017# Autumn Schuelka# Homework 3.data # this begins the data section.word 5 # stores the value 2 into address 0x10010000.word 2 # stores the value 5 into address 0x10010004.word 8 # stores the value 8 into address 0x10010008# space for visual readability.globl main # declares a label (main) to reference.text # begin instructions address 0x00400000main: # label referenced before at the .globl# place your code here (spaces help this to be read easily, my code will appear after this line)lui $s0, 0x1001 # this sets register $s0 to be at the address 0x10010000 # the load upper immediate makes "1001" the first four words in the addresslw $s0, 0($s0)# stores the value (5) in the address 0x10010000 into register $s0lui $s1, 0x1001 # this sets register $s1 to be at the address 0x10010000 addi $s1, $s1, 4 # this adds the integer value of 4 to the address stored for register $s1 making the address become 0x10010004 lw $s1, 0($s1)# stores the value (2) in the address 0x10010004 into register $s1# this completes step 1addi $s2, $0, 10 # this adds the integer 10 to the zero register and stores it

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture