hello.c.bak

来自「一个MIPS虚拟机的源码」· BAK 代码 · 共 23 行

BAK
23
字号
/* Print a friendly message to the serial console. */#include "spimconsreg.h"#define CTL_IE    0x00000002#define CTL_RDY   0x00000001#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_DATA);	volatile long *control_reg = (long *)(IOBASE+DISPLAY_CONTROL);	while (*p != '\0') {		do { 0; } while (! IS_READY(control_reg));		*data_reg = (long) *p++;	}}

⌨️ 快捷键说明

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