assembly 装配数字实验室模拟计算器

k7fdbhmy  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(143)

任何人都可以用这个来对付我。
计算器:
使用Digital Lab Sim建立计算器。提供+-*/

  • 针对+a
  • 针对-b
  • 针对*c
  • /d
  • =f

具体内容:

  • 当你点击一个数字,它显示在LED,只显示2个底部的数字。例如:按1显示01,然后按2显示12,如果按3显示23
  • 按下数字后,按下+-*/
  • 按下f=),将结果显示到LED。
yqyhoc1h

yqyhoc1h1#

.eqv SEVENSEG_LEFT 0xFFFF0011 # Dia chi cua den led 7 doan trai. 
                # Bit 0 = doan a; # Bit 1 = doan b; ... 
                # Bit 7 = dau . 
.eqv SEVENSEG_RIGHT 0xFFFF0010 
                # Dia chi cua den led 7 doan phai 
.text 
main: 
    li $a0, 0x6 # set value for segments 
    jal SHOW_7SEG_LEFT # show 
    li $a0, 0x7F # set value for segments 
    jal SHOW_7SEG_RIGHT # show 

exit: li $v0, 10 
    syscall 

endmain: 
#--------------------------------------------------------------- 
# Function SHOW_7SEG_LEFT : turn on/off the 7seg 
# param[in] $a0 value to shown # remark $t0 changed 
#--------------------------------------------------------------- 
SHOW_7SEG_LEFT: li $t0, SEVENSEG_LEFT # assign port's address 
    sb $a0, 0($t0) # assign new value 
    jr $ra #--------------------------------------------------------------- 
# Function SHOW_7SEG_RIGHT : turn on/off the 7seg 
# param[in] $a0 value to shown # remark $t0 changed 
#--------------------------------------------------------------- 
SHOW_7SEG_RIGHT: li $t0, SEVENSEG_RIGHT # assign port's address 
    sb $a0, 0($t0) # assign new value 
    jr $ra

display can but i dont know how to hit a button then display it.

相关问题