Download VR Series 64-/32-Bit Microprocessor Programming Guide AN

Transcript
VOLUME 3 PROGRAMMING
#define
#define
#define
#define
SR_CU0 0x10000000 /* Coprocessor 0 usable */
SR_RP 0x08000000 /* $P bit */
SR_FR 0x04000000 /* FR bit */
SR_DE 0x00010000 /* parity or ECC to cause exceptions? */
#define BP_All_Taken 2 /* Predict all br as taken */
#define Diag_BPModeShf 16 /* bits 17..16 */
#define Init_BPT_00 2 /* bits 1..0 */
/*********************************************************************
*
Main program
*
*********************************************************************/
.text
.set noat
.set noreorder
.globl init_vr10000
.ent init_vr10000
init_vr10000:
/*****************************************************************
*
Initialization of CP0 register
*
*****************************************************************/
li $0, 0x00
add $8, $0, $0
li $8, (SR_XX | SR_CU1 | SR_CU0 | SR_FR)
mtc0
mtc0
mtc0
mtc0
mtc0
mtc0
mtc0
mtc0
mtc0
mtc0
mtc0
$8,
$0,
$0,
$0,
$0,
$0,
$0,
$0,
$0,
$0,
$0,
C0_SR
C0_TagLo
C0_TagHi
C0_ECC
C0_PageMask # 4k byte pages
C0_Index
C0_EntryHi
C0_EntryLo0
C0_EntryLo1
C0_Cause
C0_Wired # also sets Random register to 63
/*********************************************************************
* Initialize all registers:
*
* After a power-on or cold reset sequence, all logical
*
* registers (both in the integer and the floating-point
*
* register files) must be written before they can be read.
*
* Failure to write any of these registers before reading from
*
* them will have unpredictable result.
*
*********************************************************************/
add $1, $0, $0
dmtc1 $0, $f0
add $2, $0, $0
dmtc1 $0, $f1
add $3, $0, $0
dmtc1 $0, $f2
add $4, $0, $0
dmtc1 $0, $f3
136
Application Note U10710EJ5V0AN