Ввести пользовательский ввод в регистр.
Затем сравните это с первым значением ascii, скажем '+', используя инструкцию beq.
.data
plus: .asciiz "+"
sub: .asciiz "-"
prod: .asciiz "*"
div .asciiz "/"
.text
.global calculator
.align 2
.ent calculator
calculator:
//t0 holds user input
la $t1,plus
lb $t1,0($t1)
beq $t0,$t1,add
//now check for subtraction, division product. Same code, just change the address (add)
//if none matched, jump to error
b error
add:
//addition code goes here
division:
//division code goes here
product:
//product code goes here
subtraction:
//subtraction code goes here.
error:
//error code goes here.