hello.c

来自「一个MIPS虚拟机的源码」· C语言 代码 · 共 19 行

C
19 行
字号
/* Print a friendly message to the serial console. */#include "spimconsreg.h"#define IOBASE 0xa2000000#define IS_READY(ctrl) (((*(ctrl)) & CTL_RDY) != 0)void entry(void){	char *p = "Hello, world!\n";	volatile long *data_reg = (long *)(IOBASE+DISPLAY_1_DATA);	volatile long *control_reg = (long *)(IOBASE+DISPLAY_1_CONTROL);	while (*p != '\0') {		do { 0; } while (! IS_READY(control_reg));		*data_reg = (long) *p++;	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?