My favorites | Sign in
Logo
                
Feeds:

Pep/8 Assembler and Simulator

This repository is for version 8.1 of the source code of the Pep/8 simulator and assembler for use with the textbook Computer Systems. The application is written in C++, is GUI-based, and is compiled with the Qt 4 development environment using the Qt Creator IDE available from Nokia at http://www.qtsoftware.com/downloads/ .

Current version

The current version of the Pep/8 assembler and simulator is 8.1.2. See what's new with this release.

Contact

Please send comments, bug reports, and feature requests to Stan Warford.

Textbooks

J. Stanley Warford, Computer Systems, fourth edition, Jones & Bartlett, Publishers, 2010, ISBN 978-0-7637-7144-7. See this errata page for printing errors in the fourth edition of the textbook. Please send textbook errata not yet listed to Stan Warford.

Pep/8 is also used in Computer Science Illuminated, Fourth Edition, by Nell Dale and John Lewis, Jones & Bartlett, Publishers, 2011, ISBN 978-0-7637-7646-6.

Pep/8 at SIGCSE 2010

A paper titled The Pep/8 Memory Tracer: Visualizing Activation Records on the Run-Time Stack will be presented at SIGCSE 2010, the 41st ACM Technical Symposium on Computer Science Education in Milwaukee, WI. The conference runs from March 10 - 13, and the paper is scheduled for the session on Computer Organization on Friday, March 12 between 3:30 and 4:45 p.m. Conference details are here. If you will be there we hope to see you, as we like to meet with users of Pep/8.

Downloads

The Pep/8 computer is a 16-bit complex instruction set computer (CISC). It is designed to teach computer architecture and assembly language programming principles. Its 39 instructions are based on an expanding opcode and are either unary (one byte) or nonunary (three bytes). The eight addressing modes and eight dot commands are designed for straighforward translation between C/C++ and assembly language.

The Downloads section of this site contains builds and source code for the support software for the textbook. In addition to the assembler and simulator hosted at this site, the Downloads section includes a CPU simulator and a cache simulator. Here is a summary of the Downloads software.

Pep/8 assembler and simulator

The assembler features an integrated text editor, error messages in red type that are inserted within the source code at the place where the error is detected, student-friendly machine language object code in hexadecimal format, the ability to code directly in machine language, bypassing the assembler, and the ability to redefine the mnemonics for the unimplemented opcodes that trigger synchronous traps.

The simulator features simulated ROM that is not altered by store instructions, a small operating system burned into simulated ROM that includes a loader and a trap handler system, an integrated debugger that allows for break points, single step execution, CPU tracing, and memory tracing, the option to trace an application, the loader, or the operating system, the ability to recover from endless loops, and the ability to modify the operating system by designing new trap handlers for the unimplemented opcodes.

01 Pep812Win.zip

Windows executable build for Pep/8 version 8.1.2

02 Pep812Mac.zip

Mac universal binary build for Pep/8 version 8.1.2

03 Pep812Lin.tar.gz

Ubuntu Linux build for Pep/8 version 8.1.2

Requires installation of Qt libraries. If there are version conflicts with the libraries, it is straightforward to download the source code and build the application with Qt Creator.

For Ubuntu users who prefer software downloads via Personal Package Archives, Ezra Reeves has posted a build at his PPA site.

04 Pep812.tar.gz

Source code for Pep/8 version 8.1.2

Download the source code and the Qt Creator IDE available from Nokia. Choose the LPGL / Free version. Launch Qt Creator and open the pep8-1.pro project file. When you click the build icon, Qt Creator will automatically construct the makefile and build the application.

05 Pep8Term.zip

The C++ source of the command-line terminal version.

Students write assembler source code in their favorite text editor and invoke the assembler on the command line. After a successful assembly, they run the simulator, which includes run-time debugging facilities. Input/output is with standard C++ streams so that batch jobs can be scripted with Unix scripting languages. This feature can be quite useful for grading programming homework problems that are submitted electronically.

Pep/8 CPU simulator

The CPU simulator is an implementation of the data section of the Pep/8 CPU as shown in Figure 12.2 of the textbook. It features color-coded display paths that trace the data flow depending on control signals to the multiplexers, a single-cycle mode of operation with GUI inputs for each control signal and instant visual display of the effects of the signal, and a multi-cycle mode of operation with an integrated text editor for the student to write Mc2 microcode sequences and execute them to implement ISA3 instructions.

06 Pep8CPU46Win.zip

Windows executable build for Pep/8 CPU simulator version 46

07 Pep8CPU46MacPower.zip

PowerPC Mac executable build for Pep/8 CPU simulator version 46

08 Pep8CPU46MacTel.zip

Intel Mac executable build for Pep/8 CPU simulator version 46

09 Pep8CPU46.tar.gz

Source code for Pep/8 CPU simulator version 46

Pep/8 cache simulator

This contribution by Professor Peter Smith, California State University Channel Islands, is a command-line interface implementation of the cache shown in Figures 12.32 and 12.33 of the textbook. The user determines the structure of the cache by specifying the block size, the number of blocks per row, and the number of rows. A selection of 1 for the number of blocks per row is equivalent to the direct-mapped cache of Figure 12.29, while a number greater than 1 is equivalent to the set-associative cache of Figure 12.30.

In addition, the user determines whether instructions and data share the cache. If there are separate caches for instructions and data then half the rows are used for each.

The user can select one of four replacement algorithms: random, LRU, LFU and FIFO. The discussion of replacement algorithms in Chapter 12.2 in Computer Systems is brief and only mentions the Least Recently Used (LRU) algorithm. Replacement algorithms for cache line replacement are similar to those for page replacement described in Chapter 9.2, which also describes the first in, first out (FIFO) algorithm. In addition to these two replacement algorithms, the Pep/8 cache simulator allows the user to select the least frequently used (LFU) algorithm and the Random algorithm. With LFU, a count is maintained for each line that is hit in the cache, and that line is chosen for replacement that has the smallest count. With the Random algorithm, a line is selected at random for replacement.

The cache simulator collects performance statistics on Pep/8 machine language programs. It loads the Pep/8 operating system and runs Pep/8 object programs produced by any of the assembler programs.

10 Pep8Cache352.zip

The C source code and documentation for version 3.5.2 of the Pep/8 cache simulator.

Paper

11 Pep8CPUPaper.pdf

A paper on the Pep/8 CPU simulator from the 2007 ACM SIGCSE conference









Hosted by Google Code