Adding two 64 bit numbers in Assembly

前端 未结 1 1196
面向向阳花
面向向阳花 2020-12-15 07:06

So I am learning MIPS using the SPIM simulator and im stuck on this problem.

I want to add two 64 bit numbers which are stored in four 32 bit registers. So I add the

1条回答
  •  攒了一身酷
    2020-12-15 07:41

    Add $t2 $t3 + $t4 $t5, result in $t0 $t1

    addu  $t1, $t3, $t5    # add least significant word
    sltu  $t0, $t1, $t5    # set carry-in bit 
    addu  $t0, $t0, $t2    # add in first most significant word
    addu  $t0, $t0, $t4    # add in second most significant word
    

    For the second part of your question, there is no status register. None at all. Nada.

    0 讨论(0)
提交回复
热议问题