forked from StanWarford/pep8term
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
151 lines (123 loc) · 5.72 KB
/
README
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
This is the README file from the package Pep8Term.zip
The package contains the C++ source of the command-line
terminal version of the system described in "Computer Systems",
Fourth edition, J. Stanley Warford, Jones and Bartlett, Publishers,
2010. ISBN 978-0-7637-7144-7
Released under the GNU General Public License without warrenty
as described in http://www.gnu.org/copyleft/gpl.html
The package contains the Pep/8 assembler used to produce the
program listings in the textbook. It also includes a simulator
that executes the object code from the assembler. 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
is an ideal way to test and print large numbers of student
homework assignments.
Version
-------
Pep8Term, version 8.1.0
Installation
------------
A makefile is included for one-step installation with the make
command. The makefile consists of three C++ compile commands, one
for the assembler, one for the simulator, and one for a utility
that strips the <CR> character from DOS files, which use <CR><LF>
at the end of each line, to make the source files compatible
with the <LF> terminated lines of Unix/Linux/OS X.
Files
-----
Here is a list of the files included in the package. They are all
text files that can be examined with the cat or more command.
README
This file of general information.
asem8.cpp
The C++ source file for the Pep/8 assembler.
After executing the make command, the assembler executable is placed
in a file named asem8.
pep8.cpp
The C++ source file for the Pep/8 simulator.
After executing the make command, the simulator executable is placed
in a file named pep8.
makefile
The script for the C++ compile commands to build the executables.
pep8os.pep
The source code of the Pep/8 operating system. See Chapter 8 of the
textbook for a complete description.
pep8os.pepo
The object code from pep8os.pep. This program is required to be in
the same directory as pep8 when it executes. This file could be
generated by assembling pep8os.pep with the asem8 program as follows:
asem8 pep8os.pep
pep8os.pepl
The program listing from pep8os.pep. This file could be generated by
assembling pep8os.pep with the asem8 program using the listing option
as follows:
asem8 -l pep8os.pep
trap
A text file that contains the mnemonics of the trap instructions.
This file is used by both asem8 and pep8. It is required to be in
the same directory as these executables. Pep/8 has several unimplemented
opcodes that execute as synchronous traps. The trap mechanism is
described in Section 8.2 of the textbook. The trap instructions include
several no-operation instructions with mnemonics NOP, NOP0, NOP1, NOP2,
and NOP3. Students can write their own trap handlers by modifying the
the operating system source, pep8os.pep. If they change the NOP mnemonics
by editing this file, they can use their new mnemonics in their assembly
language programs and can see the mnemonics displayed in the debugging
facilities of the simulator. Problems 8.26 - 8.33 in the textbook
are all problems to implement new instructions via trap handlers.
stripCR.cpp
The source file that strips the <CR> character from DOS files, which
use <CR><LF> at the end of each line, to make the source files compatible
with the <LF> terminated lines of Unix/Linux/OS X. This utility takes a
stream of characters from the standard input and produces an output
stream of characters to the standard output. You should run DOS files
through this utility or its equivalent before using asem8, as the Pep/8
assembler assumes <LF> terminated lines.
chap05
A directory containing all the programs from Chapter 5 of the textbook.
chap06
A directory containing all the programs from Chapter 6 of the textbook.
trap file placement
-------------------
The assembler and simulator need access to the file named "trap". If you
want to execute from a directory different from the one containing the
executable applications, you should include a copy of trap in the directory
from which you are executing.
Usage
-----
The names of all Pep/8 assembly language source files must end in ".pep".
The assembler produces the object code in a file of the same name, but
ending in ".pepo". If you use the listing option -l, the program listing
is placed in a file with the same name but ending in ".pepl". When you
run the simulator, the first command you should execute is the (l)oad
command.
Here is a terminal session to assemble and execute the program fig0503.pep
in the directory chap05. It is Figure 5.3 in the textbook.
========================================
bash-2.05$ ./asem8 -l chap05/fig0503.pep
bash-2.05$ ./pep8
64599 bytes RAM free.
(l)oad e(x)ecute (d)ump (t)race (i)nput (o)utput (q)uit: l
Enter object file name (do not include .pepo): chap05/fig0503
Object file is chap05/fig0503.pepo
(l)oad e(x)ecute (d)ump (t)race (i)nput (o)utput (q)uit: x
Hi
(l)oad e(x)ecute (d)ump (t)race (i)nput (o)utput (q)uit: q
bash-2.05$
========================================
If you omit -l with asem8, the program listing file will not be created.
The (d)ump command displays a dump of memory on the screen.
The (t)race command allows the user to trace the loader, or the program,
or the program including the trap handlers.
The (i)nput command lets the user specify either the keyboard or a file
for input. Default is the keyboard.
The (o)utput command lets the user specify either the screen or a file
for output. Default is the screen.
Contact
-------
Please contact the author at Stan.Warford@pepperdine.edu with bug
reports and suggestions for improvement.
Enjoy!