⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spim.html

📁 用汇编语言编程源代码
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- saved from url=(0039)http://www.cs.wisc.edu/~larus/spim.html --><!-- saved from url=(0039)http://www.cs.wisc.edu/~larus/spim.html --><HTML><HEAD><TITLE>SPIM MIPS Simulator</TITLE><META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD><BODY><H1 align=center>SPIM</H1><H2 align=center>A MIPS R2000/R3000 Simulator</H2><CENTER><P><A href="http://www.cs.wisc.edu/~larus/larus.html">James Larus</A></P><DIV align=center><TABLE width=386 border=0>  <TBODY>  <TR>    <TD align=middle width=198><B>Old Address</B></TD>    <TD align=middle width=172><B>Current Address</B></TD></TR>  <TR>    <TD width=198>Computer Sciences Department<BR>1210 West Dayton       Street<BR>University of Wisconsin<BR>Madison, WI     53706<BR>larus@cs.wisc.edu</TD>    <TD width=172>Microsoft Research<BR>One Microsoft Way<BR>Redmond, WA       98052<BR>larus@microsoft.com</TD></TR></TBODY></TABLE></DIV><P>&nbsp;</P></CENTER><P><B>spim</B> is a self-contained simulator for running MIPS R2000/R3000 assembly language programs. It reads and immediately executes assembly language code for this processor. <B>spim</B> provides a simple debugger and simple set of operating system services.</P><P><B>spim</B> implements almost the entire MIPS assembler-extended instruction set for the R2000/R3000 (It omits some of the complex floating point comparisons and details of the memory system page tables.) The MIPS architecture has evolved considerably since then (in particular, from 32 to 64 bits), which means that <B>spim</B> will not run programs compiled for recent MIPS or SGI processors.</P><P><B>spim</B> comes with complete source code and documentation. It also include a torture test to verify a port to a new machine.</P><P><B>spim</B> implements both a simple, terminal-style interface and a visual windowing interface. On Unix, the spim program provides a terminal interface and the xspim program provides an X window interface. On PCs, the spim program provides a DOS interface or console interface and PCSpim provides a Windows interface..</P><HR width="100%"><H2 align=center><B><FONT size=+2>Downloading SPIM</FONT></B></H2><DIV align=center><CENTER><TABLE width=663 border=1>  <TBODY>  <TR>    <TD align=middle width=279><B>Platform</B></TD>    <TD align=middle width=128>&nbsp;</TD>    <TD align=middle width=128><B>Form</B></TD>    <TD align=middle width=382><B>File</B></TD></TR>  <TR>    <TD width=279>Unix or Linux system</TD>    <TD width=128>spim<BR>xspim</TD>    <TD width=128>Source code</TD>    <TD width=382><A       href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z">http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z</A>       or<A href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z"><BR></A><A       href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz">http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz</A></TD></TR>  <TR>    <TD width=279 rowSpan=2>Microsoft Windows<BR>(Windows 95, 98, NT, 2000)</TD>    <TD width=128 rowSpan=2>spim<BR>PCSpim</TD>    <TD width=128>Executable</TD>    <TD width=382><a href="http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip">    http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip</a>     </TD></TR>  <TR>    <TD width=128>Source code</TD>    <TD width=382><A       href="http://www.cs.wisc.edu/~larus/SPIM/pcspim_src.zip">http://www.cs.wisc.edu/~larus/SPIM/pcspim_src.zip</A></TD></TR>  <TR>    <TD width=279>Microsoft DOS</TD>    <TD width=128>spim</TD>    <TD width=128>Executable</TD>    <TD width=382><A       href="http://www.cs.wisc.edu/~larus/SPIM/spimdos.exe">http://www.cs.wisc.edu/~larus/SPIM/spimdos.exe</A>     </TD></TR></TBODY></TABLE></CENTER></DIV><P>To run spim or xspim on a Unix or Linux system, copy either the compressed tar file (<A href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z">http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z</A>) or the gzip'ed tar file (<A href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz">http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz</A>).&nbsp; Both files contains source and must be compiled for a particular platform.</P><P>To run PCspim on a PC under Microsoft Windows, download the file<a href="http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip">http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip</a>, unzip it, and run setup.exe (instructions: <A href="http://www.cs.wisc.edu/~larus/SPIM/spimwin.ps">postscript</A>.).</P><P>Source for the PC version (both PCspim and spim) is available separately in the file <A href="ftp://ftp.cs.wisc.edu/pub/spim/pcspim_src.zip">ftp://ftp.cs.wisc.edu/pub/spim/pcspim_src.zip</A> </P>To run spim on a PC under MS/DOS, copy the file <A href="http://www.cs.wisc.edu/~larus/SPIM/spimdos.exe">http://www.cs.wisc.edu/~larus/SPIM/spimdos.exe</A> <P>There is no Macintosh version of <B>spim</B> (Yes, there should be).</P><HR width="100%"><H2 align=center><B><FONT size=+2>Documentation</FONT></B></H2><P>Morgan Kaufmann has generously provided an on-line version of Appendix A from Hennessy &amp; Patterson, <A href="http://www.mkp.com/books_catalog/1-55860-428-6.asp"><I>Computer Organization and Design: The Hardware/Software Interface</I></A> (as a <A href="http://www.cs.wisc.edu/~larus/SPIM/cod-appa.pdf">Adobe PDF file</A>). This is a more complete and up-to-date version of <B>spim</B> documentation included with <B>spim</B>. <P>The documentation included with <B>spim</B> is also online (as a <A href="http://www.cs.wisc.edu/~larus/SPIM/spim_documentation.ps">postscript</A> or <A href="http://www.cs.wisc.edu/~larus/SPIM/spim_documentation.pdf">Adobe PDF file</A>). However Appendix A of Hennessy &amp; Patterson, <A href="http://www.mkp.com/books_catalog/1-55860-428-6.asp"><I>Computer Organization and Design: The Hardware/Software Interface</I></A>, is a more complete and accurate description of the MIPS architecture and <B>spim</B> software.</P><P>There is some documentation for the Windows interface to <B>spim</B>: <A href="http://www.cs.wisc.edu/~larus/SPIM/spimwin.ps">postscript</A> or <A href="http://www.cs.wisc.edu/~larus/SPIM/spimwin.pdf">Adobe PDF file</A>. <P>The reference manual for the MIPS architecture (including processors later than the R2000/R3000) is: Gerry Kane and Joe Heinrich, <I>MIPS&nbsp;RISC Architecture</I>, Prentice Hall, Englewood Cliffs, N.J. 07632 ISBN 0-13-1059254. <P>Another good book for MIPS R2000 and R3000 programmers is: Erin Farquhar and Philip Bunce, <A href="http://www.mkp.com/books_catalog/areas/computer_architecture.asp#MIPS programming"><I>The MIPS Programmer's Handbook,</I></A> Morgan Kaufmann, San Francisco, CA, 1994, ISBN 1-55860-297-6.</P><P>However, the best book for MIPS programmers is: Dominic Sweetman, <A href="http://www.mkp.com/books_catalog/areas/computer_architecture.asp#MIPS programming"><I>See MIPS Run,</I></A> Morgan Kaufmann, San Francisco, CA, 1999, ISBN 1-55860-410-3.</P><HR width="100%"><H2 align=center>Latest Version</H2><P align=left>The current version of <B>spim</B> is 6.4, which contains the following changes from version 6.3:</P><ul>  <li><P align=left>PCSpim no longer shifts the focus of the register and data segments when values change.</P>  </li>  <li><P align=left>Fixed bug in the expansion of USH pseudo-op.</P>  </li>  <li><P align=left>Add system calls for open, close, read, and write.</P>  </li>  <li><P align=left>Fixed the Configure file to work with Mac OSX.</P>  </li>  <li><P align=left>Made the REM pseudo-op require 3 arguments.</P>  </li>  <li><P align=left>Fixed PCSpim dumping code to dump contents of console window.</P>  </li>  <li><P align=left>Treat LUI's immediate value as unsigned, as it is not sign extended.</P>  </li>  <li><P align=left>More error checking for malformed programs.</P>  </li>  <li><P align=left>Make symbol &quot;main&quot; as global.</P>  </li>  <li><P align=left>Avoid clearing last few bytes of data segments when they expand.</P>  </li>  <li><P align=left>Check that high-order 4 bits in jump instruction's PC match bits in target PC.</P>  </li></ul><P align=left>The previous version of <B>spim</B> is 6.3, which contains the following changes from version 6.2:</P><UL>  <LI>  <P align=left>PCSpim interface simplified to 4 fixed panes, similar to xspim,   which permit cut and paste. </P>  <LI>  <P align=left>PCSpim console stays on the screen after assembly program&nbsp;   terminates. </P>  <LI>  <P align=left>Comments in assembly source displayed in text segment. </P>  <LI>  <P align=left>NOP is standardized to sll $0 $0 0 (= 0x00000000) </P>  <LI>  <P align=left>Fixed several bugs and missed optimization in computing   immediate values in lw/sw instruction sequences. </P>  <LI>  <P align=left>High 2 bits in negative branch offsets were incorrect. </P>  <LI>  <P align=left>Display floating point registers with up to 18 digits of   precision. </P>  <LI>  <P align=left>New spim command (print_all_regs) prints all registers. </P>  <LI>  <P align=left>Minor changes to compile spim under cygwin for Windows. </P>  <LI>  <P align=left>Validate the range of immediate values in MIPS (but not pseudo)   instructions. </P>  <LI>  <P align=left>Fixed display of stack with non-word aligned $sp. </P>  <LI>  <P align=left>New flags:   <UL>    <LI>    <P align=left>-delayed-branches&nbsp; Simulate MIPS delayed control     transfers for branches, jumps, and calls </P>    <LI>    <P align=left>-delayed-loads Simulate MIPS non-interlocked loads.   </P></LI></UL></LI></UL><HR width="100%"><H2 align=center><B><FONT size=+2>Copyright</FONT></B></H2><P><B>spim</B> is copyrighted by James Larus. The DOS and Windows ports were done by David A. Carley and are copyrighted by Morgan Kaufmann Publishers. <B>spim</B> can be freely used and distributed for non-commercial purposes (see the README file for details).</P><HR width="100%"><H2 align=center><B><FONT size=+2>SPIMSAL Note</FONT></B></H2><P><B>spimsal</B> is an old version of <B>spim</B> that ran on <A href="ftp://ftp.cs.wisc.edu/pub/spimsal/spimsal.zip">PCs running Windows 3.1</A> and <A href="ftp://ftp.cs.wisc.edu/pub/spimsal/SPIMSAL.macintosh.bin">Macintoshes</A>. <B>spimsal</B> implements an extended version of the MIPS instruction set and is based on an old version of <B>spim</B>. It also does NOT run under Windows '95 or Windows NT. If you used this program on PCs and do not need the SAL instructions, you should get the new version.</P></BODY></HTML>

⌨️ 快捷键说明

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