EEE230_ASU_Assign2

EEE230_ASU_Assign2 - CSE/EEE 230 Assignment 2 Part 1: In...

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

View Full Document Right Arrow Icon
CSE/EEE 230 Assignment 2 Part 1: In this part of the assignment, you are to make changes to the following program: # Assignment 2 Part 1 # Debra Calliss # # Program will prompt for an integer and then print the numbers from 1 # to the input number. .data prompt: .asciiz "Enter in an integer: " newline:.asciiz "\n" .globl main .text main: move $s7, $ra #save the return address in a register # prompt for input li $v0, 4 # set command to print string la $a0, prompt # set string to print syscall # print prompt # read in the number li $v0, 5 # set command to read integer syscall # call to read integer move $s0, $v0 # save the number # initialize loop li $t1, 0 # set loop counter to 0 # while loop counter != number top: beq $t1, $s0, end # compare loop counter and integer # increment counter addi $t1, $t1, 1 # add 1 to counter # print counter value and new line li $v0, 1 # set command to print integer move $a0, $t1 # set integer to print syscall # print counter li $v0, 4 # set command to print string
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.

This note was uploaded on 04/06/2009 for the course CSE CSE/EEE230 taught by Professor Debracaliss during the Fall '09 term at ASU.

Page1 / 2

EEE230_ASU_Assign2 - CSE/EEE 230 Assignment 2 Part 1: In...

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