assignment3.s - Assignment 3 Name Kunhao Zhang ASU email...

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

########################################################### # Assignment #: 3 # Name: Kunhao Zhang # ASU email: [email protected] # Course: CSE230 M/W 3:05---4:20 pm # Description: This is my third assembly language program. # It prints will use read_int ,print_int, print_string to do arithmetic of two numbers. ########################################################### .data s1:.asciiz "Enter a value:\n"; s2:.asciiz"Enter another value:\n"; s3:.asciiz "Enter one more value:\n"; s4:.asciiz"Enter one more value:\n"; message1: .asciiz"\nnum3+num1="; message2: .asciiz"\nnum2-num4="; message3: .asciiz"\nnum1*num2="; message4: .asciiz"\nnum3/num4="; message5: .asciiz"\nnum4 mod num2="; message6: .asciiz"\n(num2 mod 5)-((num4 / num1 + num3) * 9)="; .text main: # print the label s1 li $v0, 4 la, $a0,s1 syscall # get the value in s1 and store it in t1 li $v0,5 syscall move $t1, $v0 #print the label s2 li $v0, 4 la $a0, s2 syscall #get input and store it in t2 li $v0, 5 syscall move $t2, $v0 #print the label s3 li $v0, 4 la $a0, s3
syscall #get input and store it in t3 li $v0, 5 syscall move $t3, $v0 #print the label s4 li $v0, 4 la $a0, s4 syscall #get input and store it in t4 li $v0, 5 syscall move $t4, $v0

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture