📄 mips lab environment reference.mht
字号:
From: <由 Microsoft Internet Explorer 5 保存>
Subject: MIPS Lab Environment Reference
Date: Sun, 22 Oct 2006 12:12:33 +0800
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----=_NextPart_000_0000_01C6F5D3.5A8E2F10"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
This is a multi-part message in MIME format.
------=_NextPart_000_0000_01C6F5D3.5A8E2F10
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.it.lth.se/dtlab/manual/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>MIPS Lab Environment Reference</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY><FONT size=3D-1>
<H1>MIPS Lab Environment Reference</H1>Georg Fischer / e93gf@efd.lth.se =
<BR><BR>
<HR>
<H2>The MIPS-Board</H2>The lab board (see Figure 1-1) is the 79S361 from =
Integrated Device Technology (IDT). It uses the IDT79R36100, a MIPS =
R3000 based=20
processor, running at 25 MHz (some boards at 33 MHz). The board is =
equipped with=20
4MB DRAM, 1MB SRAM and 2MB ROM.<BR><BR>
<TABLE cellPadding=3D0 width=3D500 align=3Dcenter border=3D0><IMG =
height=3D512=20
src=3D"http://www.it.lth.se/dtlab/manual/board.jpg" =
width=3D500><BR><FONT=20
size=3D-1><B>Figure 1-1.</B><BR><I>The lab board (not including the =
I/O=20
expansion card).</I> </FONT>
<TBODY></TBODY></TABLE><BR>In order to use the board for the lab you =
have to=20
connect it to the computer with a serial cable. Make sure it is =
connected to=20
TTY0 (see Figure 1-1). Then turn on the power. The "Power LEDs" should =
shine=20
with a green or red light. The board has a monitor in its ROM that you =
now can=20
access from a terminal, either the one in MipsIt Studio2000 or through =
any other=20
terminal program. If you wish to use a terminal program you should set =
the=20
serial parameters to 38400 baud, 8 data bits, no parity, 1 stop bit and =
no flow=20
control.=20
<H2>The Monitor</H2>With the on-board monitor software you can run =
programs,=20
step through them, inspect registers and memory and much more. The =
section=20
"Useful monitor commands" has a list of the most common commands. To =
enter a=20
command you must be at a <CODE><IDT></CODE> prompt, to make sure =
you are=20
at a prompt you can press <CODE><ENTER></CODE> and see that you =
get a new=20
prompt. <BR><BR>Now a small example of how to use the monitor. Let us =
assume=20
that you just uploaded the following little program to the board with =
MipsIt=20
(see "MipsIt Studio2000 and the Build Process" on how to do that). For a =
listing=20
of symbols available use the command <CODE><B>psym</B></CODE> and to =
view the=20
disassembly type <CODE><B>dis start/40</B></CODE>. <PRE>start: li a1, 5
move a2, zero
li a3, 0x80020030
loop: addi a2, a2, 2
sb a2, 0(a3)
addi a3, a3, 4
addi a1, a1, -1
bne zero, a1, loop
nop
end: nop
</PRE>Note that the disassembly in the monitor often looks somewhat =
different=20
from the code you wrote. There can even be some more/or different =
instructions.=20
The reason for this will not be explained now. <BR><BR>You can now set a =
breakpoint at "loop" with the command <CODE><B>brk loop</B></CODE>. To =
list the=20
breakpoints just type <CODE><B>brk</B></CODE>. Now execute the program =
from=20
"start" with <CODE><B>go start</B></CODE>. The execution will stop when =
it=20
reaches "loop". Now take a look at the registers with =
<CODE><B>dr</B></CODE>: <PRE>r0/zero=3D00000000 r1/at =3D00000000 =
r2/v0 =3D00000000 r3/v1 =3D00000000
r4/a0 =3D00000000 r5/a1 =3D00000005 r6/a2 =3D00000000 r7/a3 =
=3D80020030
r8/t0 =3D00000000 r9/t1 =3D00000000 r10/t2 =3D00000000 r11/t3 =
=3D00000000
r12/t4 =3D00000000 r13/t5 =3D00000000 r14/t6 =3D00000000 r15/t7 =
=3D00000000
r16/s0 =3D00000000 r17/s1 =3D00000000 r18/s2 =3D00000000 r19/s3 =
=3D00000000
r20/s4 =3D00000000 r21/s5 =3D00000000 r22/s6 =3D00000000 r23/s7 =
=3D00000000
r24/t8 =3D00000000 r25/t9 =3D00000000 r26/k0 =3D00000000 r27/k1 =
=3D00000000
r28/gp =3D00000000 r29/sp =3Da00bc000 r30/fp =3D00000000 r31/ra =
=3D00000000
mdhi =3D00000000 mdlo =3D00000000
</PRE>The contents of registers 5, 6 and 7 are as expected. Let us now =
step=20
through a bit of the program instruction by instruction. To do this just =
use=20
<CODE><B>step</B></CODE>. Step four instructions with <CODE><B>step =
4</B></CODE>=20
or by using <CODE><B>step</B></CODE> four times. The contents of the =
registers 5=20
to 7 will now be: <PRE>r5/a1 =3D00000004 r6/a2 =3D00000002 r7/a3 =
=3D80020034
</PRE>Register 5 is the counter for how many times the loop will run, so =
let us=20
now make the loop one time extra by setting the register back to 5. This =
is done=20
with the command <CODE><B>fr r5 0x5</B></CODE>. If you are interested =
you can=20
step through some more of the program. To execute the rest of the =
program set a=20
breakpoint at "end" and continue execution with =
<CODE><B>cont</B></CODE>. Note=20
that you cannot use <CODE><B>go</B></CODE> to continue execution, =
because it=20
will start from the beginning again. <BR><BR>Let us take a look at what =
the=20
memory looks like at 0x80020030 and forward. Memory can be viewed as =
bytes, half=20
words or words. We will use bytes in this example. <CODE><B>dump =A8Cb=20
0x80020030/32</B></CODE> will do just this, where =A8Cb indicates that =
we want to=20
view it as bytes. We get the following output: <PRE>80020030: 42 00 00 =
00 44 00 00 00 46 00 00 00 48 00 00 00 =
*B=A1=AF=A1=AF=A1=AFD=A1=AF=A1=AF=A1=AFF=A1=AF=A1=AF=A1=AFH=A1=AF=A1=AF=A1=
=AF*
80020040: 4a 00 00 00 4c 00 00 00 00 00 00 00 00 00 00 00 =
*J=A1=AF=A1=AF=A1=AFL=A1=AF=A1=AF=A1=AF=A1=AF=A1=AF=A1=AF=A1=AF=A1=AF=A1=AF=
=A1=AF=A1=AF*
</PRE>
<H2>Useful Monitor Commands</H2><FONT face=3DArial><B><I>asm=20
<ADDRESS></I></B></FONT>=20
<TABLE>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Examine and change memory interactively using =
standard=20
assembler mnemonics. </FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>brk|b [ADDRESSLIST]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Set/display breakpoints. There is a maximum of =
16=20
breakpoints. </FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>cont|c</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Continues execution of the client process from =
where it=20
last halted execution. </FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>clearsymbols|csym</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Clear symbol list. =
</FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>dis <RANGE></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Disassemble target memory specified by RANGE.=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>dr=20
[REG#|NAME|cp0|fpr|fps|fpd]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Print out the current contents of register(s).=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>dump|d =
[-w|-h|-b]=20
<RANGE></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Dump the memory specified by RANGE to the =
display.=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>fill|f =
[-w|-h|-b|-l|-r]=20
<RANGE> [VALUE_LIST]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Fills memory specified by range with VALUE_LIST. =
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>fr [-s|-d]=20
<REG#|NAME> <VALUE></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Fill REG#/NAME with VALUE.=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>go|g [-n]=20
<ADDRESS></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Start execution at address ADDRESS.=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>gotill|gt=20
<ADDRESS></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Continue execution until address ADDRESS.=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>help|?=20
[COMMANDLIST]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>This command will print out a list of the =
commands=20
available in the monitor. If a command list is supplied, only the =
syntax=20
for the commands in the list is displayed. =
</FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>move|m [-w|-b|-h] <RANGE>=20
<DESTINATION></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Move the block of memory specified by RANGE to =
the=20
address specified by DESTINATION. =
</FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>next|n</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Step over subroutine calls.=20
</FONT></TR></TBODY></TABLE><BR><FONT =
face=3DArial><B><I>printsymbols|psym=20
[-a]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Print list of symbols. Sorted by address if =
=A1=AE-a=A1=AF is=20
specified, otherwise by name. =
</FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>regsel|rs [-c|-h]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Select either the compiler names or the hardware =
names=20
for registers. </FONT></TR></TBODY></TABLE><BR><FONT =
face=3DArial><B><I>step|s=20
[COUNT]</I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Single step COUNT times. =
</FONT></TR></TBODY></TABLE><BR><FONT=20
face=3DArial><B><I>sub [-w|-h|-b|-l|-r] <ADDRESS></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Examine and change memory interactively.=20
</FONT></TR></TBODY></TABLE><BR><FONT face=3DArial><B><I>unbrk|ub=20
<BPNUMLIST|all></I></B></FONT>=20
<TABLE border=3D0>
<TBODY>
<TR>
<TD>
<TD><FONT size=3D-1>Clear breakpoints. =
</FONT></TR></TBODY></TABLE><BR><BR>
<TABLE cellPadding=3D0 border=3D0>
<TBODY>
<TR>
<TD><FONT face=3DArial size=3D-1><B><I>ADDRESS</I></B></FONT></TD>
<TD> </TD>
<TD><FONT size=3D-1>=3D number | label</FONT></TD></TR>
<TR>
<TD><FONT face=3DArial =
size=3D-1><B><I>ADDRESSLIST</I></B></FONT></TD>
<TD></TD>
<TD><FONT size=3D-1>=3D ADDRESS [ADDRESS [ADDRESS [ADDRESS =
...]]]</FONT></TD></TR>
<TR>
<TD><FONT face=3DArial size=3D-1><B><I>BPNUM</I></B></FONT></TD>
<TD></TD>
<TD><FONT size=3D-1>=3D breakpoint number</FONT></TD></TR>
<TR>
<TD><FONT face=3DArial size=3D-1><B><I>BPNUMLIST</I></B></FONT></TD>
<TD></TD>
<TD><FONT size=3D-1>=3D BPNUM [BPNUM [BPNUM [BPNUM =
...]]]</FONT></TD></TR>
<TR>
<TD><FONT face=3DArial size=3D-1><B><I>RANGE </I></B></FONT></TD>
<TD></TD>
<TD><FONT size=3D-1>=3D ADDRESS=A1=AAADDRESS | ADDRESS/count | =
ADDRESS</FONT></TD></TR>
<TR>
<TD><FONT face=3DArial size=3D-1><B><I>REG#</I></B></FONT></TD>
<TD></TD>
<TD><FONT size=3D-1>=3D [r0 .. r31]</FONT></TD></TR></TBODY></TABLE>
<H2>Useful Addresses</H2>
<TABLE cellPadding=3D0 border=3D0>
<TBODY>
<TR>
<TD vAlign=3Dtop><FONT =
size=3D-1><CODE>0x80000000-<BR>0x800BFFFF</CODE>=20
</FONT></TD>
<TD> </TD>
<TD vAlign=3Dbottom><FONT size=3D-1>1MB SRAM (first 64KB used by the =
monitor)=20
</FONT></TD></TR>
<TR>
<TD><BR>
<TD></TD>
<TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -