带有 OR 和 AND 符号的 MIPS CODE 数学表达式

问题描述

有人可以帮助我如何在 MIPS 代码中使用 OR 和 AND 在这个方程中 ?[25] = [(? ∗ c/512 + ? ∗ ?) |16]&[?|? ∗ c/16 − ?[18]]

(? ∗ c/512 + ? ∗ ?) |16 或在这里使用

?|? 或者在这里使用。 and 用在两个表达式之间。

请帮忙!因为我已经完成了将近一半,剩下的一半。


print: .asciiz "  ?[25] = [(? ∗ c/512 + ? ∗ ?) |16]&[?|? ∗ c/16 − ?[18]] =   "
space: .asciiz "  "
A: .word 12 2 3 4 5 6 7 7 8 3 6 2 4 1 5 6 3 7 4 8 5 4 3 2 1
B: .word 23 2 3 4 5 6 7 7 8 3 6 2 4 1 5 6 3 7 
a: .word 4
b: .word 2
l: .word 6
c: .word 1024


.text

main:
#get the integer input n from user
    lw $t0,a # $t0 = a = 4
    lw $t1,b # $t1 = b = 2
    lw $t2,l # $t2 = l = 6
    lw $t3,c # $t3 = c = 512
    la $s5,A # $s5 = A[25] = .....total 25 indexes data
    la $s7,B # $s7 = B[18] = .....total 18 indexes data
    lw $t4,96($s5) # $t4 = A[25] = 1
    lw $t5,68($s7) # $t5 = B[18] = 7```
    
    srl $t6,$t3,9  # $t6 = c/512 = 1
    #showing c/512 = 1
    #li $v0,1
    #move $a0,$t6
    #add $t7,$t7,$t0
    sll $t7,$t0,1 # $t7 = 8 = a * c/512
    sll $s0,$t2,1 # $s0 = 12 = l ^ b
    add $s2,$s0 # a * c/512 + l ^ b ////  8 + 12 in $s2 = 20
    ori $s2,$s2,16
    
    li $v0,1
    move $a0,$s2
    syscall'''

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)