MIPS64--14天从入门到放弃(2)
上次搞完了简单的 A+B problem,这次来搞一个更加经典的题目,那就是屏幕输出 Hello,World!,这次我们仅需要搞懂MIPS64是如何进行屏幕输出的即可。
I/O区域的内存映射
Addresses of CONTROL and DATA registers
CONTROL: .word32 0x10000
DATA: .word32 0x10008
Set
CONTROL = 1, Set DATA to Unsigned Integer to be output
Set
CONTROL = 2, Set DATA to Signed Integer to be output
Set CONTROL
= 3, Set DATA to Floating Point to be output
Set
CONTROL = 4, Set DATA to address of string to be output
Set
CONTROL = 5, Set DATA+5 to x coordinate, DATA+4 to y coordinate, and DATA to
RGB colour to be output
Set
CONTROL = 6, Clears the terminal screen
Set
CONTROL = 7, Clears the graphics screen
Set CONTROL
= 8, read the DATA (either an integer or a floating-point) from the keyboard
Set
CONTROL = 9, read one byte from DATA, no character echo.
代码实现
我们这次将
MIPS64内存映射与I/O操作详解

本文介绍了MIPS64处理器中I/O区域的内存映射,详细解析了如何设置CONTROL和DATA寄存器进行不同类型的输出,如设置数值、字符串、清屏等操作。通过代码实例展示了如何将数据写入DATA寄存器,并通过改变CONTROL寄存器的值来控制输出。最后,提到了屏幕读取操作的步骤,强调理解这些基本操作并多实践可以熟练掌握MIPS64的I/O操作。
最低0.47元/天 解锁文章
1322

被折叠的 条评论
为什么被折叠?



