File: SPIM.html

package info (click to toggle)
spim 8.0%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,608 kB
  • ctags: 2,408
  • sloc: asm: 8,560; ansic: 8,441; yacc: 2,298; makefile: 1,114; lex: 705; sh: 212
file content (734 lines) | stat: -rw-r--r-- 32,788 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734

<head>
<title>SPIM MIPS Simulator</title>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<style type="text/css">
.style1 {
	text-align: left;
}
</style>
</head>

<html>
<body>
<h1 align=center>SPIM</h1>
<h2 align=center>A MIPS32 Simulator</h2>
<center>
<p style="margin-top: 0; margin-bottom: 0">
<a href="http://www.cs.wisc.edu/~larus/larus.html">James Larus</a></p>
<p style="margin-top: 0; margin-bottom: 0"><a href="mailto:larus@microsoft.com">
larus@microsoft.com</a></p>
<p style="margin-top: 0; margin-bottom: 0">&nbsp;</p>
<p style="margin-top: 0; margin-bottom: 0">Microsoft Research<i><br>
Formerly:</i> Professor, Computer
Sciences Department, University of Wisconsin-Madison</p>
</center>
<p><b>spim</b> is a self-contained simulator that will run MIPS32 assembly language programs. It reads and executes assembly language
programs written for this processor. <b>spim</b> also provides a simple debugger and minimal set
of operating system services.<b> spim</b> does <u>not</u> execute binary
(compiled) programs.</p>
<p><b>spim</b> implements almost the entire MIPS32 assembler-extended instruction
set. (It omits most floating point comparisons and
rounding modes
and the memory system page tables.) The MIPS architecture has several
variants that differ in various ways (e.g., the MIPS64 architecture supports 64-bit integers and addresses), which means that
<b>spim</b> will not run programs compiled for all types of MIPS processors. MIPS compilers also generate a number of assembler directives that
<b>spim</b> cannot process. These directives usually can be safely deleted.</p>
<p>Earlier versions of <b>spim</b> (before 7.0) implemented the MIPS-I
instruction set used on the MIPS R2000/R3000 computers. This architecture is
obsolete (though, has never been surpassed for its simplicity and elegance). <b>spim</b> now supports the more modern MIPS32 architecture, which
is the MIPS-I instruction set augmented with a large number of occasionally useful instructions. MIPS code from earlier
versions of SPIM should run without changes, <u>except</u> code that handles
exceptions and interrupts. This part of the architecture changed over time (and
was poorly implemented in earlier versions of <b>spim</b>). Code of this sort need to be updated. Examples of the
new code are in exceptions.s and
Tests/tt.io.s.</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 window interface. On Unix, Linux,
and Mac OS X the <i>spim</i> program provides a simple terminal interface and
the <i>xspim</i> program provides the windowing interface. On Microsoft Windows, the <i>spim</i> program
provides a  console interface and <i>PCSpim</i> provides a
Windows interface.</p>
<hr width="100%">

<h2 align=center><font size="+2">Happy Birthday</font><b><font size=+2> SPIM!</font></b></h2>
<p class="style1"><strong>spim</strong> is 20 years old this January (2010). I 
wrote the original version of <strong>spim</strong> as the target machine for my 
first compiler class at University of Wisconsin, Madison in the spring semester 
1990. <strong>spim</strong> is likely older than most of the students currently 
using it!</p>
<p class="style1">As a birthday present, the new version of <strong>spim</strong> 
(8.0) has a simpler, less restrictive license, namely the standard BSD license.</p>
<div align=center>
<center>
<hr width="100%">

<h2 align=center><b><font size=+2>Downloading SPIM</font></b></h2>
<p align=center>&nbsp;</p>
<table width=732 border=1>
  <tbody>
  <tr>
    <td align=middle width=451><b>Platform</b></td>
    <td align=middle width=96><b>Program</b></td>
    <td align=middle width=128><b>Form</b></td>
    <td align=middle width=382><b>File</b></td></tr>
  <tr>
    <td width=451>Unix or Linux system<br>
    Mac OS X</td>
    <td width=96 align="center"><i>spim<br>xspim</i></td>
    <td width=128 align="center">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=451>Linux</td>
    <td width=96 align="center"><i>spim<br>
    xspim</i></td>
    <td width=128 align="center"><font SIZE="3">Binary RPM for Fedora</font></td>
    <td width=382>
    <a href="http://www.cs.wisc.edu/cbi/downloads/">
	http://www.cs.wisc.edu/cbi/downloads/</a>&nbsp;
    </td></tr>
  <tr>
    <td width=451 rowSpan=2>Microsoft Windows<br>(Windows  NT, 2000, XP)<p>
    (spim 7.0 and later versions no longer run on Windows 95/98. Use version 6.5 or
    earlier.)</td>
    <td width=96 rowSpan=2 align="center"><i>PCSpim</i></td>
    <td width=128 align="center">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 align="center">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>
  </tbody></table></center></div>
<ul>
  <li>
<p style="margin-top: 6">To run <i>spim</i> or <i>xspim</i> on a Unix, Linux, or
Mac OS X 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 code and must be compiled for your system.</p>
  </li>
  <li>
<p style="margin-top: 6">Ben Liblit of the <i>Cooperative Bug Isolation Project</i>
(<a href="http://www.cs.wisc.edu/cbi/">http://www.cs.wisc.edu/cbi/</a>)
produced a compiled version of <b>spim </b>for Fedora. It contains the
project's low-overhead monitoring code, which can help find bugs in <b>spim</b>.
If you are running Linux, this package can: save you the time and trouble of compiling
and installing <b>spim</b>, help find bugs, and aid an interesting
research project.</p>
  </li>
  <li>
<p style="margin-top: 6">To run <i>PCspim</i> 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 click on <i>setup.exe</i>.</p>
  </li>
  <li>
<p style="margin-top: 6">Source for the Microsoft Windows version (both <i>PCspim</i>) is available separately in
the file <a
      href="http://www.cs.wisc.edu/~larus/SPIM/pcspim_src.zip">http://www.cs.wisc.edu/~larus/SPIM/pcspim_src.zip</a>.
</p></li>
  <li><p style="margin-top: 6">There is no  native Macintosh version of <b>spim</b>.
	However, the <i>xspim</i> will compiles and runs on Mac
OS X. </p>
  </li>
</ul>
<hr width="100%">

<h2 align=center><font size="+2">Installation</font></h2>

<p align=left><b><font size="4">Microsoft Windows</font></b></p>
<ol>
  <li>

<p align=left>Download the file
<a href="http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip">
http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip</a> and save it on your machine.</li>
<li>

<p align=left>Unzip the file.</li>
<li>

<p align=left>Click on the <i>setup.exe</i> program.</li>
</ol>

<p align=left><b><font size="4">Unix, Linux, or Mac OS X</font></b></p>

<p align=left><font color="#FF0000">(Note: the directions changed slightly for
version 7.2, to reflect a new directory structure. Please read carefully.)</font></p>
<p align=left>Installation is a bit more complex for a Unix or Linux system, as
you need to compile the program for your particular computer and operating
system.</p>
<ol style="margin-top: 2">
  <li>

<p align=left>Download either the 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<a href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.Z"> </a><a
      href="http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz">http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz</a>.</li>
<li>

<p align=left>Decompress the file, using either the program <i>uncompress</i>
for the first file or <i>gzip</i> for the second file:<br>
<br>
&nbsp;&nbsp;&nbsp; <i>% uncompress spim.tar.Z<br>
<br>
</i>or<br>
<br>
&nbsp;&nbsp;&nbsp; <i>% gzip -d spim.tar.gz<br>
&nbsp;</i></li>
<li>

<p align=left>Move the file <i>spim.tar</i> to the directory in which you want
to build <b>spim</b> and untar it:<br>
<br>
&nbsp;&nbsp;&nbsp; <i>% tar xf spim.tar<br>
<br>
</i>It will create a directory named <i>spim-8.0</i> (or the most recent version
number).<br>
&nbsp;</li>
	<li>
	<p align=left>The simple terminal interface is contained in the <i>
	spim-8.0/spim</i> directory and the X-windows interfaces is in the <i>
	spim-8.0/xspim</i> directory.<i> </i>The other directories are described in
	the README file.<i><br>&nbsp;</i></li>
	<li>
	<p align=left>Next, you must set the directories in which <b>spim </b>will be
installed by editing the <i>Makefile</i> (the file that contains instructions on building
	<b>spim</b>).
In general, if you are installing <b>spim</b> and want the windowing version (<i>xspim</i>),
edit the file <u><i>xspim/Imakefile</i></u>. If you don't want <i>xspim</i>
or are running on a system without X-windows installed, you use the file <i>
	spim/Makefile</i>.<br><br>
The programs are installed in standard locations, but you can change the pathnames to other locations:</p>
	<p align=left>&nbsp;&nbsp;&nbsp; EXCEPTION_DIR -- The full pathname of the directory
in which to install the <b>spim </b>exception handler <i>(exceptions.s</i>)<i>.</i></p>
	<p align=left>&nbsp;&nbsp;&nbsp; BIN_DIR -- The full pathname of the directory
in which <i>spim</i> and <i>xspim</i> should be installed.</p>
	<p align=left>&nbsp;&nbsp;&nbsp; MAN_DIR -- The full pathname of the directory
in which the manual pages for <i>spim</i> and <i>xspim</i> should be installed.<br>
	<br>In general, the remaining parameters in a <i>Makefile</i> need not be changed.<br>&nbsp;</li>
	<li>
	<p align=left>Then, if you are building <i>xspim</i>, change to
	the <i>spim-8.0/xspim </i>directory and type:<br><br>&nbsp;&nbsp;&nbsp; <i>% xmkmf<br>&nbsp;&nbsp;&nbsp; % make<br>
	</i>If you do not have a copy of <i>xmkmf</i>, you can use the <i>Makefile</i> in
	the <i>xspim</i> directory, but beware that it may not work on your system
	because the paths to the X windows libraries could be different.<br>&nbsp;</li>
	<li>
	<p align=left>If you do not have X-windows, change to the<i>spim-8.0/spim</i>
	directory, edit <i>Makefile,</i> and type:
          <br><br><i>&nbsp;&nbsp;&nbsp; % make<br>&nbsp;&nbsp;&nbsp; </i></li>
	<li>
	<p align=left>To run <i>spim</i> or <i>xspim</i>, the exception handler must be
installed in the directory specified by the variable EXCEPTION_DIR in the <i>Makefile</i>.
If the file <i>exception.s</i> is not installed, <i>spim</i> and <i>xspim</i>
fail  before they start running. You can either install this file
by hand or by typing:
<br><br> <i>&nbsp;&nbsp;&nbsp; % make install</i><br><br>
which also installs <i>spim</i> or <i>xspim</i>, and the manual pages in the directories that
you set (above). You may need root permission to install these files, in which case type:
<br><br> <i>&nbsp;&nbsp;&nbsp; % sudo make install</i><br><br>
</li>
	<li>
	<p align=left>To test that <b>spim </b>is correctly built, change to the <i>
	spim-8.0/spim </i>directory and type:<br><br><i>&nbsp;&nbsp;&nbsp; % make test</i><br>
	<br>and examine the output of the test. (Note: the exception handler must be installed
before running the test.)</li>
</ol>
<hr>

<h2 align=center><font size="+2">Resources</font></h2>
<ul style="margin-top: 12">
  <li>
<p style="margin-top: 12; margin-bottom: 2">Elsevier (aka Morgan Kaufmann) has
generously provided the <b>spim </b>documentation (Appendix A) from the third
edition of Hennessy &amp; Patterson, <i>
<a href="http://books.elsevier.com/us/mk/us/subindex.asp?isbn=1558606041&country=United+States&community=mk&mscssid=T3GQV69C1T2T8NHKQJH2H7ANRW84FXW3">Computer
Organization and Design: The Hardware/Software Interface</a></i>. This
documentation is far more complete and  up-to-date than the documentation
included in the <b>spim</b> distribution. The COD documentation includes:<ul style="margin-top: 6">
  <li>
<p style="margin-top: 12; margin-bottom: 2">&nbsp;<i>Appendix A: Assemblers,
Linkers, and the SPIM Simulator</i> (<a href="HP_AppA.pdf">PDF</a>). An overview
and reference manual for <b>spim</b> and the MIPS32 instruction set.</li>
  <li>
<p style="margin-top: 12; margin-bottom: 2"><i>Getting Started with spim</i> (<a href="spim.pdf">PDF</a>).
Overview of the console version of <b>spim</b> (both Unix and Windows).</li>
  <li>
<p style="margin-top: 12; margin-bottom: 2"><i>Getting Started with xspim</i> (<a href="xspim.pdf">PDF</a>).
Overview of the X-windows version of <b>spim</b>.</li>
  <li>
<p style="margin-top: 12; margin-bottom: 2"><i>Getting Starting with PCSpim</i>
(<a href="PCSpim.pdf">PDF</a>). Overview of the Microsoft Windows version of <b>
spim</b>.</li>
  <li>
<p style="margin-top: 12; margin-bottom: 2"><i>SPIM Command-Line Options</i> (<a href="SPIM_command-line.pdf">PDF</a>).
Overview of the command line options of <b>spim</b> (all versions).</li>
</ul>
  </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">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>). This document is for the original <b>spim</b> (pre-version 7.0),
which simulated the MIPS-I architecture rather than MIPS32, and so differs in
many minor aspects from the current version of <b>spim.</b> Appendix A of Hennessy &amp; Patterson, <i>
<a href="http://books.elsevier.com/us/mk/us/subindex.asp?isbn=1558606041&country=United+States&community=mk&mscssid=T3GQV69C1T2T8NHKQJH2H7ANRW84FXW3">Computer
Organization and Design: The Hardware/Software Interface</a></i> (above), is
more up-to-date and correct..</p>
  </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">The best book I have seen on MIPS programming
is: Dominic Sweetman, <i>
<a href="http://books.elsevier.com/us/mk/us/subindex.asp?isbn=1558604103&country=United+States&community=mk&mscssid=T3GQV69C1T2T8NHKQJH2H7ANRW84FXW3">See
MIPS Run,</a></i> Morgan Kaufmann, San Francisco, CA, 1999, ISBN
1-55860-410-3.</li>
  <li>
	<p style="margin-top: 12; margin-bottom: 2">MIPS, Inc. has excellent free
	documentation on the MIPS32 architecture on their website
	<a href="http://www.mips.com/products/product-materials/processor/mips-architecture/">
	http://www.mips.com/products/product-materials/processor/mips-architecture/</a>: <ul style="margin-top: 12">
  <li>
<p style="margin-top: 12; margin-bottom: 2">
<a href="http://www.mips.com/secure-download/index.cfm?filename=mips-architecture/MD00082-2B-MIPS32INT-AFP-02_60.pdf">MIPS32 Architecture for Programmers Volume I: Introduction to the MIPS32
Architecture (.pdf)</a> </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">
<a href="http://www.mips.com/secure-download/index.cfm?filename=mips-architecture/MD00086-2B-MIPS32BIS-AFP-02_62.pdf">MIPS32 Architecture for Programmers Volume II: The MIPS32 Instruction Set (.pdf)</a> </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">
<a href="http://www.mips.com/secure-download/index.cfm?filename=mips-architecture/MD00090-2B-MIPS32PRA-AFP-02.80.pdf">MIPS32 Architecture for Programmers Volume III: The MIPS32 Privileged Resource
Architecture (.pdf)</a> </li>
</ul>
  </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">An old reference manual for the MIPS architecture (including processors
subsequent to 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.

  </li>
  <li>

<p style="margin-top: 12; margin-bottom: 2">Another good book for the MIPS R2000 and R3000 is: Erin Farquhar and
Philip Bunce, <i>
<a href="http://books.elsevier.com/us/mk/us/subindex.asp?isbn=1558602976&country=United+States&community=mk&mscssid=T3GQV69C1T2T8NHKQJH2H7ANRW84FXW3">The
MIPS Programmer's Handbook,</a></i> Morgan Kaufmann, San Francisco, CA, 1994,
ISBN 1-55860-297-6.</p>
  </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">The GNU C compiler can generate code
for the MIPS R3000 and can be used as a cross compiler. A retargeted port
of gcc is available on the <a href="http://www.cs.unibo.it/mps/">MPS Resource
Page</a>. I have not used this compiler.</p>
  </li>
  <li>
<p style="margin-top: 12; margin-bottom: 2">Downcast Systems offers a very nice
text editor for MIPS assembly code called
<a href="http://www.downcastsystems.com/mipster/">MIPSter</a>. It has syntax
highlight, MIPS-specific help, good integration with SPIM, and a number of other
features to make it easier to write assembly code. MIPSter is an inexpensive
commercial product, and it offers a limited time trial version.</p>
  </li>
	<li>
<p style="margin-top: 12; margin-bottom: 2">Andrea Grandi ported SPIM to the
<a href="http://www.nokiausa.com/770">Nokia 770/800 Internet Tablet</a> so you
never need to be without the ability to run MIPS programs. The port of SPIM is
available at: http://www.ptlug.org/wiki/SPIM_N770. </p>
  </li>
</ul>
<hr width="100%">

<h2 align=center>Changes in Latest Version</h2>
<p align=left>The current version of <b>spim</b> is 8.0 (January 2010), which is
a minor release that cleans up bugs in 7.5 and moves to a BSD license:</p>
<ul>
	<li><p>Changed install path from /usr to /usr/local and removed -D option to install 
command (which doesn&#39;t exists on MacOS).</p></li>
	<li><p>Change license to a BSD license, update copyright notices, and eliminated 
references to my old email address.</p></li>
	<li><p>Simplify alignment of data on stack to ensure enough room is left for 
environment and args at top of stack.</p></li>
	<li><p>Initialize stack with arguments when running program from run dialog.</p></li>
	<li><p>read_input filled buffer with last character of file not terminated by newline.</p></li>
	<li><p>Links to MIPS documentation were broken.</p></li>
	<li><p>Did not return value from exit syscall.</p></li>
</ul>
<p align=left>The current version of <b>spim</b> is 7.5 (August 2009), which is
a minor release that cleans up bugs in 7.4:</p>
<ul>
	<li>
	<p align=left>Correct problem with installer script that did not install
	appropriate versions of msvcrt and mfc
dlls for Visual Studio 9.0.</p></li>
	<li>
	<p align=left>Fix install scripts to put exceptions.s at /usr/lib/spim on
	Linux.</p></li>
	<li>
	<p align=left>Fixed major memory leak caused by overwritten instructions not
	being freed.</p></li>
	<li>
	<p align=left>Force redisplay of data segment in situations when register
	values (such as $sp) have changed.</p></li>
	<li>
	<p align=left>Properly initialize PC at first invocation of step operation
	on PCSPim.</p></li>
	<li>
	<p align=left>Fixed bug in Xxpim that caused the step commend to
	reinitialize the stack.</p></li>
</ul>
<p align=left>The current version of <b>spim</b> is 7.4 (January 2009), which is
a minor release that cleans up bugs in 7.3:</p>
<p align=left>1/14/09: Released new version of pcspim.zip to correct problem
with installer script that did not install appropriate versions of msvcrt and mfc
dlls.<br>
1/21/09: Released new version of spim.tar.Z and spim.tar.gz to correct problem
with install command for spim program (but not xspim).</p>
<ul>
	<li>
	<p align=left>Fixed install directories for Linux systems.</p>
	</li>
	<li>
	<p align=left>Retained command line arguments in second and subsequent runs.</p>
	</li>
	<li>
	<p align=left>Bug in overflow from low-order word in MADD, MSUB.</p></li>
	<li>
	<p align=left>Bug in decoding SPECIAL2 instructions (e.g. madd).</p></li>
</ul>
<p align=left>The previous version of <b>spim</b> is 7.3 (August 2006), which is
a minor release that cleans up a number of bugs in 7.2:</p>
<ul>
	<li>
	<p align=left>Fix for flex 2.5.33 (internal change broke spim's scanner).</li>
<li>
<p align=left>Exception handler can be a semicolon-separated list of files that
will be loaded in order. On Unix, SPIM_EXCEPTION_HANDLER environment variable is
consulted before command line arguments.</li>
<li>
<p align=left>Memory corruption caused spim to crash when label was defined
twice in succession.</li>
<li>
<p align=left>PCSpim updates register and memory display after a parse error
while reading a file.</li>
<li>
<p align=left>Eliminated unnecessary null char between strings in list of
strings produced by .asciiz.</li>
<li>
<p align=left>Makefiles (in spim/ and xspim/) now contain clearly defined paths
for installing executables, exception handler, and man pages. The man pages are
no longer installed by the &quot;make install&quot; command.</li>
<li>
<p align=left>Change psfig to epsfig in spim.tex (does anyone still use this
obsolete documentation?).</li>
</ul>
<p align=left>The previous version of <b>spim</b> is 7.2.1 (August 2005), which is
a minor release that cleans up a number of bugs in 7.1:</p>
<ul>
	<li>
	<p align=left>Fixed multiple problems in memory mapped IO in xspim and spim.
	<span style="background-color: #FFFF00">(Note: to make programming uniform
	across all three platforms, memory mapped IO now follows&quot;Unix&quot; handling of
	carriage return (CR) and new line (NL) characters . On input, a CR is
	translated to a NL, and on output, a CR is printed after a NL. This was
	previously true for PCSpim and xspim, but not spim.)</span></p></li>
	<li>
	<p align=left>Fixed bug in indexed address computation in LW and SW
	instructions.</p></li>
	<li>
	<p align=left>Eliminated non-POSIX flags IUCLC and IXANY to facilitate port
	to Mac OS X.</p></li>
	<li>
	<p align=left>Use termios(3) library calls instead of IOCTLs to fix bug
	introduced in port from termio to termios struct.</p></li>
	<li>
	<p align=left>Test default case for jalr, without default $rd (=31).</p>
	</li>
	<li>
	<p align=left>Trap handler in test extracted wrong bits from ExcCode field
	of Cause register.</p></li>
	<li>
	<p align=left>Pervasive restructuring of files to put 3 UIs (spim, xspim,
	PCSpim) in separate directories and cleanup organization and Makefiles.</p>
	</li>
	<li>
	<p align=left>Use correct help file in install process.</p></li>
	<li>
	<p align=left>Added work-around for bug in flex 2.5.31 that left yytext_ptr
	undefined.</p></li>
	<li>
	<p align=left>Epilogue code restored $at register, then used a pseduo
	instructions that smashed it.</p></li>
	<li>
	<p align=left>Cleared filename when reinitializing PCSpim, which broke next
	reload command.</p></li>
</ul>
<p align=left>The previous version of <b>spim</b> is 7.1 (January 2005), which is
a minor release that cleans up a number of bugs in 7.0:</p>
<ul>
	<li>
	<p align=left>Minor cleanup.</p></li>
	<li>
	<p align=left>Switched Windows installer to Microsoft .msi installer, from
	InstallShield.</p></li>
	<li>
	<p align=left>exceptions.s used wrong mask for exception cause field.</p>
	</li>
	<li>
	<p align=left>Clearing the transmitter or receiver interrupt enable bits
	also clear interrupt pending bits in Cause register.</p></li>
	<li>
	<p align=left>Code to poll for a console input character in X windows
	blocked and prevented any output until input occured.</p></li>
	<li>
	<p align=left>Type of &quot;mul&quot; instruction was wrong, which lead to it being
	printed without destination register.</p></li>
	<li>
	<p align=left>Print underlying instruction, not breakpoint.</p></li>
	<li>
	<p align=left>Unparing error that unparsed beq as beql.</p></li>
	<li>
	<p align=left>Eliminated dependence on obsolete termio.h in favor of POSIX
	termios.h since Mac OS X doesn't have termio.h any more.</p></li>
	<li>
	<p align=left>Fix null pointer problem if no entries in registry.</p></li>
	<li>
	<p align=left>Turn off EXL bit after break instruction, since break is
	handled by spim, not MIPS, code and the bit was never cleared.</p></li>
	<li>
	<p align=left>Set default path for exceptions.s to C:\Program Files\PCSpim,
	the default installation directory.</p></li>
	<li>
	<p align=left>Test for SQRT.S used double constant, which failed on SPARC
	(but not x86).</p></li>
</ul>
<p align=left>The previous version of <b>spim</b> is 7.0 (August 2004), which is
a major release that contains a significant number of changes from version 6.5:</p>
<ul>
  <li>
<p align=left>Upgraded simulator to MIPS32, Version 1 architecture (except
details of FPU and memory).</p>
  </li>
  <li>
<p align=left>Exceptions and interrupts reimplemented, to make them closer to the
actual hardware.</p>
  </li>
  <li>
<p align=left>Memory mapped IO console reimplemented to make it work properly.</p>
  </li>
  <li>
<p align=left>Implemented timer in CPU.</p>
  </li>
  <li>
<p align=left>Renamed &quot;trap&quot; to &quot;exception&quot; to correspond to MIPS terminology.</p>
  </li>
  <li>
<p align=left>Introduced short forms of command line arguments and dropped need
for &quot;-file&quot; argument.</p>
  </li>
  <li>
<p align=left>Major internal cleanup and reorganization of code to eliminate
unused code and simplify implementation.</p>
  </li>
  <li>
<p align=left>PCSpim prompts about reinitialization when file reloaded.</p>
  </li>
  <li>
<p align=left>PCSpim lets user set font.</p>
  </li>
  <li>
<p align=left>Word align all segment boundaries and ensure sbrk returns
word-aligned addresses.</p>
  </li>
  <li>
<p align=left>Added new syscall (EXIT2_SYSCALL) that returns value from SPIM.</p>
  </li>
  <li>
<p align=left>Improved implementation of delayed load instructions.</p>
  </li>
  <li>
<p align=left>Refactored the test cases, so that endian-independent code is in
tt.core.s</p>
  </li>
  <li>
<p align=left>Many small bug fixes.</p>
  </li>
</ul>
<p align=left>Outstanding bugs in 7.0:</p>
  <ul>
    <li>
<p align=left>The trap handler (exceptions.s) fails when the trapping
instruction is in the delay slot of a branch or jump. The trap handler returns
by simplemindedly adding 4 to the EPC (which is the branch's address in this
case), so it does not return to the instruction executed after the trapping
instruction.</p>
    </li>
    <li>
<p align=left>Handling of newlines and carriage returns is inconsistent between
platforms. When a program prints a newline, PCSpim also prints a carriage
return, spim and xspim don't. Or, is this consistent with the underlying
platform?</p>
    </li>
</ul>
<p align=left>The previous version of <b>spim</b> is 6.5 (January 2003), which contains the
following changes from version 6.4:</p>
<ul>
  <li>
<p align=left>If started program is started with only one argument, assume it is
a file name.</p>
  </li>
  <li>
<p align=left>Added Alt-F4 shortcut to PCSpim.</p>
  </li>
  <li>
<p align=left>Fixed trap.handler to return to instruction at EPC on interrupt. </p>
  </li>
  <li>
<p align=left>Fixed (real!) hardware exception on integer overflow in division.</p>
  </li>
  <li>
<p align=left>-trap_file did not properly parse argument in xspim.</p>
  </li>
  <li>
<p align=left>Fixed printing of error on last line without a carriage return.</p>
  </li>
  <li>
<p align=left>Print proper registers when printing hex FP numbers.</p>
  </li>
  <li>
<p align=left>Properly zero newly allocated memory.</p>
  </li>
  <li>
<p align=left>Added nops (addu $0, $0, 0) to trap handler, so that it works
properly in bare mode!</p>
  </li>
  <li>
<p align=left>PCSPIM.HLP file was corrupted.</p>
  </li>
</ul>
<p align=left>The previous version of <b>spim</b> is 6.4 (January 2002), 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 (January 2001), 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 and distributed under a BSD license.</p>
<p>
Copyright (c) 1990-2010, James R. Larus.
All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:</p>
<ul>
<li>Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.</li>
<li>
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.</li>
</ul>
<p>Neither the name of the James R. Larus nor the names of its contributors may be
used to endorse or promote products derived from this software without specific
prior written permission.</p>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
<p>&nbsp;The DOS and Windows ports were done by David A. Carley and are copyrighted
y Morgan Kaufmann Publishers.</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.</p></body></html>