hw6.asm - CSE/EEE230 Summer 2017 Autumn Schuelka.data this...

This preview shows page 1 out of 1 page.

# CSE/EEE230 Summer 2017 # Autumn Schuelka .data # this begins the data section newline: .asciiz "\n" # command language for characters .globl main # declares a label (main) to reference .text # begin instructions main: # label referenced before at the .globl ori $a0, $0, 1 # set the value of $a0 to 1 (smallest number) ori $a1, $0, 9 # set the value of $a1 to 9 (largest number) printnums: # sequence to print the ascending order of numbers addi $sp, $sp, -4 # reserve room for return address sw $ra, 0($sp) # save return address beq $a0, $a1, ret # check ending condition; if $a0 is equal to $a1 then go to the label ret addi $v0, $0, 1 # set command to print an integer syscall # print value in $a0 addi $a0, $a0, 1 # increment value in $a0 ori $t1, $a0, 0

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture