且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MIPS你怎么可以比较来自输入取一个字符?

更新时间:2021-10-03 06:33:52

我们可以使用系统调用code为读字,这应该是系统调用code 12,则字符(二进制ASCII code)的被存储在$ V0。然后,你可以做一个寄存器等于121,另一个是110,如果相等,则分支。

One can use the system call code for Read Character, which should be system call code 12, then the character (binary ASCII code) will be stored in $v0. Then you can make a register equal to 121 and another to 110. Then branch if equal.

SPIM系统调用codeS:
http://www.doc.ic.ac.uk/lab /secondyear/spim/node8.html

SPIM system call codes: http://www.doc.ic.ac.uk/lab/secondyear/spim/node8.html