Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dcc21ed8d | ||
|
|
07c9a5c2d7 | ||
|
|
396492720b | ||
|
|
970c5b6347 | ||
|
|
e1ee7f254a | ||
|
|
f51734d3de | ||
|
|
c2ba39ba0f | ||
|
|
9f818a984b | ||
|
|
bceda25306 | ||
|
|
d2690695db | ||
|
|
7af29dd922 | ||
|
|
0c65c8f1d6 | ||
|
|
e22f0e74df | ||
|
|
3fa173ab56 | ||
|
|
963ea7c170 | ||
|
|
dbd19c5478 | ||
|
|
ddf4ab1f23 | ||
|
|
663faf8a00 | ||
|
|
9e61d74691 | ||
|
|
1c039339ef | ||
|
|
668de66579 |
@@ -3,37 +3,42 @@
|
|||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
pdp7-unix is a project to resurrect Unix on the PDP-7 from scans of the original
|
pdp7-unix is a project to resurrect Unix on the PDP-7 from scans of
|
||||||
assembly code done by
|
the original assembly code done by
|
||||||
[Norman Wilson](http://www.cs.toronto.edu/~norman/pers/index.html).
|
[Norman Wilson](http://www.cs.toronto.edu/~norman/pers/index.html).
|
||||||
The scans of PDP-7 Unix are in the [Unix Archive](http://www.tuhs.org/)
|
The scans of PDP-7 Unix are in the [Unix Archive](http://www.tuhs.org/)
|
||||||
[as the files 0*.pdf](http://www.tuhs.org/Archive/Distributions/Research/McIlroy_v0/).
|
as the files
|
||||||
|
[0*.pdf and 1*.pdf](http://www.tuhs.org/Archive/Distributions/Research/McIlroy_v0/).
|
||||||
|
|
||||||
## Current Status
|
## Current Status
|
||||||
|
|
||||||
|
### October 2019
|
||||||
|
|
||||||
|
A second notebook with missing sources has been discovered and
|
||||||
|
scanned. The original commands are now in the disk image
|
||||||
|
(only the B compiler, date, mv and od are modern programs).
|
||||||
|
|
||||||
|
Graphics programs (including Space Travel) are being debugged
|
||||||
|
along with a simulation of the display hardware.
|
||||||
|
|
||||||
### March 2016
|
### March 2016
|
||||||
|
|
||||||
We've written an assembler, a user-mode simulator and
|
We've written an assembler, a user-mode simulator and commented
|
||||||
commented several source files. We now have these utilities running:
|
several source files. We now have these utilities running: as, cat,
|
||||||
as, cat, chmod, chown, chrm, cp, date, ln, ls, mv, stat. We have a working
|
chmod, chown, chrm, cp, date, ln, ls, mv, stat. We have a working
|
||||||
shell with some functionality missing. We have a working filesystem and
|
(replacement) shell. We have a working filesystem and we can now boot
|
||||||
we can now boot the kernel, launch init, login, get to a shell prompt and
|
the kernel, launch init, login, get to a shell prompt and run the
|
||||||
run the utilities.
|
utilities.
|
||||||
|
|
||||||
Things to do: bring the
|
Things to do: bring the
|
||||||
system fully up on a PDP-7 system, fix any bugs and document everything.
|
system fully up on a PDP-7 system, fix any bugs and document everything.
|
||||||
We have a [real PDP-7](http://physics.uoregon.edu/outreach/movies/pdplives/)
|
We have a [real PDP-7](http://physics.uoregon.edu/outreach/movies/pdplives/)
|
||||||
and [SimH](http://simh.trailing-edge.com/) as target platforms.
|
and [SimH](http://simh.trailing-edge.com/) as target platforms.
|
||||||
|
|
||||||
### October 2019
|
|
||||||
|
|
||||||
A second notebook with missing sources has been
|
|
||||||
discovered and scanned. New files are being added to the scans
|
|
||||||
directory as they are typed in!
|
|
||||||
|
|
||||||
## Building pdp7-unix
|
## Building pdp7-unix
|
||||||
|
|
||||||
pdp7-unix requires [Perl5](https://www.perl.org/) to build.
|
pdp7-unix requires [Perl5](https://www.perl.org/) to build,
|
||||||
|
plus the perl DateTime package (debian/Ubuntu libtimedate-perl).
|
||||||
|
|
||||||
To compile it:
|
To compile it:
|
||||||
|
|
||||||
@@ -83,9 +88,9 @@ G2IN devno=43-44
|
|||||||
|
|
||||||
login: ken
|
login: ken
|
||||||
password: ken
|
password: ken
|
||||||
@ ln dd ken .
|
|
||||||
@ ls
|
@ ls
|
||||||
dd
|
dd
|
||||||
|
..
|
||||||
system
|
system
|
||||||
sop.s
|
sop.s
|
||||||
s1.s
|
s1.s
|
||||||
@@ -99,7 +104,6 @@ s8.s
|
|||||||
maksys.s
|
maksys.s
|
||||||
trysys.s
|
trysys.s
|
||||||
sys.rc
|
sys.rc
|
||||||
.
|
|
||||||
@ ls system
|
@ ls system
|
||||||
dd
|
dd
|
||||||
ttyin
|
ttyin
|
||||||
@@ -160,11 +164,6 @@ source code. Everything that didn't come from the scanned files is GPLv3.
|
|||||||
* /src/other holds PDP-7 source code which did not come from the scanned files
|
* /src/other holds PDP-7 source code which did not come from the scanned files
|
||||||
* /tools holds the source for the tools written to assist the project
|
* /tools holds the source for the tools written to assist the project
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
pdp7-unix is under the [GPLv3](LICENSE)
|
|
||||||
|
|
||||||
|
|
||||||
## Mailing List
|
## Mailing List
|
||||||
|
|
||||||
We have a
|
We have a
|
||||||
|
|||||||
+122
-159
@@ -8,7 +8,7 @@ ASARGS=--format=ptr
|
|||||||
MKFS=../tools/mkfs7
|
MKFS=../tools/mkfs7
|
||||||
A7OUT=../tools/a7out
|
A7OUT=../tools/a7out
|
||||||
FSCK=../tools/fsck7
|
FSCK=../tools/fsck7
|
||||||
CCARGS=-Wno-multichar
|
BFLAGS=-Wno-multichar -Wno-implicit
|
||||||
PDP7=pdp7
|
PDP7=pdp7
|
||||||
|
|
||||||
# source dirs
|
# source dirs
|
||||||
@@ -26,19 +26,12 @@ BINARIES=../binaries/
|
|||||||
|
|
||||||
all: cmd others a.out boot.rim image.fs
|
all: cmd others a.out boot.rim image.fs
|
||||||
|
|
||||||
# Make alternative everything: no dd but . and ..
|
|
||||||
alt: altcmd altothers boot.rim alt/a.out alt/image.fs
|
|
||||||
|
|
||||||
# The run rule has no dependencies so that the system can be booted easily
|
# The run rule has no dependencies so that the system can be booted easily
|
||||||
# and frequently with make run. However, you have to manually make all first!
|
# and frequently with make run. However, you have to manually make all first!
|
||||||
run:
|
run:
|
||||||
$(PDP7) unixv0.simh
|
$(PDP7) unixv0.simh
|
||||||
|
|
||||||
# Alternative run, use the alt/image.fs
|
dist: all
|
||||||
altrun:
|
|
||||||
$(PDP7) alt/unixv0.simh
|
|
||||||
|
|
||||||
dist: all alt
|
|
||||||
mkdir -p $(BINARIES)
|
mkdir -p $(BINARIES)
|
||||||
mkdir -p $(BINARIES)/orig
|
mkdir -p $(BINARIES)/orig
|
||||||
mkdir -p $(BINARIES)/alt
|
mkdir -p $(BINARIES)/alt
|
||||||
@@ -46,45 +39,31 @@ dist: all alt
|
|||||||
cp boot.rim $(BINARIES)/orig
|
cp boot.rim $(BINARIES)/orig
|
||||||
cp a.out $(BINARIES)/orig
|
cp a.out $(BINARIES)/orig
|
||||||
cp unixv0.simh $(BINARIES)/orig
|
cp unixv0.simh $(BINARIES)/orig
|
||||||
cp alt/image.fs $(BINARIES)/alt
|
|
||||||
cp alt/a.out $(BINARIES)/alt
|
|
||||||
cp alt/unixv0.simh $(BINARIES)/alt
|
|
||||||
|
|
||||||
# Warm boot Unix kernel: boots into init and a login prompt
|
|
||||||
a.out:
|
|
||||||
$(AS) -f ptr -o a.out $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s
|
|
||||||
$(AS) -n -f list -o a.lst $(SYSSRC)/sop.s $(SYSSRC)/s[1-8].s
|
|
||||||
|
|
||||||
# Alternative kernel: no dd, but . and ..
|
|
||||||
alt/a.out:
|
|
||||||
$(AS) -f ptr -o alt/a.out $(SYSSRC)/sop.s $(SYSSRC)/s1.s \
|
|
||||||
$(ALTSRC)/s2/s2.s $(SYSSRC)/s[3-8].s
|
|
||||||
$(AS) -n -f list -o alt/a.lst $(SYSSRC)/sop.s $(SYSSRC)/s1.s \
|
|
||||||
$(ALTSRC)/s2/s2.s $(SYSSRC)/s[3-8].s
|
|
||||||
|
|
||||||
# Phil's bootstrap code
|
# Phil's bootstrap code
|
||||||
boot.rim: $(SYSSRC)/sop.s $(OTHERSRC)/pbboot.s
|
boot.rim: $(SYSSRC)/sop.s $(OTHERSRC)/pbboot.s
|
||||||
$(AS) -f rim -o boot.rim $(SYSSRC)/sop.s $(OTHERSRC)/pbboot.s
|
$(AS) -f rim -o boot.rim $(SYSSRC)/sop.s $(OTHERSRC)/pbboot.s
|
||||||
|
|
||||||
|
# Warm boot Unix kernel: boots into init and a login prompt
|
||||||
|
SYS_FILES=$(SYSSRC)/sop.s $(sort $(wildcard $(SYSSRC)/s[1-8].s))
|
||||||
|
a.out: $(SYS_FILES)
|
||||||
|
$(AS) -f ptr -o a.out $(SYS_FILES)
|
||||||
|
$(AS) -n -f list -o a.lst $(SYS_FILES)
|
||||||
|
|
||||||
# Cold boot Unix kernel: attempts to build a minimal filesystem.
|
# Cold boot Unix kernel: attempts to build a minimal filesystem.
|
||||||
# Don't use this one!
|
# Don't use this one!
|
||||||
coldboot:
|
COLD_FILES=$(SYS_FILES) $(SYSSRC)/s9.s
|
||||||
$(AS) -f rim -o boot.rim $(SYSSRC)/sop.s $(SYSSRC)/s[1-9].s
|
coldboot.rim: $(COLD_FILES)
|
||||||
$(AS) -n -f list -o a.lst $(SYSSRC)/sop.s $(SYSSRC)/s[1-9].s
|
$(AS) -f rim -o coldboot.rim $(COLD_FILES)
|
||||||
|
$(AS) -n -f list -o coldboot.lst $(COLD_FILES)
|
||||||
|
|
||||||
# Filesystem image
|
# Filesystem image
|
||||||
image.fs: cmd others
|
image.fs: cmd others
|
||||||
$(MKFS) -k a.out proto
|
$(MKFS) -k a.out proto
|
||||||
$(FSCK) image.fs
|
$(FSCK) image.fs
|
||||||
|
|
||||||
# Alternate filesystem image: . and .. but no dd
|
|
||||||
alt/image.fs: altcmd altothers
|
|
||||||
$(MKFS) -1 -2 -3 -o alt/image.fs -k alt/a.out alt/proto
|
|
||||||
$(FSCK) -3 alt/image.fs
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f boot.rim image.fs a.lst n.out a.out
|
rm -f boot.rim image.fs a.lst n.out a.out
|
||||||
rm -f alt/image.fs alt/a.out alt/a.lst
|
|
||||||
rm -rf $(BINDIR) $(TESTDIR)
|
rm -rf $(BINDIR) $(TESTDIR)
|
||||||
rm -rf $(BINARIES)
|
rm -rf $(BINARIES)
|
||||||
|
|
||||||
@@ -92,22 +71,56 @@ dirs:
|
|||||||
mkdir -p $(BINDIR)
|
mkdir -p $(BINDIR)
|
||||||
|
|
||||||
# The commands that came from the original scans
|
# The commands that came from the original scans
|
||||||
cmd: dirs $(BINDIR)/as $(BINDIR)/cat $(BINDIR)/check $(BINDIR)/chmod \
|
cmd: dirs \
|
||||||
$(BINDIR)/chown $(BINDIR)/chrm $(BINDIR)/cp $(BINDIR)/ds \
|
$(BINDIR)/adm \
|
||||||
$(BINDIR)/dskres $(BINDIR)/dsksav $(BINDIR)/ed $(BINDIR)/init \
|
$(BINDIR)/apr \
|
||||||
$(BINDIR)/db $(BINDIR)/nstat $(BINDIR)/tm $(BINDIR)/dsw $(BINDIR)/apr \
|
$(BINDIR)/as \
|
||||||
$(BINDIR)/cas $(BINDIR)/rm $(BINDIR)/rn $(BINDIR)/pd $(BINDIR)/nm \
|
$(BINDIR)/cas \
|
||||||
$(BINDIR)/roff $(BINDIR)/p $(BINDIR)/apr $(BINDIR)/salv $(BINDIR)/moo \
|
$(BINDIR)/cat \
|
||||||
$(BINDIR)/nsh $(BINDIR)/nls $(BINDIR)/nstat $(BINDIR)/un $(BINDIR)/adm
|
$(BINDIR)/check \
|
||||||
|
$(BINDIR)/chmod \
|
||||||
|
$(BINDIR)/chown \
|
||||||
|
$(BINDIR)/chrm \
|
||||||
|
$(BINDIR)/cp \
|
||||||
|
$(BINDIR)/db \
|
||||||
|
$(BINDIR)/ds \
|
||||||
|
$(BINDIR)/dskres \
|
||||||
|
$(BINDIR)/dsksav \
|
||||||
|
$(BINDIR)/dsw \
|
||||||
|
$(BINDIR)/ed \
|
||||||
|
$(BINDIR)/init \
|
||||||
|
$(BINDIR)/ln \
|
||||||
|
$(BINDIR)/ls \
|
||||||
|
$(BINDIR)/moo \
|
||||||
|
$(BINDIR)/nm \
|
||||||
|
$(BINDIR)/p \
|
||||||
|
$(BINDIR)/rm \
|
||||||
|
$(BINDIR)/rn \
|
||||||
|
$(BINDIR)/roff \
|
||||||
|
$(BINDIR)/salv \
|
||||||
|
$(BINDIR)/sh \
|
||||||
|
$(BINDIR)/stat \
|
||||||
|
$(BINDIR)/tm \
|
||||||
|
$(BINDIR)/ttt \
|
||||||
|
$(BINDIR)/un
|
||||||
|
|
||||||
# Alternate commands: no dd, but . and ..
|
# -- compile errors
|
||||||
altcmd: dirs $(BINDIR)/as $(BINDIR)/cat $(BINDIR)/check $(BINDIR)/chmod \
|
$(BINDIR)/adm: $(CMDSRC)/adm.s
|
||||||
$(BINDIR)/chown $(BINDIR)/altchrm $(BINDIR)/cp $(BINDIR)/ds \
|
$(AS) $(ASARGS) -o $(BINDIR)/adm $(CMDSRC)/adm.s
|
||||||
$(BINDIR)/ed $(BINDIR)/altinit $(BINDIR)/altmkdir
|
|
||||||
|
$(BINDIR)/apr: $(CMDSRC)/apr.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/apr $(CMDSRC)/apr.s
|
||||||
|
|
||||||
$(BINDIR)/as: $(CMDSRC)/as.s
|
$(BINDIR)/as: $(CMDSRC)/as.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/as $(CMDSRC)/as.s
|
$(AS) $(ASARGS) -o $(BINDIR)/as $(CMDSRC)/as.s
|
||||||
|
|
||||||
|
# NOT the B compiler!
|
||||||
|
$(BINDIR)/bc: $(CMDSRC)/bc.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/bcx $(CMDSRC)/bc.s
|
||||||
|
|
||||||
|
$(BINDIR)/cas: $(CMDSRC)/cas.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/cas $(CMDSRC)/cas.s
|
||||||
|
|
||||||
$(BINDIR)/cat: $(CMDSRC)/cat.s
|
$(BINDIR)/cat: $(CMDSRC)/cat.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/cat $(CMDSRC)/cat.s
|
$(AS) $(ASARGS) -o $(BINDIR)/cat $(CMDSRC)/cat.s
|
||||||
|
|
||||||
@@ -123,20 +136,29 @@ $(BINDIR)/chown: $(CMDSRC)/chown.s
|
|||||||
$(BINDIR)/chrm: $(CMDSRC)/chrm.s
|
$(BINDIR)/chrm: $(CMDSRC)/chrm.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/chrm $(CMDSRC)/chrm.s
|
$(AS) $(ASARGS) -o $(BINDIR)/chrm $(CMDSRC)/chrm.s
|
||||||
|
|
||||||
$(BINDIR)/altchrm: $(ALTSRC)/chrm.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/altchrm $(ALTSRC)/chrm.s
|
|
||||||
|
|
||||||
$(BINDIR)/cp: $(CMDSRC)/cp.s
|
$(BINDIR)/cp: $(CMDSRC)/cp.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/cp $(CMDSRC)/cp.s
|
$(AS) $(ASARGS) -o $(BINDIR)/cp $(CMDSRC)/cp.s
|
||||||
|
|
||||||
|
$(BINDIR)/db: $(CMDSRC)/db.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/db $(CMDSRC)/db.s
|
||||||
|
|
||||||
|
# -- compile errors
|
||||||
|
$(BINDIR)/dmabs: $(CMDSRC)/dmabs.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/dmabs $(CMDSRC)/dmabs.s
|
||||||
|
|
||||||
$(BINDIR)/ds: $(CMDSRC)/ds.s
|
$(BINDIR)/ds: $(CMDSRC)/ds.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/ds $(CMDSRC)/ds.s
|
$(AS) $(ASARGS) -o $(BINDIR)/ds $(CMDSRC)/ds.s
|
||||||
|
|
||||||
$(BINDIR)/dskres: $(CMDSRC)/dskres.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
|
$(BINDIR)/dsw: $(CMDSRC)/dsw.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/dskres $(CMDSRC)/dskres.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
|
$(AS) $(ASARGS) -o $(BINDIR)/dsw $(CMDSRC)/dsw.s
|
||||||
|
|
||||||
$(BINDIR)/dsksav: $(CMDSRC)/dsksav.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
|
DSKRES=$(CMDSRC)/dskres.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/dsksav $(CMDSRC)/dsksav.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
|
$(BINDIR)/dskres: $(DSKRES)
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/dskres $(DSKRES)
|
||||||
|
|
||||||
|
DSKSAV=$(CMDSRC)/dsksav.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
|
||||||
|
$(BINDIR)/dsksav: $(DSKSAV)
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/dsksav $(DSKSAV)
|
||||||
|
|
||||||
$(BINDIR)/ed: $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
|
$(BINDIR)/ed: $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/ed $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
|
$(AS) $(ASARGS) -o $(BINDIR)/ed $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
|
||||||
@@ -144,133 +166,76 @@ $(BINDIR)/ed: $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
|
|||||||
$(BINDIR)/init: $(CMDSRC)/init.s
|
$(BINDIR)/init: $(CMDSRC)/init.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/init $(CMDSRC)/init.s
|
$(AS) $(ASARGS) -o $(BINDIR)/init $(CMDSRC)/init.s
|
||||||
|
|
||||||
$(BINDIR)/db: $(CMDSRC)/db.s
|
$(BINDIR)/ln: $(CMDSRC)/ln.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/db $(CMDSRC)/db.s
|
$(AS) $(ASARGS) -o $(BINDIR)/ln $(CMDSRC)/ln.s
|
||||||
|
|
||||||
# -- new stat from the scans
|
$(BINDIR)/ls: $(CMDSRC)/ls.s
|
||||||
$(BINDIR)/nstat: $(CMDSRC)/stat.s
|
$(AS) $(ASARGS) -o $(BINDIR)/ls $(CMDSRC)/ls.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/nstat $(CMDSRC)/stat.s
|
|
||||||
|
|
||||||
$(BINDIR)/tm: $(CMDSRC)/tm.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/tm $(CMDSRC)/tm.s
|
|
||||||
|
|
||||||
$(BINDIR)/cas: $(CMDSRC)/cas.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/cas $(CMDSRC)/cas.s
|
|
||||||
|
|
||||||
# -- compile errors
|
|
||||||
$(BINDIR)/dmabs: $(CMDSRC)/dmabs.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/dmabs $(CMDSRC)/dmabs.s
|
|
||||||
|
|
||||||
# -- new bc from the scans
|
|
||||||
$(BINDIR)/nbc: $(CMDSRC)/bc.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/nbc $(CMDSRC)/bc.s
|
|
||||||
|
|
||||||
$(BINDIR)/dsw: $(CMDSRC)/dsw.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/dsw $(CMDSRC)/dsw.s
|
|
||||||
|
|
||||||
$(BINDIR)/apr: $(CMDSRC)/apr.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/apr $(CMDSRC)/apr.s
|
|
||||||
|
|
||||||
# -- compile errors
|
|
||||||
$(BINDIR)/adm: $(CMDSRC)/adm.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/adm $(CMDSRC)/adm.s
|
|
||||||
|
|
||||||
# -- new sh from the scans
|
|
||||||
$(BINDIR)/nsh: $(CMDSRC)/sh.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/nsh $(CMDSRC)/sh.s
|
|
||||||
|
|
||||||
$(BINDIR)/rn: $(CMDSRC)/rn.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/rn $(CMDSRC)/rn.s
|
|
||||||
|
|
||||||
$(BINDIR)/rm: $(CMDSRC)/rm.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/rm $(CMDSRC)/rm.s
|
|
||||||
|
|
||||||
$(BINDIR)/pd: $(CMDSRC)/pd.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/pd $(CMDSRC)/pd.s
|
|
||||||
|
|
||||||
# -- new ls from the scans
|
|
||||||
$(BINDIR)/nls: $(CMDSRC)/ls.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/nls $(CMDSRC)/ls.s
|
|
||||||
|
|
||||||
$(BINDIR)/nm: $(CMDSRC)/nm.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/nm $(CMDSRC)/nm.s
|
|
||||||
|
|
||||||
$(BINDIR)/roff: $(CMDSRC)/roff.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/roff $(CMDSRC)/roff.s
|
|
||||||
|
|
||||||
$(BINDIR)/p: $(CMDSRC)/p1.s $(CMDSRC)/p2.s $(CMDSRC)/p3.s $(CMDSRC)/p4.s $(CMDSRC)/p5.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/p $(CMDSRC)/p1.s $(CMDSRC)/p2.s $(CMDSRC)/p3.s $(CMDSRC)/p4.s $(CMDSRC)/p5.s
|
|
||||||
|
|
||||||
$(BINDIR)/salv: $(CMDSRC)/salv.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/salv $(CMDSRC)/salv.s
|
|
||||||
|
|
||||||
$(BINDIR)/moo: $(CMDSRC)/moo.s
|
$(BINDIR)/moo: $(CMDSRC)/moo.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/moo $(CMDSRC)/moo.s
|
$(AS) $(ASARGS) -o $(BINDIR)/moo $(CMDSRC)/moo.s
|
||||||
|
|
||||||
|
$(BINDIR)/nm: $(CMDSRC)/nm.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/nm $(CMDSRC)/nm.s
|
||||||
|
|
||||||
|
P=$(sort $(wildcard $(CMDSRC)/p[1-5].s))
|
||||||
|
$(BINDIR)/p: $(P)
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/p $(P)
|
||||||
|
|
||||||
|
# contains halt!
|
||||||
|
$(BINDIR)/pd: $(CMDSRC)/pd.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/pd $(CMDSRC)/pd.s
|
||||||
|
|
||||||
|
$(BINDIR)/rm: $(CMDSRC)/rm.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/rm $(CMDSRC)/rm.s
|
||||||
|
|
||||||
|
$(BINDIR)/rn: $(CMDSRC)/rn.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/rn $(CMDSRC)/rn.s
|
||||||
|
|
||||||
|
$(BINDIR)/roff: $(CMDSRC)/roff.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/roff $(CMDSRC)/roff.s
|
||||||
|
|
||||||
|
$(BINDIR)/salv: $(CMDSRC)/salv.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/salv $(CMDSRC)/salv.s
|
||||||
|
|
||||||
|
$(BINDIR)/sh: $(CMDSRC)/sh.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/sh $(CMDSRC)/sh.s
|
||||||
|
|
||||||
|
$(BINDIR)/stat: $(CMDSRC)/stat.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/stat $(CMDSRC)/stat.s
|
||||||
|
|
||||||
|
$(BINDIR)/tm: $(CMDSRC)/tm.s
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/tm $(CMDSRC)/tm.s
|
||||||
|
|
||||||
|
TTT=$(CMDSRC)/ttt1.s $(CMDSRC)/ttt2.s
|
||||||
|
$(BINDIR)/ttt: $(TTT)
|
||||||
|
$(AS) $(ASARGS) -o $(BINDIR)/ttt $(TTT)
|
||||||
|
|
||||||
$(BINDIR)/un: $(CMDSRC)/un.s
|
$(BINDIR)/un: $(CMDSRC)/un.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/un $(CMDSRC)/un.s
|
$(AS) $(ASARGS) -o $(BINDIR)/un $(CMDSRC)/un.s
|
||||||
|
|
||||||
# Alternative init: no dd directory
|
################
|
||||||
$(BINDIR)/altinit: $(ALTSRC)/init.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/altinit $(ALTSRC)/init.s
|
|
||||||
|
|
||||||
$(BINDIR)/altmkdir: $(ALTSRC)/wktmkdir.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/altmkdir $(ALTSRC)/wktmkdir.s
|
|
||||||
|
|
||||||
|
|
||||||
# The commands that did not come from the scans
|
# The commands that did not come from the scans
|
||||||
others: dirs $(BINDIR)/sh $(BINDIR)/wktcat $(BINDIR)/wktcp $(BINDIR)/date \
|
|
||||||
$(BINDIR)/ln $(BINDIR)/ls $(BINDIR)/mv $(BINDIR)/stat $(BINDIR)/od \
|
|
||||||
$(BINDIR)/bc $(BINDIR)/lsd $(BINDIR)/lsl
|
|
||||||
|
|
||||||
# Alternative other commands: no dd, but . and ..
|
others: dirs $(BINDIR)/b $(BINDIR)/date $(BINDIR)/mv $(BINDIR)/od
|
||||||
altothers: dirs $(BINDIR)/sh $(BINDIR)/wktcat $(BINDIR)/wktcp $(BINDIR)/date \
|
|
||||||
$(BINDIR)/ln $(BINDIR)/altls $(BINDIR)/mv $(BINDIR)/stat $(BINDIR)/od
|
|
||||||
|
|
||||||
|
# PLB: B compiler -- renamed from bc to b
|
||||||
$(BINDIR)/sh: $(OTHERSRC)/pbsh.s
|
# there is a bc.s in the second set of scans!
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/sh $(OTHERSRC)/pbsh.s
|
$(BINDIR)/b: $(CMDSRC)/bl.s $(CMDSRC)/bi.s ../tools/b.c $(OTHERSRC)/b.b
|
||||||
|
$(CC) $(BFLAGS) -o b ../tools/b.c
|
||||||
$(BINDIR)/wktcat: $(OTHERSRC)/wktcat.s
|
./b $(OTHERSRC)/b.b b.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/wktcat $(OTHERSRC)/wktcat.s
|
$(AS) $(ASARGS) -o $(BINDIR)/b $(CMDSRC)/bl.s b.s $(CMDSRC)/bi.s
|
||||||
|
rm b b.s
|
||||||
$(BINDIR)/wktcp: $(OTHERSRC)/wktcp.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/wktcp $(OTHERSRC)/wktcp.s
|
|
||||||
|
|
||||||
$(BINDIR)/date: $(OTHERSRC)/wktdate.s
|
$(BINDIR)/date: $(OTHERSRC)/wktdate.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/date $(OTHERSRC)/wktdate.s
|
$(AS) $(ASARGS) -o $(BINDIR)/date $(OTHERSRC)/wktdate.s
|
||||||
|
|
||||||
$(BINDIR)/ln: $(OTHERSRC)/wktln.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/ln $(OTHERSRC)/wktln.s
|
|
||||||
|
|
||||||
$(BINDIR)/ls: $(OTHERSRC)/wktls.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/ls $(OTHERSRC)/wktls.s
|
|
||||||
|
|
||||||
$(BINDIR)/lsd: $(OTHERSRC)/pblsd.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/lsd $(OTHERSRC)/pblsd.s
|
|
||||||
|
|
||||||
$(BINDIR)/altls: $(ALTSRC)/wktls/wktls.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/altls $(ALTSRC)/wktls/wktls.s
|
|
||||||
|
|
||||||
$(BINDIR)/lsl: $(OTHERSRC)/pblsd.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/lsl $(OTHERSRC)/pblsd.s
|
|
||||||
|
|
||||||
$(BINDIR)/mv: $(OTHERSRC)/wktmv.s
|
$(BINDIR)/mv: $(OTHERSRC)/wktmv.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/mv $(OTHERSRC)/wktmv.s
|
$(AS) $(ASARGS) -o $(BINDIR)/mv $(OTHERSRC)/wktmv.s
|
||||||
|
|
||||||
$(BINDIR)/stat: $(OTHERSRC)/wktstat.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/stat $(OTHERSRC)/wktstat.s
|
|
||||||
|
|
||||||
$(BINDIR)/od: $(OTHERSRC)/wktod.s
|
$(BINDIR)/od: $(OTHERSRC)/wktod.s
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/od $(OTHERSRC)/wktod.s
|
$(AS) $(ASARGS) -o $(BINDIR)/od $(OTHERSRC)/wktod.s
|
||||||
|
|
||||||
# B compiler
|
|
||||||
$(BINDIR)/bc: $(CMDSRC)/bl.s $(CMDSRC)/bi.s ../tools/b.c $(OTHERSRC)/b.b
|
|
||||||
$(CC) $(CCARGS) -o b ../tools/b.c
|
|
||||||
./b $(OTHERSRC)/b.b b.s
|
|
||||||
$(AS) $(ASARGS) -o $(BINDIR)/bc $(CMDSRC)/bl.s b.s $(CMDSRC)/bi.s
|
|
||||||
rm b b.s
|
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
mkdir -p $(TESTDIR)
|
mkdir -p $(TESTDIR)
|
||||||
$(AS) $(ASARGS) -o $(TESTDIR)/decimal_out $(TESTSRC)/decimal_out.s
|
$(AS) $(ASARGS) -o $(TESTDIR)/decimal_out $(TESTSRC)/decimal_out.s
|
||||||
@@ -285,5 +250,3 @@ runtests: tests
|
|||||||
$(A7OUT) $(TESTDIR)/octal_test
|
$(A7OUT) $(TESTDIR)/octal_test
|
||||||
# $(A7OUT) $(TESTDIR)/testmul
|
# $(A7OUT) $(TESTDIR)/testmul
|
||||||
# $(A7OUT) $(TESTDIR)/write_test
|
# $(A7OUT) $(TESTDIR)/write_test
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -1,10 +1,11 @@
|
|||||||
Here is how to compile and run hello.b:
|
Here is how to compile and run hello.b:
|
||||||
|
|
||||||
@ bc hello.b hello.s
|
@ b hello.b hello.s
|
||||||
@ as ops.s bl.s hello.s bi.s
|
@ ln dmr op.s
|
||||||
|
@ as op.s bl.s hello.s bi.s
|
||||||
I
|
I
|
||||||
II
|
II
|
||||||
ops.s
|
op.s
|
||||||
bl.s
|
bl.s
|
||||||
hello.s
|
hello.s
|
||||||
bi.s
|
bi.s
|
||||||
|
|||||||
+4
-2
@@ -1,3 +1,5 @@
|
|||||||
system:system:system:777777
|
system:system:system:777777
|
||||||
ken:ken:ken:12
|
ken:ken:ken:10
|
||||||
dmr:dmr:dmr:14
|
dmr:dmr:dmr:11
|
||||||
|
bwk:bwk:bwk:12
|
||||||
|
doug:doug:doug:14
|
||||||
|
|||||||
+7
-7
@@ -1,8 +1,8 @@
|
|||||||
chrm ken ops.s
|
rm op.s
|
||||||
ln dmr ops.s ops.s
|
link dmr op.s
|
||||||
as sop.s ops.s maksys.s
|
as sop.s op.s maksys.s
|
||||||
mv a.out maksys
|
rn a.out maksys
|
||||||
as sop.s ops.s trysys.s
|
as sop.s op.s trysys.s
|
||||||
mv a.out trysys
|
rn a.out trysys
|
||||||
chrm ken ops.s
|
rm op.s
|
||||||
as sop.s s1.s s2.s s3.s s4.s s5.s s6.s s7.s s8.s
|
as sop.s s1.s s2.s s3.s s4.s s5.s s6.s s7.s s8.s
|
||||||
|
|||||||
+28
-22
@@ -21,9 +21,11 @@ dd drwr- -1 4
|
|||||||
display irwr- -1 12
|
display irwr- -1 12
|
||||||
pptout irwr- -1 13
|
pptout irwr- -1 13
|
||||||
adm frwr- -1 bin/adm
|
adm frwr- -1 bin/adm
|
||||||
|
password frw-- -1 fs/password
|
||||||
|
adm frwr- -1 bin/adm
|
||||||
apr frwr- -1 bin/apr
|
apr frwr- -1 bin/apr
|
||||||
as frwr- -1 bin/as
|
as frwr- -1 bin/as
|
||||||
bc frwr- -1 bin/bc
|
b frwr- -1 bin/b
|
||||||
cas frwr- -1 bin/cas
|
cas frwr- -1 bin/cas
|
||||||
cat frwr- -1 bin/cat
|
cat frwr- -1 bin/cat
|
||||||
check frwr- -1 bin/check
|
check frwr- -1 bin/check
|
||||||
@@ -40,35 +42,25 @@ dd drwr- -1 4
|
|||||||
ed frwr- -1 bin/ed
|
ed frwr- -1 bin/ed
|
||||||
init frwr- -1 bin/init
|
init frwr- -1 bin/init
|
||||||
ln frwr- -1 bin/ln
|
ln frwr- -1 bin/ln
|
||||||
|
link l---- -1
|
||||||
ls frwr- -1 bin/ls
|
ls frwr- -1 bin/ls
|
||||||
lsd frwr- -1 bin/lsd
|
list l---- -1
|
||||||
lsl frwr- -1 bin/lsd
|
|
||||||
moo frwr- -1 bin/moo
|
moo frwr- -1 bin/moo
|
||||||
|
mv frwr- -1 bin/mv
|
||||||
nm frwr- -1 bin/nm
|
nm frwr- -1 bin/nm
|
||||||
od frwr- -1 bin/od
|
od frwr- -1 bin/od
|
||||||
p frwr- -1 bin/p
|
p frwr- -1 bin/p
|
||||||
pd frwr- -1 bin/pd
|
|
||||||
mv frwr- -1 bin/mv
|
|
||||||
password frw-- -1 fs/password
|
|
||||||
roff frwr- -1 bin/roff
|
|
||||||
rn frwr- -1 bin/rn
|
|
||||||
rm frwr- -1 bin/rm
|
rm frwr- -1 bin/rm
|
||||||
|
rn frwr- -1 bin/rn
|
||||||
|
roff frwr- -1 bin/roff
|
||||||
salv frwr- -1 bin/salv
|
salv frwr- -1 bin/salv
|
||||||
sh frwr- -1 bin/sh
|
sh frwr- -1 bin/sh
|
||||||
stat frwr- -1 bin/stat
|
stat frwr- -1 bin/stat
|
||||||
tm frwr- -1 bin/tm
|
tm frwr- -1 bin/tm
|
||||||
|
ttt frwr- -1 bin/ttt
|
||||||
|
dttt l---- -1
|
||||||
un frwr- -1 bin/un
|
un frwr- -1 bin/un
|
||||||
|
$
|
||||||
# new versions, from the scans
|
|
||||||
|
|
||||||
nsh frwr- -1 bin/nsh
|
|
||||||
nls frwr- -1 bin/nls
|
|
||||||
list l---- -1
|
|
||||||
# nbc frwr- -1 bin/nbc
|
|
||||||
nstat frwr- -1 bin/nstat
|
|
||||||
|
|
||||||
|
|
||||||
$
|
|
||||||
ken drwr- 10
|
ken drwr- 10
|
||||||
system l---- 3
|
system l---- 3
|
||||||
sop.s frwr- 10 ../src/sys/sop.s
|
sop.s frwr- 10 ../src/sys/sop.s
|
||||||
@@ -84,13 +76,27 @@ dd drwr- -1 4
|
|||||||
trysys.s frwr- 10 ../src/sys/trysys.s
|
trysys.s frwr- 10 ../src/sys/trysys.s
|
||||||
sys.rc frwr- 10 fs/sys.rc
|
sys.rc frwr- 10 fs/sys.rc
|
||||||
$
|
$
|
||||||
dmr drwr- 12
|
dmr drwr- 11
|
||||||
|
system l---- 3
|
||||||
|
as.s frwr- 11 ../src/cmd/as.s
|
||||||
|
op.s frwr- 11 ../src/cmd/op.s
|
||||||
|
$
|
||||||
|
bwk drwr- 12
|
||||||
system l---- 3
|
system l---- 3
|
||||||
as.s frwr- 12 ../src/cmd/as.s
|
|
||||||
b_readme frwr- 12 fs/b_readme
|
b_readme frwr- 12 fs/b_readme
|
||||||
bi.s frwr- 12 ../src/cmd/bi.s
|
bi.s frwr- 12 ../src/cmd/bi.s
|
||||||
bl.s frwr- 12 ../src/cmd/bl.s
|
bl.s frwr- 12 ../src/cmd/bl.s
|
||||||
db.s frwr- 12 ../src/cmd/db.s
|
db.s frwr- 12 ../src/cmd/db.s
|
||||||
hello.b frwr- 12 ../src/other/hello.b
|
hello.b frwr- 12 ../src/other/hello.b
|
||||||
ops.s frwr- 12 ../src/other/ops.s
|
$
|
||||||
|
doug drwr- 14
|
||||||
|
system l---- 3
|
||||||
|
t1.s frwr- 14 ../src/cmd/t1.s
|
||||||
|
t2.s frwr- 14 ../src/cmd/t2.s
|
||||||
|
t3.s frwr- 14 ../src/cmd/t3.s
|
||||||
|
t4.s frwr- 14 ../src/cmd/t4.s
|
||||||
|
t5.s frwr- 14 ../src/cmd/t5.s
|
||||||
|
t6.s frwr- 14 ../src/cmd/t6.s
|
||||||
|
t7.s frwr- 14 ../src/cmd/t7.s
|
||||||
|
t8.s frwr- 14 ../src/cmd/t8.s
|
||||||
$
|
$
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ set rb ena
|
|||||||
att rb image.fs
|
att rb image.fs
|
||||||
|
|
||||||
# uncomment to TELNET in GRAPHICS-2 keyboard/display(!!)
|
# uncomment to TELNET in GRAPHICS-2 keyboard/display(!!)
|
||||||
# (requires github.com/philbudne/simh)
|
|
||||||
set g2in ena
|
set g2in ena
|
||||||
att -U g2in 12345
|
att -U g2in 12345
|
||||||
|
|
||||||
|
|||||||
+101
@@ -0,0 +1,101 @@
|
|||||||
|
"** 09-1-35.pdf page 35
|
||||||
|
" op
|
||||||
|
|
||||||
|
sys = 0020000
|
||||||
|
dac = 0040000
|
||||||
|
jms = 0100000
|
||||||
|
dzm = 0140000
|
||||||
|
lac = 0200000
|
||||||
|
xor = 0240000
|
||||||
|
add = 0300000
|
||||||
|
tad = 0340000
|
||||||
|
xct = 0400000
|
||||||
|
isz = 0440000
|
||||||
|
and = 0500000
|
||||||
|
sad = 0540000
|
||||||
|
jmp = 0600000
|
||||||
|
law = 0760000
|
||||||
|
|
||||||
|
nop = 0740000
|
||||||
|
cma = 0740001
|
||||||
|
cml = 0740002
|
||||||
|
oas = 0740004
|
||||||
|
ral = 0740010
|
||||||
|
rar = 0740020
|
||||||
|
hlt = 0740040
|
||||||
|
sma = 0740100
|
||||||
|
sza = 0740200
|
||||||
|
snl = 0740400
|
||||||
|
skp = 0741000
|
||||||
|
spa = 0741100
|
||||||
|
sna = 0741200
|
||||||
|
szl = 0741400
|
||||||
|
rtl = 0742010
|
||||||
|
rtr = 0742020
|
||||||
|
cll = 0744000
|
||||||
|
stl = 0744002
|
||||||
|
rcl = 0744010
|
||||||
|
rcr = 0744020
|
||||||
|
cla = 0750000
|
||||||
|
clc = 0750001
|
||||||
|
las = 0750004
|
||||||
|
glk = 0750010
|
||||||
|
lrs = 0640500
|
||||||
|
lrss= 0660500
|
||||||
|
lls = 0640600
|
||||||
|
llss= 0660600
|
||||||
|
als = 0640700
|
||||||
|
alss= 0660700
|
||||||
|
norm= 0640444
|
||||||
|
norms=0660444
|
||||||
|
mul = 0653122
|
||||||
|
muls= 0657122
|
||||||
|
div = 0640323
|
||||||
|
divs= 0644323
|
||||||
|
idiv= 0653323
|
||||||
|
idivs=0657323
|
||||||
|
frdiv = 0650323
|
||||||
|
frdivs = 0654323
|
||||||
|
lacq = 0641002
|
||||||
|
lacs = 0641001
|
||||||
|
clq = 0650000
|
||||||
|
ads = 0644000
|
||||||
|
gsm = 0664000
|
||||||
|
|
||||||
|
"** 10-36-55.pdf page 1
|
||||||
|
osc = 0640001
|
||||||
|
omq = 0640002
|
||||||
|
otq = 0642000
|
||||||
|
cmq = 0640004
|
||||||
|
lmq = 0652000
|
||||||
|
ecla = 0641000
|
||||||
|
|
||||||
|
i = 020000
|
||||||
|
|
||||||
|
save = 1
|
||||||
|
getuid = 2
|
||||||
|
open = 3
|
||||||
|
read = 4
|
||||||
|
write = 5
|
||||||
|
creat = 6
|
||||||
|
seek = 7
|
||||||
|
tell = 8
|
||||||
|
close = 9
|
||||||
|
link = 10
|
||||||
|
unlink = 11
|
||||||
|
setuid = 12
|
||||||
|
rename = 13
|
||||||
|
exit = 14
|
||||||
|
time = 15
|
||||||
|
intrp = 16
|
||||||
|
chdir = 17
|
||||||
|
chmode = 18
|
||||||
|
chowner = 19
|
||||||
|
sysloc = 21
|
||||||
|
capt = 23
|
||||||
|
rele = 24
|
||||||
|
status = 25
|
||||||
|
sleep = 26
|
||||||
|
smes = 27
|
||||||
|
rmes = 28
|
||||||
|
fork = 29
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
"** 13-120-147.pdf page 5
|
||||||
|
t=0
|
||||||
|
main:
|
||||||
|
lac 017777 i
|
||||||
|
sad d4
|
||||||
|
jmp 2f
|
||||||
|
sad d8
|
||||||
|
jmp 1f
|
||||||
|
law 9
|
||||||
|
tad 017777
|
||||||
|
dac 0f
|
||||||
|
law 017
|
||||||
|
sys creat;0:0
|
||||||
|
dac output
|
||||||
|
1:law 5
|
||||||
|
tad 017777
|
||||||
|
dac 0f
|
||||||
|
sys open;0:0;0
|
||||||
|
dac input
|
||||||
|
spa
|
||||||
|
sys exit
|
||||||
|
2:
|
||||||
|
jms advance; jmp 1f
|
||||||
|
jmp rinterp
|
||||||
|
|
||||||
|
0:lac 2f
|
||||||
|
jms obuild
|
||||||
|
1:lac owrite
|
||||||
|
spa
|
||||||
|
jmp 0b
|
||||||
|
jms oflush
|
||||||
|
las
|
||||||
|
spa
|
||||||
|
sys exit
|
||||||
|
sys save
|
||||||
|
2:o777
|
||||||
|
|
||||||
|
|
||||||
|
"special machine language code
|
||||||
|
|
||||||
|
"puts out and octal strin g from symtab entry
|
||||||
|
|
||||||
|
symoct:
|
||||||
|
lac equ
|
||||||
|
add equbot
|
||||||
|
dac 9f+t
|
||||||
|
lac 1f
|
||||||
|
jms twoktab; lac 9f+t i
|
||||||
|
1:gf .+1 x
|
||||||
|
lac ii
|
||||||
|
dac 8
|
||||||
|
lac 8 i
|
||||||
|
add symbot
|
||||||
|
dac 9f+t
|
||||||
|
|
||||||
|
2:lac 9f+t i
|
||||||
|
jms putoct
|
||||||
|
lac onenl
|
||||||
|
jms obuild
|
||||||
|
lac 9f+t i
|
||||||
|
and o600600
|
||||||
|
sza "skip unless word contained eof (0777)
|
||||||
|
jmp ggoon
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 6
|
||||||
|
isz 9f+t
|
||||||
|
jmp 2b
|
||||||
|
t=t+1
|
||||||
|
o600600:0600600
|
||||||
+411
@@ -0,0 +1,411 @@
|
|||||||
|
"** 13-120-147.pdf page 7
|
||||||
|
" recognition stack frame advance
|
||||||
|
|
||||||
|
advance:0
|
||||||
|
lac frame
|
||||||
|
dac 8
|
||||||
|
lac advance i
|
||||||
|
dac 8 i
|
||||||
|
lac ii
|
||||||
|
dac 8 i
|
||||||
|
lac ignore
|
||||||
|
dac 8 i
|
||||||
|
lac j
|
||||||
|
dac 8 i
|
||||||
|
lac k
|
||||||
|
dac 8 i
|
||||||
|
lac frame
|
||||||
|
dac nframe i
|
||||||
|
lac nframe
|
||||||
|
dac frame
|
||||||
|
add dffrmsz
|
||||||
|
dac nframe
|
||||||
|
dac nframe
|
||||||
|
jms between; add rbot; add rtop
|
||||||
|
jms halt
|
||||||
|
isz advance
|
||||||
|
jmp advance i
|
||||||
|
|
||||||
|
retreat:
|
||||||
|
dzm junk
|
||||||
|
lac gflag
|
||||||
|
sza
|
||||||
|
jmp 1f
|
||||||
|
jms bundlep
|
||||||
|
dac junk
|
||||||
|
1:lac frame
|
||||||
|
dac nframe
|
||||||
|
lac frame i
|
||||||
|
dac frame
|
||||||
|
dac 8
|
||||||
|
lac 8 i
|
||||||
|
dac 3f "retrun address
|
||||||
|
lac 8 i
|
||||||
|
dac ii
|
||||||
|
lac 8 i
|
||||||
|
dac ignore
|
||||||
|
lac fflag
|
||||||
|
sna
|
||||||
|
jmp 2f
|
||||||
|
lac 8 i "restore j and k on failure
|
||||||
|
dac j
|
||||||
|
lac 8 i
|
||||||
|
dac k
|
||||||
|
2:lac junk
|
||||||
|
sna
|
||||||
|
jmp 3f
|
||||||
|
dac nframe i "stass reslts
|
||||||
|
isz nframe
|
||||||
|
3:jmp
|
||||||
|
|
||||||
|
" bundle up results and return single pointer to them in ac
|
||||||
|
" return 0 if no results
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 8
|
||||||
|
bundlep:0
|
||||||
|
lac fflag
|
||||||
|
sza
|
||||||
|
jmp 2f "no results on failure
|
||||||
|
jms nframe0
|
||||||
|
dac 9f+t
|
||||||
|
cma
|
||||||
|
tad nframe
|
||||||
|
cma
|
||||||
|
dac 9f+t+1
|
||||||
|
sma
|
||||||
|
jmp 2f
|
||||||
|
sad m1
|
||||||
|
jmp 3f "only one result, no bundling necessary
|
||||||
|
lac 9f+t
|
||||||
|
tad m1
|
||||||
|
dac 8
|
||||||
|
|
||||||
|
1:lac 8 i
|
||||||
|
jms kput
|
||||||
|
isz 9f+t+1
|
||||||
|
jmp 1b
|
||||||
|
lac k "make up result pointer
|
||||||
|
add l.gk
|
||||||
|
jmp bundlep i
|
||||||
|
|
||||||
|
2:cla
|
||||||
|
jmp bundlep i
|
||||||
|
3:lac 9f+t i
|
||||||
|
jmp bundlep i
|
||||||
|
t=t+1 "where to find results
|
||||||
|
t=t+1 "negative of result count
|
||||||
|
|
||||||
|
" the main interpreter loop
|
||||||
|
" locate original value of nframe for present stack level.
|
||||||
|
nframe0:0
|
||||||
|
jms s1get; add d.ii
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
and opmask
|
||||||
|
sad l.rw
|
||||||
|
jmp 1f
|
||||||
|
lac refrsz
|
||||||
|
jmp 2f
|
||||||
|
1:lac junk i
|
||||||
|
and o17777
|
||||||
|
2:add frame
|
||||||
|
jmp nframe0 i
|
||||||
|
|
||||||
|
halt:0
|
||||||
|
lac 1f
|
||||||
|
jms obuild
|
||||||
|
lac halt
|
||||||
|
jms putoct
|
||||||
|
lac onenl
|
||||||
|
jms obuild
|
||||||
|
xct rstack+1
|
||||||
|
1:.+1;012077;end
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 9
|
||||||
|
rinterp:
|
||||||
|
las "trace check
|
||||||
|
and d5
|
||||||
|
sna
|
||||||
|
jmp .+3
|
||||||
|
lac bugr
|
||||||
|
jms bug
|
||||||
|
|
||||||
|
lac fflag
|
||||||
|
ral
|
||||||
|
lac ii i
|
||||||
|
and opmask
|
||||||
|
sad l.ra
|
||||||
|
jmp rera
|
||||||
|
sad l.rb
|
||||||
|
jmp rerb
|
||||||
|
szl
|
||||||
|
jmp retreat
|
||||||
|
lrs 14
|
||||||
|
and o17
|
||||||
|
add rbranch
|
||||||
|
dac .+1
|
||||||
|
jmp
|
||||||
|
|
||||||
|
rbranch:
|
||||||
|
jmp .+1 i
|
||||||
|
reno
|
||||||
|
rerx
|
||||||
|
rerc
|
||||||
|
regc
|
||||||
|
rerf
|
||||||
|
rerw
|
||||||
|
rera
|
||||||
|
reuu
|
||||||
|
rero
|
||||||
|
rerm
|
||||||
|
rers
|
||||||
|
rerv
|
||||||
|
reuu
|
||||||
|
reuu
|
||||||
|
reuu
|
||||||
|
reuu
|
||||||
|
|
||||||
|
reuu:
|
||||||
|
jms halt
|
||||||
|
|
||||||
|
rerb:
|
||||||
|
cml
|
||||||
|
rera:
|
||||||
|
dzm fflag
|
||||||
|
snl
|
||||||
|
jmp goon
|
||||||
|
jms aget
|
||||||
|
dac ii
|
||||||
|
jmp rinterp
|
||||||
|
|
||||||
|
backup:
|
||||||
|
lac jsav
|
||||||
|
dac j
|
||||||
|
nuts:
|
||||||
|
law
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 10
|
||||||
|
dac fflag
|
||||||
|
|
||||||
|
reno:
|
||||||
|
goon:
|
||||||
|
lac ii i
|
||||||
|
isz ii
|
||||||
|
and exitmask
|
||||||
|
sza
|
||||||
|
jmp retreat
|
||||||
|
jmp rinterp
|
||||||
|
|
||||||
|
|
||||||
|
rerw:
|
||||||
|
jms aget
|
||||||
|
add frame
|
||||||
|
dac nframe
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
rerc:
|
||||||
|
jms advance; jmp goon
|
||||||
|
jms aget
|
||||||
|
dac ii
|
||||||
|
jmp rinterp
|
||||||
|
|
||||||
|
|
||||||
|
gegf:
|
||||||
|
rerf:
|
||||||
|
jms aget
|
||||||
|
add ljmp
|
||||||
|
dac .+1
|
||||||
|
jmp
|
||||||
|
|
||||||
|
rerx:
|
||||||
|
lac j
|
||||||
|
dac jsav
|
||||||
|
jms aget
|
||||||
|
1:dac 9f+t
|
||||||
|
jms lchar
|
||||||
|
sad o777
|
||||||
|
jmp goon
|
||||||
|
dac 9f+t+1
|
||||||
|
jms getj
|
||||||
|
sad 9f+t+1
|
||||||
|
jmp 2f
|
||||||
|
jmp backup
|
||||||
|
2:lac 9f+t
|
||||||
|
add o400000
|
||||||
|
jmp 1b
|
||||||
|
t=t+1 "address of next comparison char
|
||||||
|
t=t+1 "character itself
|
||||||
|
|
||||||
|
aget:0
|
||||||
|
lac ii i
|
||||||
|
and o17777
|
||||||
|
jmp aget i
|
||||||
|
|
||||||
|
regc:
|
||||||
|
lac ii i
|
||||||
|
and o757777
|
||||||
|
xor exitmask
|
||||||
|
dac nframe i
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 11
|
||||||
|
isz nframe
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
kput:0
|
||||||
|
isz k
|
||||||
|
dac junk1
|
||||||
|
lac k
|
||||||
|
jms between; add d0; add kmax
|
||||||
|
jms halt
|
||||||
|
add kbot
|
||||||
|
dac junk
|
||||||
|
lac junk1
|
||||||
|
dac junk i
|
||||||
|
jmp kput i
|
||||||
|
|
||||||
|
s0get:0
|
||||||
|
lac frame
|
||||||
|
xct s0get i
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
isz s0get
|
||||||
|
jmp s0get i
|
||||||
|
|
||||||
|
s1get:0
|
||||||
|
lac frame i
|
||||||
|
xct s1get i
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
isz s1get
|
||||||
|
jmp s1get i
|
||||||
|
|
||||||
|
s0put:0
|
||||||
|
lmq
|
||||||
|
lac frame
|
||||||
|
xct s0put i
|
||||||
|
dac junk
|
||||||
|
lacq
|
||||||
|
dac junk i
|
||||||
|
isz s0put
|
||||||
|
jmp s0put i
|
||||||
|
" here is the generaion interpreter
|
||||||
|
" the k table cant move while its active
|
||||||
|
|
||||||
|
geno:
|
||||||
|
ggoon:
|
||||||
|
lac ii i
|
||||||
|
isz ii
|
||||||
|
and exitmask
|
||||||
|
sza
|
||||||
|
jmp retreat
|
||||||
|
ginterp:
|
||||||
|
las "trace check
|
||||||
|
and d6
|
||||||
|
sna
|
||||||
|
jmp .+3
|
||||||
|
lac bugg
|
||||||
|
jms bug
|
||||||
|
|
||||||
|
lac ii i
|
||||||
|
lrss 14
|
||||||
|
and o7
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 12
|
||||||
|
add gbranch
|
||||||
|
dac .+1
|
||||||
|
jmp
|
||||||
|
|
||||||
|
gbranch:
|
||||||
|
jmp .+1 i
|
||||||
|
geno
|
||||||
|
gegx
|
||||||
|
geuu
|
||||||
|
gegc
|
||||||
|
gegf
|
||||||
|
gegk
|
||||||
|
gegp
|
||||||
|
gegq
|
||||||
|
|
||||||
|
geuu:
|
||||||
|
jms halt
|
||||||
|
|
||||||
|
gegx:
|
||||||
|
lac ii i
|
||||||
|
and o417777
|
||||||
|
jms obuild
|
||||||
|
jmp ggoon
|
||||||
|
|
||||||
|
gegq:
|
||||||
|
jms advance; jmp ggoon
|
||||||
|
lac env
|
||||||
|
add d.ii
|
||||||
|
dac junk
|
||||||
|
jms aget
|
||||||
|
add junk i
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
dac ii
|
||||||
|
lac env
|
||||||
|
add d.env
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
dac env
|
||||||
|
jmp ginterp
|
||||||
|
|
||||||
|
gegp:
|
||||||
|
jms advance; jmp ggoon
|
||||||
|
lac env
|
||||||
|
add d.ii
|
||||||
|
dac junk
|
||||||
|
lac frame i
|
||||||
|
dac env
|
||||||
|
jms aget
|
||||||
|
cma
|
||||||
|
add junk i
|
||||||
|
dac ii
|
||||||
|
jmp ginterp
|
||||||
|
|
||||||
|
gegk:
|
||||||
|
lac ii i
|
||||||
|
jms aget
|
||||||
|
add kbot
|
||||||
|
dac ii
|
||||||
|
jms s0put; add d.ii
|
||||||
|
lac frame
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 13
|
||||||
|
dac env
|
||||||
|
jmp ginterp
|
||||||
|
|
||||||
|
gegc:
|
||||||
|
jms advance; jmp ggoon
|
||||||
|
jms aget
|
||||||
|
dac ii
|
||||||
|
jmp ginterp
|
||||||
|
|
||||||
|
bug:0
|
||||||
|
dac 1f+2
|
||||||
|
lac onenl
|
||||||
|
jms obuild
|
||||||
|
lac ii
|
||||||
|
jms putoct
|
||||||
|
lac ii i
|
||||||
|
lrs 14
|
||||||
|
and o17
|
||||||
|
add 1f+2
|
||||||
|
dac 1f+2
|
||||||
|
lac 1f+2 i
|
||||||
|
dac 1f+2
|
||||||
|
lac 1f
|
||||||
|
jms obuild
|
||||||
|
lac ii i
|
||||||
|
jms putoct
|
||||||
|
las
|
||||||
|
and d4
|
||||||
|
sza
|
||||||
|
jms halt
|
||||||
|
jmp bug i
|
||||||
|
|
||||||
|
1:0400000 .+1; 040; 0; 040777
|
||||||
+263
@@ -0,0 +1,263 @@
|
|||||||
|
"** 13-120-147.pdf page 14
|
||||||
|
move: 0
|
||||||
|
dac 9f+t
|
||||||
|
lac move i
|
||||||
|
1:dac 2f
|
||||||
|
lac 9f+t
|
||||||
|
jms lchar
|
||||||
|
dac 9f+t+1
|
||||||
|
jms dchar
|
||||||
|
2: 0
|
||||||
|
lac 9f+t+1
|
||||||
|
sad o777
|
||||||
|
jmp 3f
|
||||||
|
lac o400000
|
||||||
|
add 9f+t
|
||||||
|
dac 9f+t
|
||||||
|
lac o400000
|
||||||
|
add 2b
|
||||||
|
jmp 1b
|
||||||
|
|
||||||
|
3:isz move
|
||||||
|
lac 2b
|
||||||
|
jmp move i
|
||||||
|
t=t+1 "source address
|
||||||
|
t=t+1 "source character
|
||||||
|
|
||||||
|
lchar:0
|
||||||
|
dac junk
|
||||||
|
ral
|
||||||
|
lac junk i
|
||||||
|
snl
|
||||||
|
lrs 9
|
||||||
|
and o777
|
||||||
|
jmp lchar i
|
||||||
|
|
||||||
|
dchar:0
|
||||||
|
lmq
|
||||||
|
lac dchar i
|
||||||
|
dac junk
|
||||||
|
spa
|
||||||
|
jmp 1f
|
||||||
|
llss 9
|
||||||
|
lac o777
|
||||||
|
jmp .+2
|
||||||
|
1:0777000
|
||||||
|
and junk i
|
||||||
|
omq
|
||||||
|
dac junk i
|
||||||
|
isz dchar
|
||||||
|
jmp dchar i
|
||||||
|
|
||||||
|
|
||||||
|
" gets designated character from input
|
||||||
|
jget:0
|
||||||
|
1:lac j
|
||||||
|
jms cbetween; add jmin; add jmax
|
||||||
|
jmp jmore
|
||||||
|
cma
|
||||||
|
add jmin
|
||||||
|
cma
|
||||||
|
add jbot
|
||||||
|
jms lchar
|
||||||
|
jms class; add ignore
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 15
|
||||||
|
jmp jget i
|
||||||
|
lac j
|
||||||
|
add o400000
|
||||||
|
dac j
|
||||||
|
jmp 1b
|
||||||
|
|
||||||
|
" read more input - filthy code, enough to make disk &
|
||||||
|
" terminal input work. Theae only deliver full count
|
||||||
|
" except at eof or 1 word
|
||||||
|
|
||||||
|
jmore:
|
||||||
|
and o377700
|
||||||
|
dac jmin
|
||||||
|
add ljsiz
|
||||||
|
dac 9f+t
|
||||||
|
lac jmax
|
||||||
|
jms cbetween; add jmin; add 9f+t
|
||||||
|
lac jmin
|
||||||
|
dac jmax
|
||||||
|
dac 1f
|
||||||
|
cma
|
||||||
|
add jmin
|
||||||
|
cma
|
||||||
|
add jbot
|
||||||
|
dac 2f
|
||||||
|
lac input
|
||||||
|
sys seek
|
||||||
|
1:0;0
|
||||||
|
-1
|
||||||
|
dac 2f i
|
||||||
|
lac input
|
||||||
|
sys read
|
||||||
|
2:0;jsiz
|
||||||
|
sna
|
||||||
|
lac d1
|
||||||
|
add jmax
|
||||||
|
dac jmax
|
||||||
|
jmp jget+1
|
||||||
|
t=t+1
|
||||||
|
|
||||||
|
" gets next character from input
|
||||||
|
|
||||||
|
getj:0
|
||||||
|
lac j
|
||||||
|
jms jget
|
||||||
|
dac junk
|
||||||
|
lac j
|
||||||
|
add o400000
|
||||||
|
dac j
|
||||||
|
lac junk
|
||||||
|
jmp getj i
|
||||||
|
|
||||||
|
" compare two strings - assume both left justified
|
||||||
|
|
||||||
|
comp:0
|
||||||
|
dac 9f+t
|
||||||
|
lac comp i
|
||||||
|
dac 9f+t+1
|
||||||
|
isz comp
|
||||||
|
1:lac 9f+t i
|
||||||
|
sad 9f+t+1 i
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 16
|
||||||
|
jmp 3f
|
||||||
|
and 9f+t+1 i "do both start with eof?
|
||||||
|
spa
|
||||||
|
2:isz comp
|
||||||
|
jmp comp i
|
||||||
|
3:and o600600 "is there an eof?
|
||||||
|
sza
|
||||||
|
jmp 2b
|
||||||
|
isz 9f+t
|
||||||
|
isz 9f+t+1
|
||||||
|
jmp 1b
|
||||||
|
t=t+1 "address of string 1
|
||||||
|
t=t+1 "address of string 2
|
||||||
|
|
||||||
|
|
||||||
|
obuild:0
|
||||||
|
lmq
|
||||||
|
lac owrite
|
||||||
|
add obot
|
||||||
|
dac 2f
|
||||||
|
lacq
|
||||||
|
1:jms move
|
||||||
|
2:0
|
||||||
|
cma
|
||||||
|
add obot
|
||||||
|
cma
|
||||||
|
dac owrite
|
||||||
|
jms cbetween; add d0; add omax
|
||||||
|
skp
|
||||||
|
jmp obuild i
|
||||||
|
|
||||||
|
lac lochunk
|
||||||
|
jms oflush
|
||||||
|
lac obot
|
||||||
|
dac 2b
|
||||||
|
add lochunk
|
||||||
|
jmp 1b
|
||||||
|
|
||||||
|
oflush:0
|
||||||
|
dac 2f
|
||||||
|
lac obot
|
||||||
|
dac 1f
|
||||||
|
lac output
|
||||||
|
sys write
|
||||||
|
1:0
|
||||||
|
2:0
|
||||||
|
jmp oflush i
|
||||||
|
|
||||||
|
" outputs octal string from sesignated value
|
||||||
|
|
||||||
|
octal:
|
||||||
|
isz ii
|
||||||
|
lac ii i
|
||||||
|
dac 2f
|
||||||
|
lac 1f
|
||||||
|
jms twoktab
|
||||||
|
lac 2f i
|
||||||
|
|
||||||
|
1:gf geoctal x
|
||||||
|
2:0
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 17
|
||||||
|
geoctal:
|
||||||
|
lac ii
|
||||||
|
dac 8
|
||||||
|
lac 8 i
|
||||||
|
jms putoct
|
||||||
|
jmp ggoon
|
||||||
|
|
||||||
|
|
||||||
|
" converts word in ac into ocatl on output stream
|
||||||
|
|
||||||
|
putoct:0
|
||||||
|
dac 9f+t
|
||||||
|
lac 7f
|
||||||
|
jms obuild
|
||||||
|
dzm 9f+t+2
|
||||||
|
-6
|
||||||
|
dac 9f+t+1
|
||||||
|
|
||||||
|
1:lac 9f+t
|
||||||
|
cll
|
||||||
|
lrs 15
|
||||||
|
add o60
|
||||||
|
dac 8f+1
|
||||||
|
lls 18
|
||||||
|
dac 9f+t
|
||||||
|
lac 9f+t+2 "have nonzero digits been seen?
|
||||||
|
sza
|
||||||
|
jmp 2f
|
||||||
|
lac 8f+1 "no,is this nonzero?
|
||||||
|
sad o60
|
||||||
|
jmp 3f "no
|
||||||
|
2:lac 8f
|
||||||
|
jms obuild
|
||||||
|
law
|
||||||
|
dac 9f+t+2
|
||||||
|
3:isz 9f+t+1
|
||||||
|
jmp 1b
|
||||||
|
jmp putoct i
|
||||||
|
t=t+1 "value to convert
|
||||||
|
t=t+1 "digit count
|
||||||
|
t=t+1 "nonzero digit flag
|
||||||
|
7: .+1; 060777
|
||||||
|
8:0400000 .+1;0;end
|
||||||
|
|
||||||
|
|
||||||
|
eof:
|
||||||
|
lac j
|
||||||
|
dac jsav
|
||||||
|
jms jget
|
||||||
|
sad o777
|
||||||
|
jmp goon
|
||||||
|
jmp backup
|
||||||
|
class:0
|
||||||
|
dac junk1
|
||||||
|
lrss 7
|
||||||
|
sza
|
||||||
|
jmp 2f
|
||||||
|
lls 3
|
||||||
|
xct class i
|
||||||
|
isz class
|
||||||
|
dac junk
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 18
|
||||||
|
cla
|
||||||
|
llss 4
|
||||||
|
add l.llss
|
||||||
|
dac 1f
|
||||||
|
lac junk i
|
||||||
|
1:llss
|
||||||
|
spa
|
||||||
|
2:isz class
|
||||||
|
lac junk1
|
||||||
|
jmp class i
|
||||||
+112
@@ -0,0 +1,112 @@
|
|||||||
|
"** 13-120-147.pdf page 19
|
||||||
|
" put symbuf symbol into table
|
||||||
|
|
||||||
|
table:
|
||||||
|
lac equwrite
|
||||||
|
dac equ
|
||||||
|
jms between; add d0; add equmax
|
||||||
|
jms halt
|
||||||
|
add delta
|
||||||
|
dac equwrite
|
||||||
|
lac equ
|
||||||
|
add equbot
|
||||||
|
tad m1
|
||||||
|
dac 8
|
||||||
|
lac symwrite
|
||||||
|
dac 8 i
|
||||||
|
add symbot
|
||||||
|
dac 2f
|
||||||
|
lac mdelta
|
||||||
|
1:dzm 8 i
|
||||||
|
tad d1
|
||||||
|
spa
|
||||||
|
jmp 1b
|
||||||
|
lac sbbot
|
||||||
|
jms move
|
||||||
|
2:0
|
||||||
|
add o400000
|
||||||
|
cma
|
||||||
|
add symbot
|
||||||
|
cma
|
||||||
|
add o400000
|
||||||
|
and o17777
|
||||||
|
dac symwrite
|
||||||
|
jms between; add d0; add symmax
|
||||||
|
jms halt
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
" find occurrence of symbuf symbol in equtab
|
||||||
|
|
||||||
|
prev:
|
||||||
|
lac equ
|
||||||
|
jmp find+1
|
||||||
|
find:
|
||||||
|
lac equwrite
|
||||||
|
dac 9f+t
|
||||||
|
lac o777
|
||||||
|
jms sbput
|
||||||
|
lac sbbot
|
||||||
|
dac 2f
|
||||||
|
1:lac 9f+t
|
||||||
|
tad mdelta
|
||||||
|
dac 9f+t
|
||||||
|
spa
|
||||||
|
jmp nuts
|
||||||
|
add equbot
|
||||||
|
dac junk
|
||||||
|
lac junk i
|
||||||
|
add symbot
|
||||||
|
jms comp
|
||||||
|
2:0
|
||||||
|
jmp 1b
|
||||||
|
lac 9f+t
|
||||||
|
dac equ
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 20
|
||||||
|
jmp goon
|
||||||
|
t=t+1 "next equtab location to test
|
||||||
|
|
||||||
|
sbput:0
|
||||||
|
lmq
|
||||||
|
lac sbwrite
|
||||||
|
add sbbot
|
||||||
|
dac 1f
|
||||||
|
lacq
|
||||||
|
jms dchar
|
||||||
|
1:0
|
||||||
|
lac sbwrite
|
||||||
|
add o400000
|
||||||
|
dac sbwrite
|
||||||
|
jms cbetween; add d0; add sbmax
|
||||||
|
jms halt
|
||||||
|
jmp sbput i
|
||||||
|
|
||||||
|
getname:
|
||||||
|
lac equ
|
||||||
|
add equbot
|
||||||
|
dac 9f+t
|
||||||
|
lac 1f
|
||||||
|
jms twoktab; lac 9f+t i
|
||||||
|
|
||||||
|
1:gf .+1 x
|
||||||
|
lac ii
|
||||||
|
dac 8
|
||||||
|
lac 8 i
|
||||||
|
add symbot
|
||||||
|
and o17777
|
||||||
|
jms obuild
|
||||||
|
jmp ggoon
|
||||||
|
t=t+1 "equtable entry
|
||||||
|
|
||||||
|
" puts double word entries in ktab and gives
|
||||||
|
"pointer to first as result
|
||||||
|
|
||||||
|
twoktab:0
|
||||||
|
jms kput
|
||||||
|
lac l.gk
|
||||||
|
add k
|
||||||
|
dac nframe i
|
||||||
|
isz nframe
|
||||||
|
xct twoktab i
|
||||||
|
jms kput
|
||||||
|
jmp goon
|
||||||
+118
@@ -0,0 +1,118 @@
|
|||||||
|
"** 13-120-147.pdf page 21
|
||||||
|
char:
|
||||||
|
lac j
|
||||||
|
dac jsav
|
||||||
|
isz ii
|
||||||
|
jms ctest
|
||||||
|
jmp backup
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
string:
|
||||||
|
isz ii
|
||||||
|
jms ctest
|
||||||
|
jmp goon
|
||||||
|
jmp string+1
|
||||||
|
|
||||||
|
ctest:0
|
||||||
|
jms jget
|
||||||
|
jms class; add ii i
|
||||||
|
jmp ctest i
|
||||||
|
jms sbput
|
||||||
|
lac j
|
||||||
|
add o400000
|
||||||
|
dac j
|
||||||
|
isz ctest
|
||||||
|
jmp ctest i
|
||||||
|
|
||||||
|
mark:
|
||||||
|
jms jget
|
||||||
|
dzm sbwrite
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
parsedo:
|
||||||
|
isz ii
|
||||||
|
jms advance; jmp 3f
|
||||||
|
jms advance; jmp 1f
|
||||||
|
jms aget
|
||||||
|
dac ii
|
||||||
|
jmp rinterp
|
||||||
|
|
||||||
|
1:lac frame
|
||||||
|
add refrsz
|
||||||
|
dac ii
|
||||||
|
sad nframe
|
||||||
|
jmp retreat
|
||||||
|
dac gflag
|
||||||
|
lac gefrsz
|
||||||
|
dac dffrmsz
|
||||||
|
jms advance; jmp 2f
|
||||||
|
jmp ginterp
|
||||||
|
|
||||||
|
2:lac refrsz
|
||||||
|
dac dffrmsz
|
||||||
|
add frame
|
||||||
|
dac nframe
|
||||||
|
dzm gflag
|
||||||
|
jmp retreat
|
||||||
|
|
||||||
|
3:jms s0get; add d.k
|
||||||
|
dac k
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
bundle:
|
||||||
|
jms bundlep
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 22
|
||||||
|
dac 9f+t
|
||||||
|
sna
|
||||||
|
jmp goon
|
||||||
|
jms nframe0
|
||||||
|
dac nframe
|
||||||
|
lac 9f+t
|
||||||
|
dac nframe i
|
||||||
|
isz nframe
|
||||||
|
jmp goon
|
||||||
|
t=t+1
|
||||||
|
|
||||||
|
" jms between;add a; add b; skip if a<=ac<b
|
||||||
|
|
||||||
|
between:0
|
||||||
|
dac 9f+t
|
||||||
|
cma
|
||||||
|
xct between i
|
||||||
|
isz between
|
||||||
|
sma
|
||||||
|
jmp 1f
|
||||||
|
lac 9f+t
|
||||||
|
cma
|
||||||
|
xct between i
|
||||||
|
isz between
|
||||||
|
sma
|
||||||
|
1:isz between
|
||||||
|
lac 9f+t
|
||||||
|
jmp between i
|
||||||
|
t=t+0 "shared with next temporary
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" jms cbetween; add a; add b; skip if a<=ac<b where ac
|
||||||
|
" contains a character address
|
||||||
|
|
||||||
|
cbetween:0
|
||||||
|
dac 9f+t
|
||||||
|
cma
|
||||||
|
xct cbetween i
|
||||||
|
isz cbetween
|
||||||
|
ral
|
||||||
|
sma
|
||||||
|
jmp 1f
|
||||||
|
lac 9f+t
|
||||||
|
cma
|
||||||
|
xct cbetween i
|
||||||
|
isz cbetween
|
||||||
|
ral
|
||||||
|
sma
|
||||||
|
1:isz cbetween
|
||||||
|
lac 9f+t
|
||||||
|
jmp cbetween i
|
||||||
|
t=t+1 "ac contents
|
||||||
+165
@@ -0,0 +1,165 @@
|
|||||||
|
"** 13-120-147.pdf page 23
|
||||||
|
rerm:
|
||||||
|
jms aget
|
||||||
|
jmp 1f
|
||||||
|
rers:
|
||||||
|
jms aget
|
||||||
|
add frame
|
||||||
|
1:dac holdlv
|
||||||
|
lac holdlv i
|
||||||
|
jmp 2f
|
||||||
|
rerv:
|
||||||
|
jms aget
|
||||||
|
lls 6
|
||||||
|
lrs 6
|
||||||
|
2:dac nframe i
|
||||||
|
isz nframe
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
rero:
|
||||||
|
jms decnf
|
||||||
|
dac rand1
|
||||||
|
jms aget
|
||||||
|
and o77
|
||||||
|
add obranch
|
||||||
|
dac 2f
|
||||||
|
cma
|
||||||
|
tad unary
|
||||||
|
spa
|
||||||
|
jmp 1f
|
||||||
|
jms decnf
|
||||||
|
dac rand2
|
||||||
|
1:lac rand1
|
||||||
|
2:xct
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
obranch:
|
||||||
|
xct .+1
|
||||||
|
opr ;op=0400000+1
|
||||||
|
jmp rorel ;le=op;op=op+1
|
||||||
|
jmp rorel ;ne=op;op=op+1
|
||||||
|
jmp rorel ;lt=op;op=op+1
|
||||||
|
jmp rorel ;ge=op;op=op+1
|
||||||
|
jmp rorel ;eq=op;op=op+1
|
||||||
|
jmp rorel ;gt=op;op=op+1
|
||||||
|
tad rand2 ;ad=op;op=op+1
|
||||||
|
jms sub ;sb=op;op=op+1
|
||||||
|
and rand2 ;an=op;op=op+1
|
||||||
|
jmp roor ;or=op;op=op+1
|
||||||
|
xor rand2 ;xo=op;op=op+1
|
||||||
|
jmp rosr ;sr=op;op=op+1
|
||||||
|
jmp rosl ;sl=op;op=op+1
|
||||||
|
jmp romn ;mn=op;op=op+1
|
||||||
|
jmp romx ;mx=op;op=op+1
|
||||||
|
lac rand2 ;as=op;op=op+1
|
||||||
|
|
||||||
|
opr ;pl=op;op=op+1
|
||||||
|
jmp romi ;mi=op;op=op+1
|
||||||
|
cma ;cm=op;op=op+1
|
||||||
|
jmp roindir;indir=op;op=op+1
|
||||||
|
lac holdlv ;addr=op;op=op+1
|
||||||
|
unary:xct obranch+1+pl
|
||||||
|
|
||||||
|
rorel: "<= 001
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 24
|
||||||
|
jms sub "!= 010
|
||||||
|
sna "< 011
|
||||||
|
jmp 2f ">= 100
|
||||||
|
spa "= 101
|
||||||
|
jmp 1f "> 110
|
||||||
|
lac d1 "a>b, code 001
|
||||||
|
jmp 3f
|
||||||
|
1:lac d2 "a<b, code 100
|
||||||
|
2:add d2 "a=b, code 010
|
||||||
|
3:and ii i
|
||||||
|
sza
|
||||||
|
-1
|
||||||
|
cma
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
sub:0
|
||||||
|
cma
|
||||||
|
tad rand2
|
||||||
|
cma
|
||||||
|
jmp sub i
|
||||||
|
|
||||||
|
roor:
|
||||||
|
lmq
|
||||||
|
lac rand2
|
||||||
|
omq
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
rosr:
|
||||||
|
lac rand2
|
||||||
|
add l.lrs
|
||||||
|
cll
|
||||||
|
jmp 1f
|
||||||
|
rosl:
|
||||||
|
lac rand2
|
||||||
|
add l.lls
|
||||||
|
clq
|
||||||
|
1:dac .+2
|
||||||
|
lac rand1
|
||||||
|
0
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
romn:
|
||||||
|
jms sub
|
||||||
|
cma
|
||||||
|
jmp .+2
|
||||||
|
romx:
|
||||||
|
jms sub
|
||||||
|
ral
|
||||||
|
lac rand1
|
||||||
|
szl
|
||||||
|
lac rand2
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
romi:
|
||||||
|
cma
|
||||||
|
tad d1
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
roindir:
|
||||||
|
dac holdlv
|
||||||
|
lac holdlv i
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 25
|
||||||
|
jmp result
|
||||||
|
|
||||||
|
result:
|
||||||
|
dac junk
|
||||||
|
dac nframe i
|
||||||
|
isz nframe
|
||||||
|
lac ii i
|
||||||
|
and stbit
|
||||||
|
sna
|
||||||
|
jmp exprtest
|
||||||
|
lac junk
|
||||||
|
dac holdlv i
|
||||||
|
lac ii i
|
||||||
|
and fibit
|
||||||
|
sza
|
||||||
|
jms decnf
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
exprtest:
|
||||||
|
lac ii i
|
||||||
|
and fibit
|
||||||
|
sna
|
||||||
|
jmp goon
|
||||||
|
jms decnf
|
||||||
|
lac nframe i
|
||||||
|
sza
|
||||||
|
-1
|
||||||
|
cma
|
||||||
|
dac fflag
|
||||||
|
jmp goon
|
||||||
|
|
||||||
|
decnf:0
|
||||||
|
-1
|
||||||
|
tad nframe
|
||||||
|
dac nframe
|
||||||
|
lac nframe i
|
||||||
|
jmp decnf i
|
||||||
+154
@@ -0,0 +1,154 @@
|
|||||||
|
"** 13-120-147.pdf page 26
|
||||||
|
9:.=.+t
|
||||||
|
|
||||||
|
end = -1
|
||||||
|
|
||||||
|
no = 0000000
|
||||||
|
rx = 0040000; gx = rx
|
||||||
|
rc = 0100000
|
||||||
|
rt = 0140000; gc = rt
|
||||||
|
rf = 0200000; gf = rf
|
||||||
|
rw = 0240000; gk = rw
|
||||||
|
ra = 0300000; gp = ra
|
||||||
|
rb = 0340000;gq = rb
|
||||||
|
ro = 0400000
|
||||||
|
rm = 0440000
|
||||||
|
rs = 0500000
|
||||||
|
rv = 0540000
|
||||||
|
|
||||||
|
|
||||||
|
ljmp:jmp
|
||||||
|
l.llss:llss
|
||||||
|
l.lrs:lrs
|
||||||
|
l.lls:lls
|
||||||
|
l.ra:ra
|
||||||
|
l.rb:rb
|
||||||
|
l.rw:rw
|
||||||
|
l.gk:gk
|
||||||
|
l.gcx:gc x
|
||||||
|
|
||||||
|
x = 020000
|
||||||
|
st = 0100
|
||||||
|
fi = 0200
|
||||||
|
opmask:0740000
|
||||||
|
exitmask: x
|
||||||
|
|
||||||
|
m1:0-1
|
||||||
|
d0:o0:0
|
||||||
|
d1:o1:1
|
||||||
|
d2:o2:2
|
||||||
|
d3:o3:3
|
||||||
|
d4:o4:4
|
||||||
|
d5:o5:5
|
||||||
|
d6:o6:6
|
||||||
|
d7:o7:7
|
||||||
|
d8:o10:8
|
||||||
|
asciisp:040
|
||||||
|
asciinl:012
|
||||||
|
nl:012777
|
||||||
|
onenl:nl
|
||||||
|
bugr:.+1;<rn>;<rx>;<rc>;<rt>;<rf>;<rw>;<ra>;<rb>
|
||||||
|
<ro>;<rm>;<rs>;<rv>
|
||||||
|
bugg:.+1;<gn>;<gx>;<gz>;<gc>;<gf>;<gk>;<gp>;<gq>
|
||||||
|
|
||||||
|
o17:017
|
||||||
|
o60:060
|
||||||
|
o77:077
|
||||||
|
o777:0777
|
||||||
|
|
||||||
|
o417777:0417777
|
||||||
|
o400000:0400000
|
||||||
|
o740000:0740000
|
||||||
|
o377700:0377700
|
||||||
|
o17777:017777
|
||||||
|
|
||||||
|
"** 13-120-147.pdf page 27
|
||||||
|
o757777:0757777
|
||||||
|
o600600:0600600
|
||||||
|
|
||||||
|
junk:0
|
||||||
|
junk1:0
|
||||||
|
|
||||||
|
output:1
|
||||||
|
input:0
|
||||||
|
|
||||||
|
stbit:st
|
||||||
|
fibit:fi
|
||||||
|
holdlv:0
|
||||||
|
rand1:0
|
||||||
|
rand2:0
|
||||||
|
|
||||||
|
|
||||||
|
symwrite:0
|
||||||
|
symbot: symtab
|
||||||
|
symsiz = 500
|
||||||
|
symmax:symsiz
|
||||||
|
|
||||||
|
equwrite:0
|
||||||
|
equread:0
|
||||||
|
equ = equread
|
||||||
|
equbot: equtab
|
||||||
|
equsiz = 500
|
||||||
|
equmax: equsiz
|
||||||
|
delta: 2
|
||||||
|
mdelta:0-2
|
||||||
|
|
||||||
|
sbsiz=50
|
||||||
|
sbmax:sbsiz
|
||||||
|
sbwrite:0
|
||||||
|
sbbot:sbbuf
|
||||||
|
|
||||||
|
fflag:0
|
||||||
|
gflag:0
|
||||||
|
ignore:.+1;0400000;0;0;0;0;0;0;4
|
||||||
|
frame:rstack
|
||||||
|
nframe:rstack+6
|
||||||
|
env = ignore
|
||||||
|
d.ii = d2
|
||||||
|
d.env = d3
|
||||||
|
d.blkmod = d3
|
||||||
|
d.j = d4
|
||||||
|
d.k = d5
|
||||||
|
dffrmsz:6
|
||||||
|
framsiz:4
|
||||||
|
refrsz = d6
|
||||||
|
gefrsz = d4
|
||||||
|
ii: start
|
||||||
|
k:0
|
||||||
|
|
||||||
|
rsiz = 500
|
||||||
|
rmax: rsiz
|
||||||
|
rbot:rstack
|
||||||
|
rtop:rstack+rsiz
|
||||||
|
|
||||||
|
owrite:0
|
||||||
|
obot:obuf
|
||||||
|
osiz=64
|
||||||
|
|
||||||
|
" **************** missing last page? below this line added by phil
|
||||||
|
|
||||||
|
omax:osiz
|
||||||
|
|
||||||
|
jsiz=100 " PLB: total guess (char buffer?)
|
||||||
|
j:0
|
||||||
|
jsav:0
|
||||||
|
jmax:jsiz
|
||||||
|
jmin:0
|
||||||
|
jbot:jbuf
|
||||||
|
ljsiz:jsiz " PLB: likely bogus!
|
||||||
|
|
||||||
|
ksiz=100 " PLB: total guess (char buffer?)
|
||||||
|
kmax:ksiz
|
||||||
|
kbot:kbuf
|
||||||
|
|
||||||
|
lochunk: 0 " PLB: WAG
|
||||||
|
|
||||||
|
" tables/buffers: last so not allocated in executable
|
||||||
|
symtab: .=.+symsiz
|
||||||
|
equtab: .=.+equsiz
|
||||||
|
sbbuf: .=.+sbsiz
|
||||||
|
rstack: .=.+rsiz
|
||||||
|
obuf: .=.+osiz
|
||||||
|
jbuf: .=.+jsiz
|
||||||
|
kbuf: .=.+ksiz
|
||||||
|
start: .=.+100 " pointed to by ii: may be a stack?
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
"** 13-120-147.pdf page 28
|
||||||
|
" op.s is the op code defination file
|
||||||
|
" for the assembler
|
||||||
|
" no iot ops are defined
|
||||||
|
" system cal entries are defined
|
||||||
|
"
|
||||||
|
dac = 0040000
|
||||||
|
jms = 0100000
|
||||||
|
dzm = 0140000
|
||||||
|
lac = 0200000
|
||||||
|
xor = 0240000
|
||||||
|
add = 0300000
|
||||||
|
tad = 0340000
|
||||||
|
xct = 0400000
|
||||||
|
isz = 0440000
|
||||||
|
and = 0500000
|
||||||
|
sad = 0540000
|
||||||
|
jmp = 0600000
|
||||||
|
eae = 0640000
|
||||||
|
i = 020000
|
||||||
|
opr = 0740000
|
||||||
|
law = opr i
|
||||||
|
cma = opr 1
|
||||||
|
cml = opr 2
|
||||||
|
ral = opr 010
|
||||||
|
rar = opr 020
|
||||||
|
sma = opr 0100
|
||||||
|
sza = opr 0200
|
||||||
|
snl = opr 0400
|
||||||
|
skp = opr 01000
|
||||||
|
spa = opr 01100
|
||||||
|
sna = opr 01200
|
||||||
|
szl = opr 01400
|
||||||
|
cll = opr 04000
|
||||||
|
cla = opr 010000
|
||||||
|
las = opr 010004
|
||||||
|
lrs = eae 0500
|
||||||
|
lrss = i lrs
|
||||||
|
lls = eae 0600
|
||||||
|
llss = i lls
|
||||||
|
als = eae 0700
|
||||||
|
alss = i als
|
||||||
|
lacq = eae 01002
|
||||||
|
lacs = eae 01001
|
||||||
|
clq = eae 010000
|
||||||
|
omq = eae 2
|
||||||
|
cmq = eae 4
|
||||||
|
lmq = eae 012000
|
||||||
|
|
||||||
|
sys = i
|
||||||
|
save = 1
|
||||||
|
open = 3
|
||||||
|
read = 4
|
||||||
|
write = 5
|
||||||
|
creat = 6
|
||||||
|
seek = 7
|
||||||
|
close = 9
|
||||||
|
exit = 14
|
||||||
@@ -294,7 +294,7 @@ sub set_label
|
|||||||
# An error to have different values
|
# An error to have different values
|
||||||
if ( defined( $Glabel{$label} ) && $Glabel{$label} != $loc ) {
|
if ( defined( $Glabel{$label} ) && $Glabel{$label} != $loc ) {
|
||||||
# non-fatal: as.s doesn't even warn!!!!
|
# non-fatal: as.s doesn't even warn!!!!
|
||||||
print STDERR "$file:$lineno: Global label $label multiply defined\n"
|
print STDERR "$file:$lineno: NOTE: Global label $label multiply defined (not an error)\n"
|
||||||
if ($stage == 2);
|
if ($stage == 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -361,7 +361,7 @@ sub parse_directive
|
|||||||
print("Got directive $directive\n") if ($debug);
|
print("Got directive $directive\n") if ($debug);
|
||||||
|
|
||||||
# Set this as a local label
|
# Set this as a local label
|
||||||
if ($directive=~ m{^\.local\s+(\S+)}) {
|
if ($directive=~ m{^\@local\s+(\S+)}) {
|
||||||
$Islocal{$file}{$1}=1;
|
$Islocal{$file}{$1}=1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -383,22 +383,22 @@ sub parse_line {
|
|||||||
|
|
||||||
print "parse_line: '$line'\n" if ($debug);
|
print "parse_line: '$line'\n" if ($debug);
|
||||||
|
|
||||||
# Assembler directives start with a tab and a .
|
|
||||||
if ($line =~ m{^\t(\..*)}) {
|
|
||||||
parse_directive($1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Lose any leading whitespace
|
# Lose any leading whitespace
|
||||||
$line =~ s{^\s*}{};
|
$line =~ s{^\s*}{};
|
||||||
|
|
||||||
|
# Assembler directives start with an @
|
||||||
|
if ($line =~ m{^\@}) {
|
||||||
|
parse_directive($line);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
while ($line =~ s{^([A-Za-z0-9_\.]+):\s*}{}) { # labels
|
while ($line =~ s{^([A-Za-z0-9_\.]+):\s*}{}) { # labels
|
||||||
process_label($1);
|
process_label($1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return if (eol());
|
return if (eol());
|
||||||
|
|
||||||
if ( $line =~ s{^(\S+)\s*=}{}) { # assignment
|
if ( $line =~ s{^([^;= \t]+)\s*=}{}) { # assignment
|
||||||
my $lhs = $1;
|
my $lhs = $1;
|
||||||
my $word = parse_expression();
|
my $word = parse_expression();
|
||||||
printf( "Setting variable %s to 0%o\n", $lhs, $word ) if ($debug);
|
printf( "Setting variable %s to 0%o\n", $lhs, $word ) if ($debug);
|
||||||
|
|||||||
+2
-2
@@ -213,8 +213,8 @@ sub print_direntry {
|
|||||||
# Warn about empty filename
|
# Warn about empty filename
|
||||||
$name= "EMPTY FILENAME" if ($name=~ m{/$});
|
$name= "EMPTY FILENAME" if ($name=~ m{/$});
|
||||||
|
|
||||||
printf( "%4d %s%s%s%s%s %2d %3d %5d %s\n",
|
printf( "%4d %s%s%s%s%s %2d %3o %5d %s\n",
|
||||||
$inum, $p1, $p2, $p3, $p4, $p5, $links, $uid, $size, $name );
|
$inum, $p1, $p2, $p3, $p4, $p5, $links, $uid & 0777, $size, $name );
|
||||||
}
|
}
|
||||||
|
|
||||||
# Given a directory's i-num and name, check it
|
# Given a directory's i-num and name, check it
|
||||||
|
|||||||
+12
-6
@@ -221,7 +221,7 @@ sub fill_inode {
|
|||||||
$Block[$blocknum][ $offset + I_FLAGS ] = $flags;
|
$Block[$blocknum][ $offset + I_FLAGS ] = $flags;
|
||||||
|
|
||||||
dprintf( "Fill inum %d: flags %06o uid %06o size %d (%06o)=> blk %d off %d\n",
|
dprintf( "Fill inum %d: flags %06o uid %06o size %d (%06o)=> blk %d off %d\n",
|
||||||
$inum, $flags, $uid, $size, $size, $blocknum, $offset );
|
$inum, $flags, $uid & 0777, $size, $size, $blocknum, $offset );
|
||||||
return ($inum);
|
return ($inum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,7 +369,7 @@ sub make_dir {
|
|||||||
dprint("Added a .. entry to ourselves\n");
|
dprint("Added a .. entry to ourselves\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dprintf( "Made directory %s perms %06o uid %d in inum %d\n\n",
|
dprintf( "Made directory %s perms %06o uid %06o in inum %d\n\n",
|
||||||
$dirname, $perms, $uid, $inum );
|
$dirname, $perms, $uid, $inum );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -442,7 +442,7 @@ sub write_file {
|
|||||||
# the dirstack.
|
# the dirstack.
|
||||||
sub add_file {
|
sub add_file {
|
||||||
my ( $name, $perms, $uid, $extfile, $inum ) = @_;
|
my ( $name, $perms, $uid, $extfile, $inum ) = @_;
|
||||||
dprintf( "Adding file %s perms %06o uid %d extfile %s\n",
|
dprintf( "Adding file %s perms %06o uid %06o extfile %s\n",
|
||||||
$name, $perms, $uid, $extfile );
|
$name, $perms, $uid, $extfile );
|
||||||
|
|
||||||
# Read the file into a buffer
|
# Read the file into a buffer
|
||||||
@@ -513,6 +513,12 @@ sub parse_perms {
|
|||||||
return ( $filetype, $perms );
|
return ( $filetype, $perms );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub uid {
|
||||||
|
my $uid = shift;
|
||||||
|
return 0777777 if ($uid eq '-1');
|
||||||
|
return oct($uid);
|
||||||
|
}
|
||||||
|
|
||||||
# Open the named proto file and parse it
|
# Open the named proto file and parse it
|
||||||
sub parse_proto_file {
|
sub parse_proto_file {
|
||||||
my $file = shift;
|
my $file = shift;
|
||||||
@@ -543,17 +549,17 @@ sub parse_proto_file {
|
|||||||
|
|
||||||
if ( $type eq I_DIRECTORY ) {
|
if ( $type eq I_DIRECTORY ) {
|
||||||
my ( $name, $permstr, $uid, $inum ) = @words;
|
my ( $name, $permstr, $uid, $inum ) = @words;
|
||||||
make_dir( $name, $perms, $uid, $inum );
|
make_dir( $name, $perms, uid($uid), $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $type eq I_FILE ) {
|
if ( $type eq I_FILE ) {
|
||||||
my ( $name, $permstr, $uid, $extfile, $inum ) = @words;
|
my ( $name, $permstr, $uid, $extfile, $inum ) = @words;
|
||||||
add_file( $name, $perms, $uid, $extfile, $inum );
|
add_file( $name, $perms, uid($uid), $extfile, $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $type eq I_SPECIAL ) {
|
if ( $type eq I_SPECIAL ) {
|
||||||
my ( $name, $permstr, $uid, $inum ) = @words;
|
my ( $name, $permstr, $uid, $inum ) = @words;
|
||||||
add_special( $name, $perms, $uid, $inum );
|
add_special( $name, $perms, uid($uid), $inum );
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
if ( $type eq I_LINK ) {
|
if ( $type eq I_LINK ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user