我正在使用 Rars Risc-V 模拟器,我必须从我的计算机中读取 24 位位图图像并将其显示在 rars 中。我所做的是使用 risc-v 系统调用打开图像,然后我尝试使用读取调用来读取它。
la a0, file_name
li a7, 1024 #system call for open
li a1, 0 #open for reading
ecall
mv s6, a0 #save the file descriptor to s6
#read file
li t0, -1
beq a0, t0, error
mv a0, s6
la a1, buffer
li a2, 400000
li a7, 63
ecall
但是这样做我得到了这个结果:
.
有谁知道如何正确地做到这一点?