MIPS program is finished running (dropped off bottom) error

家住魔仙堡 提交于 2019-12-25 01:54:12

问题


It's my first time doing MIPS assembly and I'm trying to create a program that (1) accepts user's input (2) pre-store it in a specific address (3) multiply using repeated addition

Here's my program:

  #Data Segment#
  .data 0x10010000
  x: .word  1988
  y: .word  1923

  .text
   #Main Segment
   main:
    sub    $t3, $t3, $t3            #initialize counter
    sub    $t4, $t4, $t4            #initialize product
    multiloop:
        lui    $t0, 0x1001
        lw     $t1, 0($t0)  #load first integer value; variable for addition
        lw     $t2, 4($t0)  #load second integer value; variable for counter
          sub    $t2, $t2, $t3  #counter operation
          bltz   $t2, done      #if counter > 0 means operation is complete
          add    $t4, $t4, $t1  #addition
          addi   $t3, $t3, 1    #increment counter
        j multiloop     #loop
   done:
    sw  $t4, 32($t0)  

The question is: why is my program " program is finished running (dropped off bottom)". Any help? Thanks!

来源:https://stackoverflow.com/questions/48553510/mips-program-is-finished-running-dropped-off-bottom-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!