首页 > 解决方案 > MIPS 内存映射 IO 接收字节导致错误

问题描述

对于大学,我尝试使用内存映射 IO 将 6 个字符存储在缓冲区中,然后打印缓冲区。下面的代码是接收者,$t0 是接收者的地址。它检查接收器是否准备好,如果准备好接收数据。现在我只是试图确保我得到数据。所以我试图打印它,但我收到一个语法错误,我不知道为什么。

我认为原因可能是接收到的字节不兼容。

lw   $t1, 0($t0)           # receiver control
andi $t1, $t1,0x0001       # check if ready
beq  $t1, $zero,readloop   # if not ready
lb   $s0, 4($t0)           # receiver data

li  $v0, 11               # print char
li  $a0, $s0              # takes address of string as argument <--- This is where the compiler is saying theres a syntax error
syscall

标签: memoryiomips

解决方案


推荐阅读