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

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

# CSE/EEE230 Summer 2017 .data # this begins the data section num1: .word 0 # stores the value 0 into address 0x10010000 num2: .word 0 # stores the value 0 into address 0x10010004 name: .asciiz "\nAutumn Schuelka\n" #command language for characters to print words .text # begin instructions .globl main # declares a label (main) to reference main: # label referenced before at the .globl (address 0x00400000) lui $a0, 0x1001 # get start of data addiu $a0, $a0, 8 # get start of name ori $v0, $0, 4 # command to print a string syscall # print lui $a0, 0x1001 # set address of first word addiu $a1, $a0, 4 # set address of second word jal getinput # call function to get input, store into memory lui $t0, 0x1001 # get address of first word lw $a0, 0($t0) # get the first value from memory lw $a1, 4($t0) # get the second value from memory jal multiply # multiply the values, result in $v0 addi $a0, $v0, 0 # get value to print from $v0 ori $v0, $0, 1 # command to print an int syscall # print end: # label end ori $v0, $0, 10 # set command to stop program, syscall # call to stop program getinput: # label getinput ori $v0, $0, 5

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture