如何在MIPS中翻译以下/等效C编程行?
printf("This number is: %d, that number is: %d", int1, int2);
答案 0 :(得分:0)
使用系统调用 print字符串是将$ v0设置为4的位置 double是3,整数是1
toPrint: .asciiz "This number is:"
toPrint1: .asciiz ", that number is"
li $vo, 4 #print string
la $a0, toPrint
syscall
li $v0, 5 #read int1
syscall
add $a0, $v0, $zero
li $v0, 1 # print int1
li $v0, 4
la $a0, toPrint1 # load string to print
syscall
li $v0, 5# read int2 #user put number in console
syscall
add $a0, $v0, $zero
li $v0, 1 # print int2
li $v0, 10# exit
syscall