setbs.s

来自「mips架构的bootloader,99左右的版本 但源代码现在没人更新了」· S 代码 · 共 56 行

S
56
字号
/************************************************************* * File: lib/setbs.s * Purpose: Part of C runtime library * Author: Phil Bunce (pjb@carmel.com) * Revision History: *	970304	Start of revision history */#include "mips.h"/* * This is the module for setting the block refill size on the * HTP board. The block size is controlled by aux outputs on the * 2681 duart. */#ifdef MIPSEB#define SCCBASE 0xbe000003#else#define SCCBASE 0xbe000000#endif	SETOCR = 0x38	CLROCR = 0x3c	.globl setibs	.ent setibssetibs:	# values of a0 are: 0,1,2,3 = bs2,4,8,16	# bits 1&0 in the OCR control ibs	# 00 = bs16 01=bs8 10=bs4 11=bs2	li	t1,SCCBASE	move	t0,a0	sb	t0,CLROCR(t1)	not	a0	and	a0,0x3		# mask	sb	a0,SETOCR(t1)	j	ra	.end setibs	.globl setdbs	.ent setdbssetdbs:	# values of a0 are: 0,1,2,3	# bits 3&2 in the OCR control dbs	# 00 = bs16 01=bs8 10=bs4 11=bs2	li	t1,SCCBASE	move	t0,a0	sll	t0,2		# OCR bits 3&2	sb	t0,CLROCR(t1)	not	a0	and	a0,0x3		# mask	sll	a0,2		# OCR bits 3&2	sb	a0,SETOCR(t1)	j	ra	.end setdbs

⌨️ 快捷键说明

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