hw4.asm - CSE/EEE230 Summer 2017.data this begins the data...

This preview shows page 1 out of 1 page.

# CSE/EEE230 Summer 2017 .data # this begins the data section .asciiz "Autumn Schuelka\n" # command language for characters to print words (address 0x10010000) # this completes step a. .globl main # declares a label (main) to reference .text # begin instructions main: # label referenced before at the .globl (address 0x00400000) #place your code here (my code will start after this line) lui $a0, 0x1001 # loads the address 0x10010000 into the register $a0 ori $v0, $0, 4 # command to print a string at the address held by register $a0 ("Autumn Schuelka") syscall # call to print the string # this completes step b.1. andi $s0, $s0, 0 # ands the register $s0 with the integer zero making the register $s0 equal to zero # completes step b.2. ori $s1, $s1, 10 # sets the register $s1 equal to the integer 10 (exit condition) top: # label to indicate the top of the "for" loop ori $v0 $0, 5 # command to read an integer syscall # call to read integer # this completes step b.3.a. ori $t0, $v0, 0 # stores the integer read into register $v0 into register $t0 andi $t1, $t0, 1 # ands the number stored in register $t0 to the integer 1

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture