Author SHA1 Message Date
phil 8dcc21ed8d mkfs7: add uid function to handle -1 2019-10-28 02:39:13 -04:00
phil 07c9a5c2d7 README.md: update 2019-10-26 23:11:11 -04:00
phil 396492720b sys.rc: use rn command for rename 2019-10-26 22:31:36 -04:00
phil 970c5b6347 b_readme: B compiler now named 'b' 2019-10-26 22:29:57 -04:00
phil e1ee7f254a as7: change directive prefix from "<TAB>." to "@" 2019-10-26 12:38:18 -04:00
phil f51734d3de Makefile: add adm, proto wants it (but dataphone h/w & GCOS not avail!) 2019-10-26 01:14:55 -04:00
phil c2ba39ba0f add (d)ttt to image 2019-10-26 01:14:55 -04:00
phil 9f818a984b fsck7/mkfs7/proto/password: interpret/dislpay uids strictly as octal 2019-10-26 01:14:55 -04:00
phil bceda25306 update README.md to reflect reality in original-commands branch. 2019-10-26 01:14:55 -04:00
phil d2690695db add bwk & doug users; have ken & dmr files use uids from password file
put B files in bwk; tmg files in doug
2019-10-26 01:14:55 -04:00
phil 7af29dd922 b_readme: update to reflect op.s 2019-10-26 01:14:55 -04:00
phil 0c65c8f1d6 t7.s: add guesses at missing variable declarations (missing last page?) 2019-10-26 01:14:55 -04:00
phil e22f0e74df add tmg sources to src/cmd 2019-10-26 01:14:55 -04:00
phil 3fa173ab56 Makefile: call CFLAGS for compiling near-B code BFLAGS! 2019-10-26 01:14:55 -04:00
phil 963ea7c170 as7 tweaks: make it clear multiple define is not an error; fix = for tmg 2019-10-26 01:14:55 -04:00
phil dbd19c5478 G2TTY support is in github SimH: remove old comment that it isn't 2019-10-26 01:14:55 -04:00
phil ddf4ab1f23 renamed B compiler binary to b: new scans include a bc.s 2019-10-26 01:14:55 -04:00
phil 663faf8a00 adjust sys.rc for original link, rm commands 2019-10-26 01:14:55 -04:00
phil 9e61d74691 add "link" as alias for ln; use original op.s 2019-10-26 01:14:55 -04:00
phil 1c039339ef copy scan/op.s to cmd/src 2019-10-26 01:14:55 -04:00
phil 668de66579 Makefile and proto using original cat, cp, ln, ls, sh, stat
couldn't deal with the alt clutter
consider this a sandbox
2019-10-26 01:14:55 -04:00
115 changed files with 2451 additions and 3124 deletions
-31
View File
@@ -1,31 +0,0 @@
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: get libdatetime-perl
run: sudo apt-get install libdatetime-perl
- name: build
run: make clean;make alt; make clean; make
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: get DateTime
run: sudo cpan -i DateTime
- name: build
run: make clean;make alt; make clean; make
-2
View File
@@ -14,5 +14,3 @@ build/alt/a.out
build/alt/image.fs
**/.DS_Store
/a.out
/build/cas.out
/build/chrtbl.out
+3
View File
@@ -0,0 +1,3 @@
language: c
sudo: false
script: make clean;make
+2 -5
View File
@@ -9,11 +9,8 @@ buildit:
run: buildit
cd build && $(MAKE) run
alt:
cd build && $(MAKE) alt
altrun: alt
cd build && $(MAKE) altrun
altrun: buildit
cd build && $(MAKE) alt && $(MAKE) altrun
clean:
cd build && $(MAKE) clean
+73 -81
View File
@@ -1,54 +1,53 @@
![CI](https://github.com/DoctorWkt/pdp7-unix/workflows/CI/badge.svg)
# pdp7-unix
## About
pdp7-unix is a project to resurrect Unix on the PDP-7 from scans of the original
assembly code done by
pdp7-unix is a project to resurrect Unix on the PDP-7 from scans of
the original assembly code done by
[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/)
[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
### January 2020
Unixv0 is running on a real PDP-7 at the Living Computer Museum. [Youtube](https://www.youtube.com/watch?v=pvaPaWyiuLA).
### 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!
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
We've written an assembler, a user-mode simulator and
commented several source files. We now have these utilities running:
as, cat, chmod, chown, chrm, cp, date, ln, ls, mv, stat. We have a working
shell with some functionality missing. We have a working filesystem and
we can now boot the kernel, launch init, login, get to a shell prompt and
run the utilities.
We've written an assembler, a user-mode simulator and commented
several source files. We now have these utilities running: as, cat,
chmod, chown, chrm, cp, date, ln, ls, mv, stat. We have a working
(replacement) shell. We have a working filesystem and we can now boot
the kernel, launch init, login, get to a shell prompt and run the
utilities.
Things to do: bring the
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/)
and [SimH](http://simh.trailing-edge.com/) as target platforms.
## 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:
`make`
`make pdp7`
## Running pdp7-unix
You will need [simh](http://simh.trailing-edge.com/) 4.0 to run pdp7-unix. You can get the source code [here](https://github.com/simh/simh). On 64-bit systems, you may need to set the C compiler's optimisation level to -O1.
You will need [simh](http://simh.trailing-edge.com/) 4.0 to run pdp7-unix. You can get the source code [here](https://github.com/simh/simh).
On 64-bit systems, you may need to set the C compiler's optimisation level to -O1.
### Running from source
@@ -64,13 +63,13 @@ A typical pdp7-unix session on simh looks like:
<pre>
pdp7 unixv0.simh
k
PDP-7 simulator V4.0-0 Current git commit id: b848cb12
PDP-7 simulator V4.0-0 Current git commit id: aff3346e
CPU idle disabled
8KW, EAE
/Users/tom/projects/pdp7-unix/build/unixv0.simh-13> att rb image.fs
RB: buffering file in memory
/Users/tom/projects/pdp7-unix/build/unixv0.simh-17> att -U g2in 12345
/Users/tom/projects/pdp7-unix/build/unixv0.simh-18> att -U g2in 12345
Listening on port 12345
PDP-7 simulator configuration
@@ -90,9 +89,10 @@ G2IN devno=43-44
login: ken
password: ken
@ ls
..
dd
maksys.s
..
system
sop.s
s1.s
s2.s
s3.s
@@ -101,65 +101,58 @@ s5.s
s6.s
s7.s
s8.s
sop.s
system
sys.rc
maksys.s
trysys.s
sys.rc
@ ls system
..
adm
apr
as
b
cas
cat
check
chmod
chown
chrm
cp
date
db
dd
display
ds
dskres
dsksav
dsw
dttt
ed
init
dd
ttyin
keyboard
link
list
ln
ls
moo
mv
nm
od
p
pptin
ttyout
display
pptout
apr
as
bc
cas
cat
check
chmod
chown
chrm
cp
date
db
ds
dskres
dsksav
dsw
ed
init
ln
ls
lsd
lsl
nm
od
p
pd
mv
password
pptin
pptout
rm
rn
roff
salv
sh
stat
tm
ttyin
ttyout
ttt
un
roff
rn
rm
sh
stat
tm
@
</pre>
## Source Tree
The code in the original scans are (c) Micro Focus who own the rights to the Unix
The code in the original scans are (c) Novell who own the rights to the Unix
source code. Everything that didn't come from the scanned files is GPLv3.
* /build is an area to build the kernel & filesystem and run them
@@ -171,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
* /tools holds the source for the tools written to assist the project
## License
pdp7-unix is under the [GPLv3](LICENSE)
## Mailing List
We have a
@@ -183,3 +171,7 @@ We have a
for those people actively involved in the restoration effort. Send e-mail
to Warren Toomey (DoctorWkt) if you are keen to help out.
## Travis Status
<a href="https://travis-ci.org/DoctorWkt/pdp7-unix">
<img src="https://api.travis-ci.org/DoctorWkt/pdp7-unix.png"></a>
+36 -142
View File
@@ -8,8 +8,8 @@ ASARGS=--format=ptr
MKFS=../tools/mkfs7
A7OUT=../tools/a7out
FSCK=../tools/fsck7
CCARGS=-Wno-multichar -Wno-implicit
PDP7?=pdp7
BFLAGS=-Wno-multichar -Wno-implicit
PDP7=pdp7
# source dirs
SYSSRC=../src/sys
@@ -26,19 +26,12 @@ BINARIES=../binaries/
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
# and frequently with make run. However, you have to manually make all first!
run:
$(PDP7) unixv0.simh
# Alternative run, use the alt/image.fs
altrun:
$(PDP7) alt/unixv0.simh
dist: all alt
dist: all
mkdir -p $(BINARIES)
mkdir -p $(BINARIES)/orig
mkdir -p $(BINARIES)/alt
@@ -46,62 +39,31 @@ dist: all alt
cp boot.rim $(BINARIES)/orig
cp a.out $(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
SYS= $(SYSSRC)/sop.s $(SYSSRC)/s1.s $(SYSSRC)/s2.s \
$(SYSSRC)/s3.s $(SYSSRC)/s4.s $(SYSSRC)/s5.s \
$(SYSSRC)/s6.s $(SYSSRC)/s7.s $(SYSSRC)/s8.s
a.out: $(SYS)
$(AS) -f ptr -o a.out $(SYSSRC)/sop.s $(SYS)
$(AS) -n -f list -o a.lst $(SYSSRC)/sop.s $(SYS)
# Alternative kernel: no dd, but . and ..
ALTSYS= $(SYSSRC)/sop.s $(SYSSRC)/s1.s $(ALTSRC)/s2.s \
$(SYSSRC)/s3.s $(SYSSRC)/s4.s $(SYSSRC)/s5.s \
$(SYSSRC)/s6.s $(SYSSRC)/s7.s $(SYSSRC)/s8.s
alt/a.out: $(ALTSYS)
$(AS) -f ptr -o alt/a.out $(ALTSYS)
$(AS) -n -f list -o alt/a.lst $(ALTSYS)
# Phil's bootstrap code
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.
# Don't use this one!
COLDBOOT=$(SYS) $(SYSSRC)/s9.s
coldboot.rim: $(COLDBOOT)
$(AS) -f rim -o coldboot.rim $(COLDBOOT)
$(AS) -n -f list -o a.lst $(COLDBOOT)
COLD_FILES=$(SYS_FILES) $(SYSSRC)/s9.s
coldboot.rim: $(COLD_FILES)
$(AS) -f rim -o coldboot.rim $(COLD_FILES)
$(AS) -n -f list -o coldboot.lst $(COLD_FILES)
# Filesystem image
image.fs: cmd others a.out chrtbl.out
$(MKFS) -k a.out -c chrtbl.out proto
image.fs: cmd others
$(MKFS) -k a.out proto
$(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
# character table: assemble output of cas.s
chrtbl.out: cas.out ../src/other/chrtbl.s
$(AS) -f ptr --no-label-warnings -o chrtbl.out ../src/other/chrtbl.s cas.out
# run cas.s under a7out: needs local file!
cas.out: bin/cas ../src/sys/cas.in
rm -f cas.in
ln -s ../src/sys/cas.in .
$(A7OUT) bin/cas cas.out cas.in
rm -f cas.in
clean:
rm -f boot.rim image.fs a.lst n.out a.out
rm -f cas cas.in cas.out chrtbl.out
rm -f alt/image.fs alt/a.out alt/a.lst
rm -rf $(BINDIR) $(TESTDIR)
rm -rf $(BINARIES)
@@ -109,10 +71,8 @@ dirs:
mkdir -p $(BINDIR)
# The commands that came from the original scans
# PLEASE KEEP IN ALPHABETICAL ORDER!
cmd: dirs \
cmd: dirs \
$(BINDIR)/adm \
$(BINDIR)/ald \
$(BINDIR)/apr \
$(BINDIR)/as \
$(BINDIR)/cas \
@@ -134,36 +94,32 @@ cmd: dirs \
$(BINDIR)/moo \
$(BINDIR)/nm \
$(BINDIR)/p \
$(BINDIR)/psych \
$(BINDIR)/rm \
$(BINDIR)/rn \
$(BINDIR)/roff \
$(BINDIR)/salv \
$(BINDIR)/sh \
$(BINDIR)/st \
$(BINDIR)/stat \
$(BINDIR)/tm \
$(BINDIR)/ttt \
$(BINDIR)/un
# Alternate commands: no dd, but . and ..
altcmd: dirs cmd \
$(BINDIR)/altchrm $(BINDIR)/cp $(BINDIR)/altinit $(BINDIR)/altmkdir
# -- compile errors
$(BINDIR)/adm: $(CMDSRC)/adm.s
$(AS) $(ASARGS) -o $(BINDIR)/adm $(CMDSRC)/adm.s
$(BINDIR)/ald: $(CMDSRC)/ald.s
$(AS) $(ASARGS) -o $(BINDIR)/ald $(CMDSRC)/ald.s
$(BINDIR)/apr: $(CMDSRC)/apr.s
$(AS) $(ASARGS) -o $(BINDIR)/apr $(CMDSRC)/apr.s
$(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)/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
$(AS) $(ASARGS) -o $(BINDIR)/cat $(CMDSRC)/cat.s
@@ -180,24 +136,22 @@ $(BINDIR)/chown: $(CMDSRC)/chown.s
$(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)/cas: $(CMDSRC)/cas.s
$(AS) $(ASARGS) -o $(BINDIR)/cas $(CMDSRC)/cas.s
$(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
$(AS) $(ASARGS) -o $(BINDIR)/ds $(CMDSRC)/ds.s
$(BINDIR)/dsw: $(CMDSRC)/dsw.s
$(AS) $(ASARGS) -o $(BINDIR)/dsw $(CMDSRC)/dsw.s
DSKRES=$(CMDSRC)/dskres.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
$(BINDIR)/dskres: $(DSKRES)
$(AS) $(ASARGS) -o $(BINDIR)/dskres $(DSKRES)
@@ -206,12 +160,8 @@ DSKSAV=$(CMDSRC)/dsksav.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s
$(BINDIR)/dsksav: $(DSKSAV)
$(AS) $(ASARGS) -o $(BINDIR)/dsksav $(DSKSAV)
$(BINDIR)/dsw: $(CMDSRC)/dsw.s
$(AS) $(ASARGS) -o $(BINDIR)/dsw $(CMDSRC)/dsw.s
ED=$(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
$(BINDIR)/ed: $(ED)
$(AS) $(ASARGS) -o $(BINDIR)/ed $(ED)
$(BINDIR)/ed: $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
$(AS) $(ASARGS) -o $(BINDIR)/ed $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s
$(BINDIR)/init: $(CMDSRC)/init.s
$(AS) $(ASARGS) -o $(BINDIR)/init $(CMDSRC)/init.s
@@ -228,13 +178,13 @@ $(BINDIR)/moo: $(CMDSRC)/moo.s
$(BINDIR)/nm: $(CMDSRC)/nm.s
$(AS) $(ASARGS) -o $(BINDIR)/nm $(CMDSRC)/nm.s
P=$(CMDSRC)/p1.s $(CMDSRC)/p2.s $(CMDSRC)/p3.s $(CMDSRC)/p4.s $(CMDSRC)/p5.s
P=$(sort $(wildcard $(CMDSRC)/p[1-5].s))
$(BINDIR)/p: $(P)
$(AS) $(ASARGS) -o $(BINDIR)/p $(P)
PSYCH=$(CMDSRC)/psych.s $(CMDSRC)/fop.s
$(BINDIR)/psych: $(PSYCH)
$(AS) $(ASARGS) -o $(BINDIR)/psych $(PSYCH)
# 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
@@ -242,9 +192,6 @@ $(BINDIR)/rm: $(CMDSRC)/rm.s
$(BINDIR)/rn: $(CMDSRC)/rn.s
$(AS) $(ASARGS) -o $(BINDIR)/rn $(CMDSRC)/rn.s
$(BINDIR)/pd: $(CMDSRC)/pd.s
$(AS) $(ASARGS) -o $(BINDIR)/pd $(CMDSRC)/pd.s
$(BINDIR)/roff: $(CMDSRC)/roff.s
$(AS) $(ASARGS) -o $(BINDIR)/roff $(CMDSRC)/roff.s
@@ -264,25 +211,18 @@ TTT=$(CMDSRC)/ttt1.s $(CMDSRC)/ttt2.s
$(BINDIR)/ttt: $(TTT)
$(AS) $(ASARGS) -o $(BINDIR)/ttt $(TTT)
ST=$(CMDSRC)/st1.s $(CMDSRC)/st2.s $(CMDSRC)/st3.s $(CMDSRC)/st4.s $(CMDSRC)/fop.s $(CMDSRC)/st5.s $(CMDSRC)/st6.s $(CMDSRC)/st7.s
$(BINDIR)/st: $(ST)
$(AS) $(ASARGS) -o $(BINDIR)/st $(ST)
$(BINDIR)/un: $(CMDSRC)/un.s
$(AS) $(ASARGS) -o $(BINDIR)/un $(CMDSRC)/un.s
################
# The commands that did not come from the scans
others: dirs \
$(BINDIR)/b \
$(BINDIR)/date \
$(BINDIR)/mv \
$(BINDIR)/od
others: dirs $(BINDIR)/b $(BINDIR)/date $(BINDIR)/mv $(BINDIR)/od
# B compiler
# PLB: B compiler -- renamed from bc to b
# there is a bc.s in the second set of scans!
$(BINDIR)/b: $(CMDSRC)/bl.s $(CMDSRC)/bi.s ../tools/b.c $(OTHERSRC)/b.b
$(CC) $(CCARGS) -o b ../tools/b.c
$(CC) $(BFLAGS) -o b ../tools/b.c
./b $(OTHERSRC)/b.b b.s
$(AS) $(ASARGS) -o $(BINDIR)/b $(CMDSRC)/bl.s b.s $(CMDSRC)/bi.s
rm b b.s
@@ -296,50 +236,6 @@ $(BINDIR)/mv: $(OTHERSRC)/wktmv.s
$(BINDIR)/od: $(OTHERSRC)/wktod.s
$(AS) $(ASARGS) -o $(BINDIR)/od $(OTHERSRC)/wktod.s
################
# replacement programs (no longer in build)
$(BINDIR)/pbsh: $(OTHERSRC)/pbsh.s
$(AS) $(ASARGS) -o $(BINDIR)/pbsh $(OTHERSRC)/pbsh.s
$(BINDIR)/wktcat: $(OTHERSRC)/wktcat.s
$(AS) $(ASARGS) -o $(BINDIR)/wktcat $(OTHERSRC)/wktcat.s
$(BINDIR)/wktcp: $(OTHERSRC)/wktcp.s
$(AS) $(ASARGS) -o $(BINDIR)/wktcp $(OTHERSRC)/wktcp.s
$(BINDIR)/wktln: $(OTHERSRC)/wktln.s
$(AS) $(ASARGS) -o $(BINDIR)/wktln $(OTHERSRC)/wktln.s
$(BINDIR)/wktls: $(OTHERSRC)/wktls.s
$(AS) $(ASARGS) -o $(BINDIR)/wktls $(OTHERSRC)/wktls.s
$(BINDIR)/lsd: $(OTHERSRC)/pblsd.s
$(AS) $(ASARGS) -o $(BINDIR)/lsd $(OTHERSRC)/pblsd.s
$(BINDIR)/lsl: $(OTHERSRC)/pblsd.s
$(AS) $(ASARGS) -o $(BINDIR)/lsl $(OTHERSRC)/pblsd.s
$(BINDIR)/wktstat: $(OTHERSRC)/wktstat.s
$(AS) $(ASARGS) -o $(BINDIR)/wktstat $(OTHERSRC)/wktstat.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
# Alternative other commands: no dd, but . and ..
altothers: dirs cmd $(BINDIR)/wktcat $(BINDIR)/wktcp $(BINDIR)/date \
$(BINDIR)/altls $(BINDIR)/mv $(BINDIR)/od
$(BINDIR)/altls: $(ALTSRC)/wktls.s
$(AS) $(ASARGS) -o $(BINDIR)/altls $(ALTSRC)/wktls.s
################################################################
tests:
mkdir -p $(TESTDIR)
$(AS) $(ASARGS) -o $(TESTDIR)/decimal_out $(TESTSRC)/decimal_out.s
@@ -354,5 +250,3 @@ runtests: tests
$(A7OUT) $(TESTDIR)/octal_test
# $(A7OUT) $(TESTDIR)/testmul
# $(A7OUT) $(TESTDIR)/write_test
+4 -5
View File
@@ -9,8 +9,7 @@
# link l---- inumber
#
# The top directory's name is ignored
# inumbers are in decimal (-1 means previous file)
# uids are in octal
# Numeric values are in decimal
# Contents of each directory ends with a $ on a line by itself
# Format was inspired by 6th Edition mkfs
#
@@ -42,10 +41,10 @@
sh frwr- -1 bin/sh
stat frwr- -1 bin/stat
$
ken drwr- 12
ken drwr- 10
system l---- 3
hello frwr- 12 fs/hello
hello frwr- 10 fs/hello
$
dmr drwr- 14
dmr drwr- 12
system l---- 3
$
+2 -1
View File
@@ -12,7 +12,8 @@ set tti unix
set rb ena
att rb alt/image.fs
# enable TELNET in GRAPHICS-2 keyboard/display(!!)
# uncomment to TELNET in GRAPHICS-2 keyboard/display(!!)
# (requires github.com/philbudne/simh)
set g2in ena
att -U g2in 12345
+4 -3
View File
@@ -1,10 +1,11 @@
Here is how to compile and run hello.b:
@ bc hello.b hello.s
@ as ops.s bl.s hello.s bi.s
@ b hello.b hello.s
@ ln dmr op.s
@ as op.s bl.s hello.s bi.s
I
II
ops.s
op.s
bl.s
hello.s
bi.s
View File
+4 -3
View File
@@ -1,4 +1,5 @@
system:system:system:777777
ken:ken:ken:12
dmr:dmr:dmr:14
doug:doug:doug:15
ken:ken:ken:10
dmr:dmr:dmr:11
bwk:bwk:bwk:12
doug:doug:doug:14
+1 -1
View File
@@ -1,5 +1,5 @@
rm op.s
ln dmr op.s
link dmr op.s
as sop.s op.s maksys.s
rn a.out maksys
as sop.s op.s trysys.s
+3 -12
View File
@@ -1,18 +1,14 @@
# detect OS
UNAME=$(shell uname)
ifeq ($(UNAME), "Linux")
ifeq ($(UNAME), Linux)
UNAME=LINUX
else
ifeq ($(UNAME), "Darwin")
ifeq ($(UNAME), Darwin)
UNAME=DARWIN
else
ifeq ($(UNAME), "FreeBSD")
ifeq ($(UNAME), FreeBSD)
UNAME=FREEBSD
else
ifeq ($(UNAME), "OpenBSD")
UNAME=OPENBSD
endif
endif
endif
endif
@@ -27,10 +23,6 @@ ifeq ($(UNAME), FREEBSD)
# FreeBSD
CC=cc
MAKE=gmake
ifeq ($(UNAME), OPENBSD)
# OpenBSD
CC=cc
MAKE=gmake
else
ifeq ($(UNAME), DARWIN)
# Mac OS X
@@ -41,4 +33,3 @@ else
endif
endif
endif
endif
+35 -37
View File
@@ -7,8 +7,7 @@
# link l---- inumber
#
# The top directory's name is ignored
# inumbers are in decimal (-1 means previous file)
# uids are in octal
# Numeric values are in decimal
# Contents of each directory ends with a $ on a line by itself
# Format was inspired by 6th Edition mkfs
#
@@ -21,9 +20,9 @@ dd drwr- -1 4
ttyout irwr- -1 11
display irwr- -1 12
pptout irwr- -1 13
adm frwr- -1 bin/adm
password frw-- -1 fs/password
adm frwr- -1 bin/adm
ald frwr- -1 bin/ald
apr frwr- -1 bin/apr
as frwr- -1 bin/as
b frwr- -1 bin/b
@@ -51,7 +50,6 @@ dd drwr- -1 4
nm frwr- -1 bin/nm
od frwr- -1 bin/od
p frwr- -1 bin/p
psych frwr- -1 bin/psych
rm frwr- -1 bin/rm
rn frwr- -1 bin/rn
roff frwr- -1 bin/roff
@@ -61,44 +59,44 @@ dd drwr- -1 4
tm frwr- -1 bin/tm
ttt frwr- -1 bin/ttt
dttt l---- -1
st frwr- -1 bin/st
un frwr- -1 bin/un
$
ken drwr- 12
ken drwr- 10
system l---- 3
sop.s frwr- 12 ../src/sys/sop.s
s1.s frwr- 12 ../src/sys/s1.s
s2.s frwr- 12 ../src/sys/s2.s
s3.s frwr- 12 ../src/sys/s3.s
s4.s frwr- 12 ../src/sys/s4.s
s5.s frwr- 12 ../src/sys/s5.s
s6.s frwr- 12 ../src/sys/s6.s
s7.s frwr- 12 ../src/sys/s7.s
s8.s frwr- 12 ../src/sys/s8.s
maksys.s frwr- 12 ../src/sys/maksys.s
trysys.s frwr- 12 ../src/sys/trysys.s
sys.rc frwr- 12 fs/sys.rc
moostat frwr- 12 fs/moostat
sop.s frwr- 10 ../src/sys/sop.s
s1.s frwr- 10 ../src/sys/s1.s
s2.s frwr- 10 ../src/sys/s2.s
s3.s frwr- 10 ../src/sys/s3.s
s4.s frwr- 10 ../src/sys/s4.s
s5.s frwr- 10 ../src/sys/s5.s
s6.s frwr- 10 ../src/sys/s6.s
s7.s frwr- 10 ../src/sys/s7.s
s8.s frwr- 10 ../src/sys/s8.s
maksys.s frwr- 10 ../src/sys/maksys.s
trysys.s frwr- 10 ../src/sys/trysys.s
sys.rc frwr- 10 fs/sys.rc
$
dmr drwr- 14
dmr drwr- 11
system l---- 3
as.s frwr- 14 ../src/cmd/as.s
op.s frwr- 14 ../src/cmd/op.s
b_readme frwr- 14 fs/b_readme
bi.s frwr- 14 ../src/cmd/bi.s
bl.s frwr- 14 ../src/cmd/bl.s
db.s frwr- 14 ../src/cmd/db.s
hello.b frwr- 14 ../src/other/hello.b
b.b frwr- 14 ../src/other/b.b
as.s frwr- 11 ../src/cmd/as.s
op.s frwr- 11 ../src/cmd/op.s
$
doug drwr- 15
bwk drwr- 12
system l---- 3
t1.s frwr- 15 ../src/cmd/t1.s
t2.s frwr- 15 ../src/cmd/t2.s
t3.s frwr- 15 ../src/cmd/t3.s
t4.s frwr- 15 ../src/cmd/t4.s
t5.s frwr- 15 ../src/cmd/t5.s
t6.s frwr- 15 ../src/cmd/t6.s
t7.s frwr- 15 ../src/cmd/t7.s
t8.s frwr- 15 ../src/cmd/t8.s
b_readme frwr- 12 fs/b_readme
bi.s frwr- 12 ../src/cmd/bi.s
bl.s frwr- 12 ../src/cmd/bl.s
db.s frwr- 12 ../src/cmd/db.s
hello.b frwr- 12 ../src/other/hello.b
$
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
$
+8 -7
View File
@@ -3,27 +3,28 @@ set cpu eae
set cpu history=100
show cpu
; set up SIMH devices:
# set up SIMH devices:
; UNIX character translations (CR to NL, ESC to ALTMODE):
# UNIX character translations (CR to NL, ESC to ALTMODE):
set tti unix
; RB09 fixed head disk:
# RB09 fixed head disk:
set rb ena
att rb image.fs
; enable TELNET in GRAPHICS-2 keyboard/display(!!)
# uncomment to TELNET in GRAPHICS-2 keyboard/display(!!)
set g2in ena
att -U g2in 12345
; disable hardware UNIX-7 doesn't know about:
# disable hardware UNIX-7 doesn't know about:
set lpt disa
set drm disa
set dt disa
; show device settings:
# show device settings:
show dev
; load and run the paper tape bootstrap (loads system from disk)
# load and run the paper tape bootstrap
# (loads system from disk)
load boot.rim 010000
go
+1 -1
View File
@@ -13,7 +13,7 @@ DESCRIPTION Files are taken in pairs; the first is opened
.sp
FILES --
.sp
SEE ALSO cat, pr, rn
SEE ALSO cat, pr
.sp
DIAGNOSTICS Error returns are checked at every system call,
and appropriate diagnostics are produced.
+119
View File
@@ -0,0 +1,119 @@
.oh '11/3/70''FILE SYSTEM(V)'
.ta 18 21 24
NAME format of file system
.sp
SYNOPSIS --
.sp
DESCRIPTION The RB09 fixed head disk has 8,000 64-word
blocks on each of its two surfaces. Unix uses
the second surface (physical blocks 8,000 to
15,999) and numbers them from logical block 0 to
logical block 7,999. The following discussion
refers to logical blocks.
.sp
The Unix filesystem is divided into 8,000 blocks
of 64 words per block. Block 0 is the "sysdata"
block. The first word points to the first block
of the free-storage map. Each block in the
free-storage map is structured as follows: the
first word is the block number of the next block
in the free-storage map, or zero if this is the
end of the free-storage map. The next nine words
hold free block numbers, or zero (no block
number).
.sp
Block 1 on the filesystem is unused. (?)
.sp
I-numbers begin at 1, and the storage for
i-nodes begins at block 2. Blocks 2 to 711
contain the i-nodes, with five consecutive
i-nodes per block. Certain i-nodes are reserved
for special files, directories and devices:
.sp
1 The core file written by "sys save" or a
bad system call
2 The "dd" directory directory
3 The "system" directory
6 The "ttyin" special file
7 The "keyboard" (graphic-2) special file
8 The "pptin" (paper tape reader) special
file
10 The "ttyout" special file
11 The "display" (graphic-2) special file
12 The "pptout" (paper tape punch) special
file
.sp
There is only one file system which is always
mounted; it resides on the RB disk. This device
is also used for swapping. The swap areas are at
the high blocks on this device: blocks 6,400 to
7,999. These blocks do not appear in the free
list.
.sp
Each i-node represents one file. The format of
an i-node is as follows, where the left column
represents the offset in words from the
beginning of the i-node:
.sp
0 flags (see below)
1 first indirect block or contents block
...
7 seventh indirect block or contents block
8 user ID of owner
9 link count
10 size in words
11 unique value assigned at creation
.sp
The flags are as follows:
.sp
400000 i-node is allocated
200000 large file
?????? allocated bit (always on)
000040 special file
000020 directory
000010 read, owner
000004 write, owner
000002 read, non-owner
000001 write, non-owner
.sp
The allocated bit (flag ??????) is believed even
if the i-node map says the i-node is free; thus
corruption of the map may cause i-nodes to
become unallocatable, but will not cause active
nodes to be reused.
.sp
Word number n of a file is accessed as follows:
n is divided by 64 to find its logical block
number (say b) in the file. If the file is small
(flag 200000 is 0), then b must be less than 7,
and the physical block number corresponding to b
is the bth entry in the address portion of the
i-node.
.sp
If the file is large, b is divided by 64 to
yield a number which must be less than 8 (or
the file is too large for UNIX to handle).
The corresponding slot in the i-node address
portion gives the physical block number of an
indirect block. The residue mod 64 gives a
word offset in the indirect block, and the
word found there is the physical address of
the block corresponding to b.
.sp
If block b in a file exists, it is not necessary
that all blocks less than b exist. A zero block
number either in the address words of the i-node
or in an indirect block indicates that the
corresponding block has never been allocated.
Such a missing block reads as if it contained
all zero words.
.sp
FILES --
.sp
SEE ALSO format of directories
.sp
DIAGNOSTICS --
.sp
BUGS --
.sp
OWNER ken
-138
View File
@@ -1,138 +0,0 @@
.oh '11/3/70''FILE SYSTEM(V)'
.ta 18 21 24
NAME format of file system
.sp
SYNOPSIS --
.sp
DESCRIPTION
.in 8
The RB09 fixed head disk has 8,000 64-word
blocks (100 tracks of 80 blocks)
on each of its two surfaces. The Unix filesystem
is stored in the first 80 tracks of
the second surface (physical blocks 8,000 to
14,399 -- physical tracks 100 to 179)
and numbers them from logical block 0 to
logical block 6,399.
.sp
The Unix filesystem is divided into 6,400 logical blocks
of 64 words per block. Block 0 is the "sysdata"
block. The first word points to the first block
of the free-storage map. Each block in the
free-storage map is structured as follows: the
first word is the block number of the next block
in the free-storage map, or zero if this is the
end of the free-storage map. The next nine words
hold free block numbers, or zero (no block
number).
.sp
Block 1 on the filesystem is unused. (?)
.sp
I-numbers begin at 1, and the storage for
i-nodes begins at block 2. Blocks 2 to 711
contain the i-nodes, with five 12-word
i-nodes per block. Certain i-nodes are reserved
for special files, directories and devices:
.sp
.nf
1 The core file written by "sys save"
or a bad system call
2 The "dd" directory directory
3 The "system" directory
6 The "ttyin" special file
7 The "keyboard" (GRAPHIC-2)
special file
8 The "pptin" (paper tape reader)
special file
10 The "ttyout" special file
11 The "display" (GRAPHIC-2)
special file
12 The "pptout" (paper tape punch)
special file
.fi
.sp
There is only one file system which is always
mounted; it resides on the RB disk.
.sp
The last twenty tracks of the second disk surface
are use for bootable images and swapping:
.sp
Each physical track from 180 to 189
contains a bootable system image of 3K words.
.sp
Each physical track from 190 to 199 is used to swap
a user process (4K words plus a 64-word swapable
"userdata" area).
.sp
Each i-node represents one file. The format of
an i-node is as follows, where the left column
represents the offset in words from the
beginning of the i-node:
.sp
.nf
0 flags (see below)
1 first indirect block or data block
...
7 seventh indirect block or data block
8 user ID of owner
9 link count
10 size in words
11 unique value assigned at creation
.sp
.in 8
The flags are as follows:
.sp
400000 i-node is allocated
200000 large file
?????? allocated bit (always on)
000040 special file
000020 directory
000010 read, owner
000004 write, owner
000002 read, non-owner
000001 write, non-owner
.fi
.in 8
.sp
The allocated bit (flag ??????) is believed even
if the i-node map says the i-node is free; thus
corruption of the map may cause i-nodes to
become unallocatable, but will not cause active
nodes to be reused.
.sp
Word number n of a file is accessed as follows:
n is divided by 64 to find its logical block
number (say b) in the file. If the file is small
(flag 200000 is 0), then b must be less than 7,
and the physical block number corresponding to b
is the bth entry in the address portion of the
i-node.
.sp
If the file is large, b is divided by 64 to
yield a number which must be less than 8 (or
the file is too large for UNIX to handle).
The corresponding slot in the i-node address
portion gives the physical block number of an
indirect block. The residue mod 64 gives a
word offset in the indirect block, and the
word found there is the physical address of
the block corresponding to b.
.sp
If block b in a file exists, it is not necessary
that all blocks less than b exist. A zero block
number either in the address words of the i-node
or in an indirect block indicates that the
corresponding block has never been allocated.
Such a missing block reads as if it contained
all zero words.
.in 0
.sp
FILES --
.sp
SEE ALSO dir(V)
.sp
DIAGNOSTICS --
.sp
BUGS --
.sp
OWNER ken
-36
View File
@@ -1,36 +0,0 @@
.oh '11/3/70''LINK(I)'
.ta 18 30
NAME link -- link to a file
.sp
.in 0
SYNOPSIS
.in 8
.ul
link
file
.sp
.ul
link
srcdir file
.sp
.ul
link
srcdir file name
.sp
.in 0
DESCRIPTION
.in 8
With one argument makes a link to file in system directory.
.sp
With two arguments, makes a link to file in srcdir.
.sp
With three arguments, make name a link to file in srcdir.
.sp
.in 0
FILES --
.sp
SEE ALSO ln
.sp
BUGS --
.sp
OWNER ken, dmr
+5 -5
View File
@@ -1,21 +1,21 @@
.oh '11/3/70''LN(I)'
.ta 18 30
NAME ln -- link files
NAME ln -- link to a file
.sp
SYNOPSIS
.ul
ln
srcdir file...
name1 name2
.sp
DESCRIPTION make links in current dir to named files in srcdir
DESCRIPTION ln adds another filename to the first filename
.sp
FILES --
.sp
SEE ALSO link
SEE ALSO --
.sp
DIAGNOSTICS "twofiles" - please provide two filenames
"? file" - unable to make the link
.sp
BUGS --
.sp
OWNER ken, dmr
OWNER wkt
+15 -10
View File
@@ -2,19 +2,21 @@
.ta 18 21 24
NAME ls -- list contents of directory
.sp
SYNOPSIS ls [directory]
SYNOPSIS ls [ -l ] directory
.sp
DESCRIPTION
.ul
ls
lists the contents of the current,
or named directory.
lists the contents of the named directory
under control of one option:
.sp
.ul
list
lists details in the format of
l list in long format, giving i-number,
mode, owner, size in words, and name of
each file. (see
.ul
stat
for format of the
mode). Numeric values are in octal.
.sp
FILES --
.sp
@@ -27,13 +29,16 @@ BUGS In a simulated environment, a filename larger
than eight characters will cause
.ul
ls
to exit prematurely.
to exit
prematurely.
.sp
.ul
ls
will try to open up a directory named ".." if
no directory is named.
will try to open up a directory named "." if
no directory is named. If the user desires this
functionality, they need to link "." to the
directory in question.
.sp
OWNER ken, dmr
OWNER wkt
-23
View File
@@ -1,23 +0,0 @@
.oh '11/3/70''RN(I)'
.ta 18 31
NAME rn -- rename files
.sp
SYNOPSIS
.ul
rn
from to ...
.sp
DESCRIPTION Files are taken in pairs; The file from
is renamed to to, and so on...
.sp
FILES --
.sp
SEE ALSO cp
.sp
DIAGNOSTICS
"? file" - either unable to remove or create
a file
.sp
BUGS The diagnostic is ambiguous.
.sp
OWNER ken, dmr
+35 -27
View File
@@ -10,44 +10,52 @@ name
DESCRIPTION
.ul
stat
gives several kinds of information about one file.
gives several kinds of information about
one file:
.sp
.nf
i-number
flags
owner
links
size
access mode
number of links
owner
size in words
name
.sp
flag bits are:
.nf
.in 8
40 special file
20 directory
10 read, owner
04 write, owner
02 read, non-owner
01 write, non-owner
.in 8
All information is self-explanatory except the
mode. The mode is a five-character string whose
characters mean the following:
.sp
All values are printed in octal.
.in 0
1 s: file is small (smaller than 448 words)
l: file is large
d: file is a directory
.sp
2 r: owner can read
-: owner cannot read
.sp
3 w: owner can write
-: owner cannot write
.sp
4 r: non-owner can read
-: non-owner cannot read
.sp
5 w: non-owner can write
-: non-owner cannot write
.sp
All numeric values are printed in octal.
.sp
FILES --
.sp
SEE ALSO
.in 8
SEE ALSO
.ul
list
shows all files in a directory in the same format as
ls
with the -l option gives the same information
as
.ul
stat.
.in 0
stat,
except that it also shows the i-node
number for each file.
.sp
DIAGNOSTICS "name ?" for any error. "nofiles" if no file
name is given.
.sp
BUGS none
.sp
OWNER ken, dmr
OWNER wkt
-10
View File
@@ -1,10 +0,0 @@
Misc documentation
==================
See also github wiki pages:
https://github.com/DoctorWkt/pdp7-unix/wiki/Links
https://github.com/DoctorWkt/pdp7-unix/wiki/roff-commands
dated:
https://github.com/DoctorWkt/pdp7-unix/wiki/Source-file-status-scoreboard
https://github.com/DoctorWkt/pdp7-unix/wiki/Unanswered-questions
+7 -104
View File
@@ -14,11 +14,10 @@ v means following moves are visible.
r means end, output label=x-b+number.
All other commands are character pairs denoting y,x coordinates in a
14x16 character raster. Draw a line to that coordinate. Vertical
coordinates are a-p, and horizontal are a-n. aa is upper left and pn
is lower right. Characters reside on the base line from ma to mn
(characters like p and q descend below this line). All characters end
with a "x mn r" sequence to move to the beginning of the next character.
12x14 character raster. Draw a line to that coordinate. Vertical
coordinates are a-l, and horizontal are a-m. aa is upper left and mn
is lower right. All characters end with a "x mn r" sequence to move
to the beginning of the next character.
CAS OUTPUT
@@ -28,29 +27,7 @@ The output for each character is:
The label x:
18-bit octal words. Each word is three 6-bit incremental moves.
Each incremental move consists of three fields: a 2 bit distance field,
a 1 bit visibility field, a 3 bit direction field.
If the visibility field is a 0 nothing is drawn, if it is a 1 a line is
drawn. The distance field + 1 denotes how many pixels to move in a certain
direction. The 2 bit direction field is limited to values in the range 0..3,
but by adding 1, the actual distances denoted are in the range 1..4.
The 3 bit direction field with values in the range 0..7 is to be interpreted
according to this diagram and table:
y
^ value direction
7 0 1 ----- ---------
| 0 up
| 1 up right
| 2 right
6---+---2>x 3 down right
| 4 down
| 5 down left
| 6 left
5 4 3 7 up left
18-bit octal words. Each word is three 6-bit incremental moves.
label=x-b+number. Number is 01, six bits saying how many moves, and
10 zeroes.
@@ -72,30 +49,9 @@ Input:
mn
r
This character is labeled "lbk" (left bracket). Move invisibly to
This character is labelled "lbk" (left bracket). Move invisibly to
"ai" near upper right. Draw line left to "af". Draw down to "mf".
Draw right to "mj". Invisibly move to "mn" beyond lower right. End.
This can be interpreted in a grid starting a location ma (row m, column a)
denoted by a 0, and each succeeding move indicated by an increasing number:
abcdefghijklmn
a.....2..1.....
b..............
c..............
d..............
e..............
f..............
g..............
h..............
i..............
j..............
k..............
l..............
m0....3...4...5
n..............
o..............
p..............
Draw right to "mj". Invisibly move to "mn" beoynd lower right. End.
Output:
@@ -113,56 +69,3 @@ means draw down four steps. 72 means draw left four steps. 62 means
move left four steps.
0236000 means there are 15 moves, or 6-bit bytes.
0236000 in binary is 010011110000000000, and shifting this value
10 bits to the right gives 01001111, where only the 6 least significant
bits indicate the number of moves, i.e. 001111 or 15 in decimal.
The following explanation separates out each move onto its own line.
Further it decodes each move into binary, and separates out and interprets
the three distance, visibility and direction fields. Finally each line
ends with a comment indicating which input command generated the output move:
move move move dist vis direc dist vis direc input
number octal binary binary binary binary decimal text text command
------ ----- ------ ------ ------ ------ ------- ---- ---- -------
1 001 000001 00 0 001 1 false up right ai
2 001 000001 00 0 001 1 false up right ai
3 001 000001 00 0 001 1 false up right ai
4 001 000001 00 0 001 1 false up right ai
5 001 000001 00 0 001 1 false up right ai
6 001 000001 00 0 001 1 false up right ai
7 001 000001 00 0 001 1 false up right ai
8 001 000001 00 0 001 1 false up right ai
9 060 110000 11 0 000 4 false up ai
a 056 101110 10 1 110 3 true left v af
b 074 111100 11 1 100 4 true down mf
c 074 111100 11 1 100 4 true down mf
d 074 111100 11 1 100 4 true down mf
e 072 111010 11 1 010 4 true right mj
f 062 110010 11 0 010 4 false right x mn
This can be interpreted on a grid by starting at ma (row n, column a)
denoted by a 0 and following the moves denoted by their corresponding
move number. Note that after the final move, f, the location being
outside of the character box corresponds to the location ma of the
next character to the right. To the right is the same character where
x:s denote drawn pixels and . denote undrawn pixels.
abcdefghijklmn abcdefghijklmn
a.....a..9..... a.....xxxx.....
b.............. b.....x........
c.............. c.....x........
d.............. d.....x........
e.....b..8..... e.....x........
f.......7...... f.....x........
g......6....... g.....x........
h.....5........ h.....x........
i....4c........ i.....x........
j...3.......... j.....x........
k..2........... k.....x........
l.1............ l.....x........
m0....d...e...f m.....xxxxx....
n.............. n..............
o.............. o..............
p.............. p..............
+2 -2
View File
@@ -8,8 +8,8 @@ https://www.tuhs.org/Archive/Distributions/Research/McIlroy_v0/
The files should be unaltered versions of the scanned pages.
Micro Focus owns the rights to the Unix source code, so these files are probably
(c) 1970 Micro Focus. They are certainly not under the GPLv3 license.
Novell owns the rights to the Unix source code, so these files are probably
(c) 1970 Novell. They are certainly not under the GPLv3 license.
For modified versions of these files, look in src/cmds and src/sys.
+1 -1
View File
@@ -593,7 +593,7 @@ transcd: 0
jms transch
isz c2
jmp 1b
jmp transcd i
jmp transch i
transch: 0
lmq
+1 -6
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 7
" bc
jmp start
@@ -61,7 +60,6 @@ trace: 0
jmp trace i
dtrace: 0
"** 06-5-12.pdf page 8
lac pc
dac 8
lac 8 i
@@ -123,7 +121,6 @@ dspblk: 0
dac t1
dzm t2
1:
"** 06-5-12.pdf page 9
lac t1
sna
jmp 1f
@@ -185,7 +182,6 @@ histog: 0
tad histbuf
dac t1
isz t1 i
"** 06-5-12.pdf page 10
jmp histog i
jmp .
@@ -213,7 +209,7 @@ olddp: 0
dspbuf: 0
dspbp: 0
instr: 0
pbs: 0
obs: 0
inslitr: n 5
insasg: b 1
o17: 017
@@ -247,7 +243,6 @@ badsp:
badasgn:
jms flush
lac d1
"** 06-5-12.pdf page 11
sys write; mas; mass
jmp stop
mpc:
+2 -9
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 12
" bi
start:
@@ -61,7 +60,6 @@ binop:
tad .+3
dac .+1
jmp .. i
"** 06-5-12.pdf page 13
jmp . i
basg; bor; band; beq; bne; ble; blt; bge; bgt; brsh; blsh
badd; bmin; bmod; bmul; bdiv
@@ -123,7 +121,6 @@ blt:
bge:
lac t1 i
cma
"** 06-5-12.pdf page 14
tad t2 i
spa cla
lac d1
@@ -185,7 +182,6 @@ bdiv:
consop:
lac sp
"** 06-5-12.pdf page 15
tad d1
dac sp i
isz sp
@@ -247,7 +243,6 @@ call:
lac 8 i
dac t1
lac t1 i
"** 06-5-12.pdf page 16
dac 9 i
isz 8
-1
@@ -308,7 +303,6 @@ goto:
tad t1 i
dac pc
jmp fetch
"** 06-5-12.pdf page 17
retrn:
-2
@@ -371,7 +365,6 @@ unaop:
uadr; umin; uind; unot
uadr:
"** 06-5-12.pdf page 18
lac t1
dac t3 i
jmp fetch
@@ -433,8 +426,8 @@ t4: 0
addr: 0
pc = 017
"** 06-5-12.pdf page 19
sp: stack
dp: stack
ap: stack
stack: 0
stack: 0
+1 -5
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 3
" bl
jmp start
@@ -61,7 +60,6 @@ getc: 0
lac cibufp
sad eibufp
jmp 1f
"** 06-5-12.pdf page 4
lac cibufp i
and o777
dac iflg
@@ -123,7 +121,6 @@ stop:
flush: 0
lac oflg
sza
"** 06-5-12.pdf page 5
isz cobufp
lac cobufp
cma
@@ -185,7 +182,6 @@ initio: 0
.fin: 0
.fout: 1
eibufp: 0
"** 06-5-12.pdf page 6
cibufp: 0
iflg: 0
eobufp: 0
@@ -195,4 +191,4 @@ lastv: 017770
o777: 0777
d4:o4: 4
d8: 8
d8: 8
-3
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 21
" cat
lac 017777 i
@@ -61,7 +60,6 @@ done:
and d1
sna cla
jmp 1f
"** 06-5-12.pdf page 22
jms putc
jmp done
1:
@@ -123,7 +121,6 @@ putc: 0
sad d128
skp
jmp putc i
"** 06-5-12.pdf page 23
lac fo
sys write; iopt+1; 64
lac iopt
+2 -8
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 25
" check
lac d1
@@ -61,7 +60,6 @@ iloop:
lac iflags
and o40
sza
"** 06-5-12.pdf page 26
jmp iloop
law idskps
dac t1
@@ -123,7 +121,6 @@ dupcheck: 0
lac d1
2: alss 0
dac bit
"** 06-5-12.pdf page 27
lac i t6
and bit
sza
@@ -173,7 +170,7 @@ print: 0
part2:
lac icnt
jms print
jmp print
lac d1
sys write; m3; m3s
lac licnt
@@ -185,7 +182,6 @@ part2:
lac d1
sys write; m5; m5s
lac blcnt
"** 06-5-12.pdf page 28
jms print
lac d1
sys write; m6; m6s
@@ -247,7 +243,6 @@ part3:
cla
llss 4
tad alsscom
"** 06-5-12.pdf page 29
dac 2f
lac d1
2: alss 0
@@ -309,7 +304,6 @@ t1: 0
t2: 0
t3: 0
t4: 0
"** 06-5-12.pdf page 30
t5: 0
t6: 0
@@ -327,4 +321,4 @@ linode: .=.+12
iflags = linode
idskps = iflags+1
usetab: .=.+500
prbuf: .=.+6
prbuf: .=.+6
-20
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 2
" db
narg = ..+07777
@@ -61,7 +60,6 @@ wcorep: corename; 1
"
lac o52012
jms wchar
"** 07-13-19.pdf page 3
law dotdot
dac nsearch
jms nlsearch
@@ -123,7 +121,6 @@ cmd:
jmp saddress
sad o75
jmp address
"** 07-13-19.pdf page 4
sad o57
jmp octal
sad o72
@@ -185,7 +182,6 @@ saddress:
lac 9f
dac curdot
jmp mloop
"** 07-13-19.pdf page 5
9:0
"
symbol:
@@ -247,7 +243,6 @@ print:
spa
jmp error
lac rcore
"** 07-13-19.pdf page 6
sys read; inbuf; 64
spa
jmp error
@@ -309,7 +304,6 @@ prdec: "temp
proct:0
jms octw
6
"** 07-13-19.pdf page 7
jmp i proct
"
patch:
@@ -371,7 +365,6 @@ getexp:0
xloop:
jms rch
lmq
"** 07-13-19.pdf page 8
sad o44
skp
jmp 1f
@@ -433,7 +426,6 @@ xloop:
lac o40
sad rator
skp
"** 07-13-19.pdf page 9
jmp error
lacq
dac rator
@@ -495,7 +487,6 @@ spcai:
lac d1
dac reloc
jmp i getspec
"** 07-13-19.pdf page 10
"
getsym:0
lmq
@@ -557,7 +548,6 @@ skipt:
spa
jmp 2f
1:
"** 07-13-19.pdf page 11
lac nchar1
tad om101
spa
@@ -619,7 +609,6 @@ num1:
jmp i getnum
tad om10
sma
"** 07-13-19.pdf page 12
jmp i getnum
lac nchar1
dzm nchar1
@@ -681,7 +670,6 @@ prsym:0
dac word
dzm relflg
dzm relocflg
"** 07-13-19.pdf page 13
dzm nsearch
and o760000
sad o760000
@@ -743,7 +731,6 @@ pr1:
tad d1
dac addr
lac o55
"** 07-13-19.pdf page 14
jms wchar
jmp 2f
1:
@@ -805,7 +792,6 @@ peae:
jmp i prsym
1:
law eaes
"** 07-13-19.pdf page 15
dac addr
jmp nfnd
"
@@ -867,7 +853,6 @@ pcal:
law syss
jms wrname
lac o40
"** 07-13-19.pdf page 16
jms wchar
lac addr
jms wrname
@@ -929,7 +914,6 @@ nloop:
lacq
tad d3
dac np
"** 07-13-19.pdf page 17
lac i np
sna
jmp nloop
@@ -991,7 +975,6 @@ testn:
skp
jmp nloop
isz minp
"** 07-13-19.pdf page 18
isz inbuf
isz value
jmp 1b
@@ -1053,7 +1036,6 @@ nlerr:
"
rch:0
lac nchar1
"** 07-13-19.pdf page 19
dzm nchar1
sza
jmp i rch
@@ -1115,7 +1097,6 @@ d12:12
d8:8
d3:3
o177:0177
"** 07-13-19.pdf page 20
o136: 0136
o45: 045
sysflag: 0
@@ -1177,7 +1158,6 @@ nchar1:0
nchar:0
o177000:0177000
o56040:056040
"** 07-13-19.pdf page 21
nsearch:0
word:0
relflg:0
+2 -7
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 23
" dmabs
lac o17
@@ -61,7 +60,6 @@ dump2:
dump3:
-1
tad bufp
"** 07-13-19.pdf page 24
dac 8
-64
dac c1
@@ -123,7 +121,6 @@ dump4:
done:
lac tracmd
jms put
"** 07-13-19.pdf page 25
cla
jms put
lac oldsum
@@ -185,7 +182,6 @@ boot:
2:
jms get1-boot+org
dac cmd-boot+org
"** 07-13-19.pdf page 26
jms get1-boot+org
cma
dac cnt-boot+org
@@ -235,7 +231,7 @@ mes:
comand: 0
tracmd: 0
d1: 1
o17777: 017777
.17777: 017777
o77: 077
o200: 0200
o300: 0300
@@ -247,7 +243,6 @@ punout: <pp>;<to>;<ut>;040040
o17: 017
fi: 0
"** 07-13-19.pdf page 27
fo: 0
count: 0
oldsum: 0
@@ -258,4 +253,4 @@ initcmd: dac 0
c1: 0
buf:
iot = 0700000
iot = 0700000
+4 -12
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 30
" ds
lac 017777 i
@@ -61,13 +60,12 @@ loop:
lac i1 i
sad ddfilp i
jmp 2f
"** 07-13-19.pdf page 31
isz i1
isz c1
jmp 1b
lac ddfilp
tad d1
tad i1
dac i1
lac i1 i
dac .+3
@@ -111,7 +109,7 @@ loop:
dzm fflg
law fbuf
dac i2
-1
r1
tad nfiles
cma
dac c2
@@ -122,11 +120,10 @@ loop:
sad i2 i
skp
jmp 3f
"** 07-13-19.pdf page 32
-1
tad i1
dac i3
lac i3 i
iac i3 i
dac c3
law fbuf
dac i3
@@ -184,7 +181,6 @@ loop:
jms putname; scrname
jms putname; dd
law 012
"** 07-13-19.pdf page 33
jms putc
3:
@@ -246,7 +242,6 @@ longout: 0
lac statbuf+10
jms octal; -5
jmp longout i
"** 07-13-19.pdf page 34
readdir: 0
law 012
@@ -308,7 +303,6 @@ readdir: 0
lac i1
dac 8
lac 8 i
"** 07-13-19.pdf page 35
dac fsopt i
isz fsopt
lac 8 i
@@ -370,7 +364,6 @@ octal: 0
jmp 1b
lac octal i
dac c
"** 07-13-19.pdf page 36
1:
ecla llss 3
tad o60
@@ -432,7 +425,6 @@ putc: 0
spa
jmp 1f
lac 2f i
"** 07-13-19.pdf page 37
xor 2f+1
jmp 3f
1:
@@ -494,7 +486,6 @@ ddfilp: .=.+1
ddfiles: .=.+1
statbuf: .=.+13
c: .=.+1
"** 07-13-19.pdf page 38
i1: .=.+1
i2: .=.+1
i3: .=.+1
@@ -507,3 +498,4 @@ fsopt: .=.+1
fsobuf: .=.+64
dbuf: .=.+100
fbuf:
+1 -3
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 42
" dskio
dskrd0: 0
@@ -61,7 +60,6 @@ iskio: 0
dssf
jmp .-1
dsrs
"** 07-13-19.pdf page 43
sma
jmp 1f
isz 3f
@@ -77,4 +75,4 @@ o200000: 0200000
dskbufp: dskbuf
side: .=.+1
dskbuf: .=.+640
dskbuf: .=.+640
+1 -2
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 41
" dskres
iof
@@ -24,4 +23,4 @@
track: 0
c1: 0
d10: 10
d10: 10
-1
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 40
" dsksav
iof
+3 -6
View File
@@ -1,7 +1,6 @@
"** 08-rest.pdf page 8
"[handwritten page number top right of scan - 1]
" ed1
lac d1
sys write; 1f; 3
lac o17
@@ -33,7 +32,6 @@
jmp advanc
1:
<ed>; <it>; 012
advanc:
jms rline
lac linep
@@ -94,7 +92,6 @@ comand:
sad o75
jmp ceq
jmp error
ca:
jms newline
jms setfl
@@ -152,7 +149,7 @@ cp1:
lac d1
sys write; line; 2: 0
lac addr1
sad addr2
sad addr1
jmp advanc
tad d1
dac addr1
@@ -219,7 +216,6 @@ cr:
isz c1
jmp 2b
jmp 1b
cw:
jms setfl
lac i addr1
@@ -250,7 +246,7 @@ cw:
sna
jmp 3f
isz num
jms putsc; tal1
jmp putsc; tal1
isz c2
"** 08-rest.pdf page 12
"[handwritten page number top right of scan - 5]
@@ -714,6 +710,7 @@ addline: 0
jmp 1b
jmp i addline
getdsk: 0 "[the entire getdsk procedure was surrounded
and o776000 " by a box that was Xed out]:
sad diskin " --
+3 -4
View File
@@ -81,7 +81,6 @@ cs:
skp
jmp 3b
jms addline
2:
lac addr1
sad addr2
@@ -202,7 +201,7 @@ cadvanc:
"sad o52
"jmp clsure
dac 1f
jms comp
jmp comp
1; jms matchar; 1: 0; 0
jmp cadvanc
@@ -342,7 +341,7 @@ found: 0
jmp 2f
jmp 3f
1: "???
lac lchrno
lac charno
cma
tad charno
spa
@@ -516,5 +515,5 @@ line: .=.+64
nlist: .=.+50
clist: .=.+50
compbuf: .=.+100
dskbuf: .=.+1024 "[line crossed out - scan markup]
dskbuf: .=.+1 "[line crossed out - scan markup]
lnodes: .=.+1000
+29 -30
View File
@@ -1,5 +1,4 @@
"** 09-1-35.pdf page 1
"[handwritten in the top center of scan - fop.s ]
jms = 0100000
"
q:0
@@ -87,49 +86,49 @@ fdv = jms q
lac hms
sna
sys save
ral "[box drawn around instruction - scan markup]
dac 2f "[separate box around the three dac instructions - scan markup]
ral
dac 2f
dac 3f
dac 4f
-1
tad hexp "[-\ - scan markup]
cma "[ | delta aep??? - scan markup]
tad aexp "[ | - scan markup]
dac aexp "[-/ / Ams \ - scan markup]
lac ans "[hand written to the right: Rem | --- | Hls??? - scan markup]
lmq "[ \ Hms / ----- - scan markup]
lac ams "[circle around ams ---------- Hms - scan markup]
sna cll "[ Hms - scan markup]
tad hexp
cma
tad aexp
dac aexp
lac ans
lmq
lac ams
sna cll
jmp 8f
div
2:0
szl
sys save
dac ce10 "[arrow pointing from ce10 to "REm" +-----+-----+ - scan markup]
lacq "[ handwritten to the right: | A |+ B | - scan markup]
dac 5f "[circle around 5f +-----+-----+ - scan markup]
lac ce10 "[ | C |+ D | - scan markup]
frdiv "[ +-----+-----+ - scan markup]
3:0 "[line from 3:0 to a circled "Hms" - scan markup]
dac ce10
lacq
dac 5f
lac ce10
frdiv
3:0
szl
sys save
lacq
dac ce10 "[line from ce10 to text "Q1" - scan markup]
dac ce10
lac hls
and o377777
frdiv "[ X - scan markup]
4:0 "[handwritten to the right: ----- - scan markup]
szl "[ A+B - scan markup]
frdiv
4:0
szl
sys save
lacq
dac 2b "[circle around 2b with arrow pointing to the right
dac 2b
spa cla
"** 09-1-35.pdf page 3
-1 "[vertical line to the right of instructions... - scan markup]
-1
tad 2b
cll "[underlined ...vertical line ends here - scan markup]
cll
mul
5:0 "[line from 5:0 to "Q" - scan markup]
5:0
dzm 2b
spa
isz 2b
@@ -140,11 +139,11 @@ fdv = jms q
isz 3b
skp
isz 2b
lac ce10 "[lac ce10 circled - scan markup]
lac ce10
lmq
lac 3b
sna
jmp 6f "[arrow pointing down starts to the right of 6f - scan markup]
jmp 6f
cma
tad d1
stl
@@ -152,7 +151,7 @@ fdv = jms q
lmq
szl
isz 2b
6:lac 2b "[arrow above points to between this instruction and the next one - scan markup]
6:lac 2b
sma
tad d1
tad 5b
@@ -725,7 +724,7 @@ sqrt = jms q
xor o200000
xor o400000
dac 1f
lac ams "[a centered dot drawn after ams - scan markup]
lac ams
frdiv; 1:..
szl
clq
@@ -779,7 +778,7 @@ sres: 0;0;0
rsign: 0
sign: 0
fp1: 1;0200000;0
fp1: 1;0200000; 0
o400000: 0400000
o640500: 0640500
+7 -12
View File
@@ -1,20 +1,19 @@
" init
"** 07-13-19.pdf page 47
-1
sys intrp
jms init1
jms init2
l:
1:
sys rmes
sad pid1
jmp 1f
sad pid2
jms init2
jmp l
jmp 1
1:
jms init1
jmp l
jmp 1
init1: 0
sys fork
@@ -53,7 +52,7 @@ login:
dac 9
2:
lac 8 i
sad o12
sac o12
lac o72
sad 9 i
skp
@@ -61,7 +60,6 @@ login:
sad o72
skp
jmp 2b
"** 07-13-19.pdf page 48
lac 9 i
sad o72
jmp 1f
@@ -122,7 +120,6 @@ login:
cll; als 3
omq
dac nchar
"** 07-13-19.pdf page 49
jmp 1b
2:
lac nchar
@@ -184,7 +181,6 @@ rline: 0
sad 8
jmp 1b
-1
"** 07-13-19.pdf page 50
tad 8
dac 8
jmp 1b
@@ -229,7 +225,7 @@ gchar: 0
lac bufp
dac tal
lac d2
sys read; buf; 64
sys tead; buf; 64
sna
jmp error
jmp gchar+1
@@ -242,11 +238,10 @@ error:
sys exit
m1:
012;<lo>;<gi>;<n;<:;<
012; <lo>;<gi>;<n;<:;<
m1s = .-m1
m2:
<?; 012
"** 07-13-19.pdf page 51
m2s = .-m2
m3:
<pa>;<ss>;<wo>;<rd>;<: 040
@@ -274,7 +269,7 @@ password:
d1: 1
o43: 043
o100: 0100
o400000: 0400000
o400000; 0400000
d2: 2
o12: 012
om60: -060
+6 -5
View File
@@ -8,9 +8,9 @@
spa; jmp error; dac track
tad dm10; sma; jmp error
sys open; a.out; 0
sysopen; a.out; 0
spa; jmp error
sys read; bufp: buf; 3072
sys read; bufp; buf; 3072
sad .-1
jmp error
@@ -18,7 +18,7 @@
-3072; dslw
lac bufp; dslm
lac track; alss 8; xor o300000; dsld
lac o3000; dsls
lac o30000; dsls
dssf; jmp .-1
dsrs; spa; jmp error
-1024; dslw
@@ -35,10 +35,10 @@ error:
1: 077077;012
dm10: -10
d5: 5
dm5: 5
om60: -060
o300000: 0300000
o300110: 0300110
o300100: 0300110
d8: 8
d3072: 3072
o3000: 03000
@@ -49,3 +49,4 @@ a.out:
track: .=.+1
buf:
+1 -1
View File
@@ -181,7 +181,7 @@ loop:
dac ball1+vx
2:
lac toptest
tad ball1+y
tad ball1+vy
spa
jmp 2f
jms pockettb
+18 -18
View File
@@ -9,24 +9,24 @@
tad d1
dac .pbp1
restart:
fld; arg1 "[ g = arg1 - scan markup]
fst; g "[ fact = arg2 - scan markup]
fld; arg2 "[ d = 1.0 - scan markup]
fst; fact "[ z = 0 - scan markup]
fld; fp01 "[ oldx = 0 - scan markup]
fst; d "[ oldy = 0 - scan markup]
jms capture "[loop: - scan markup]
-100 "[ b = z - 110. - scan markup]
dac j "[ ---------- - scan markup]
fld; fp0 "[ radians - scan markup]
fst; z "[ z = z + g - scan markup]
fst; oldx "[ g = -g * fact - scan markup]
fst; oldy "[ fact = 1 / fact - scan markup]
lac o400000 "[ xx = 500. * d * sin(b + pi/2) - scan markup]
dac i 11 "[ ni() - scan markup]
dac i 11 "[ yy = 500. * d * sin(b) - scan markup]
lac setx "[ ni() - scan markup]
dac i 10 "[ goto loop " an arrow points up to loop: above - scan markup]
fld; arg1
fst; g
fld; arg2
fst; fact
fld; fp01
fst; d
jms capture
-100
dac j
fld; fp0
fst; z
fst; oldx
fst; oldy
lac o400000
dac i 11
dac i 11
lac setx
dac i 10
lac sety
dac i 10
+2 -3
View File
@@ -116,7 +116,7 @@
lac u.base
jms iget
lac ii
dac d.i
dzm d.i
jms copy; name; d.name; 4
lac i.uniq
dac d.uniq
@@ -134,7 +134,7 @@
lac d1
dac mode
jms access
dzm d.i
dac d.i
jms dput
lac u.base
jms iget
@@ -166,7 +166,6 @@
dac mode
jms access
jms copy; 1:0; d.name; 4
jms dput
jmp okexit
.time:
+2 -5
View File
@@ -70,7 +70,7 @@ lookfor: 0
isz u.rq+8
dzm u.intflg
jmp sysexit
t = t+1
t= t+1
badcal:
clon
@@ -258,10 +258,6 @@ rkbdi:
sad o134
skp
jmp 2f
lacq
xor o40
lmq
jmp 2f
1:
lacq
xor o20
@@ -295,6 +291,7 @@ wdspo:
jms swap
jmp wdspo
rppti:
lac d4
jms getchar
+1 -1
View File
@@ -317,7 +317,7 @@ cskp:
lac 9f+t+3
jms dskwr
4:
"** 01-s1.pdf page 39
"** 01-s1.pdf page 38
lac 9f+t+2
jmp iread i
3:
+2 -2
View File
@@ -92,9 +92,9 @@ dsprestart:
dac .dsptm
jmp piret
1: sma ral
1: sna ral
jmp .+3
raef
dpcf
jmp piret
sma
jmp 1f
+4 -4
View File
@@ -95,7 +95,7 @@ dm1: -1
9: .=.+t
c1: .=.+1
q1: q2;q2+98
q1: q2;q2+90 "** ?? 98 ??
.=.+14
q2:
.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0;.+2;0
@@ -107,7 +107,7 @@ dsploc: .=.+1
dsplno: .=.+1
dspbuf:
0065057;0147740;0160000
. = . + 30
.=.+30
coldentry:
dzm 0100 " not re-entrant
caf
@@ -178,7 +178,7 @@ ulist:
userdata:
u.ac: 0
u.mq: 0
u.rg: .=.+9
u.rq: .=.+9
u.uid: -1
u.pid: 1
u.cdir: 3
@@ -200,7 +200,7 @@ inode:
i.nlks: .=.+1
i.size: .=.+1
i.uniq: .=.+1
. = inode+12
.= inode+12
di: .=.+1
dnode:
d.i: .=.+1
+7 -6
View File
@@ -25,27 +25,26 @@ sma = 0740100
sza = 0740200
snl = 0740400
skp = 0741000
spa = 0741100
sna = 0741200
szl = 0741400
rtl = 0742010
rtr = 0742020
cll = 0744000
cil = 0744000
rcl = 0744010
rcr = 0744020
cla = 0750000
cia = 0750000
lrs = 0640500
lrss = 0660500
lls = 0640600
llss = 0660600
als = 0640700
alss = 0660700
mul = 0653122
mul = 0653323
idiv = 0653323
lacq = 0641002
clq = 0650000
omq = 0640002
cmq = 0640004
omq = 0650002
cmq = 0650004
lmq = 0652000
dscs = 0707141
@@ -61,6 +60,7 @@ ion = 0700042
caf = 0703302
clon = 0700044
clsf = 0700001
"** 01-s1.pdf page 63
clof = 0700004
ksf = 0700301
@@ -94,3 +94,4 @@ dpcf = 0704761
dprc = 0704712
crsf = 0706701
crrb = 0706712
+13 -13
View File
@@ -3,7 +3,7 @@
t = 0
start: "[------ stuff for gravity - scan markup]
start:
law 13
sys sysloc
dac .pbson
@@ -40,9 +40,9 @@ start: "[------ stuff for gravity - scan markup]
dzm .pbsint
dzm forflg
dzm bacflg
dzm dspflg "[line connecting this instruction to... - scan markup]
dzm dspflg
dzm locflg
dzm locpar "[... this instruction - scan markup]
dzm locpar
lac d1
dac par
jms dispname
@@ -68,13 +68,13 @@ start: "[------ stuff for gravity - scan markup]
loop:
law dspl-1
dac clistp
jms contrl "[arrow from below points to this instruction - scan markup]
jms contrl
lac par
jms absxy
jms shipxy
lac goflg
spa
jmp loop3 "[long dash after loop3 - scan markup]
jmp loop3
fld; fpzero
fst; ax
fst; ay
@@ -107,8 +107,8 @@ loop2:
sma
jms updshp
loop3:
fld; horizv "[a box enclosing all code from loop3 to loop4 - scan markup]
lac scale "[arrow drawn from box up to location above - scan markup]
fld; horizv
lac scale
cma
tad vscale
tad aexp
@@ -116,12 +116,12 @@ loop3:
jms inscr
jmp loop4
tad o141577
dac i clistp "[crossed out with an arrow pointint to "dac dspvel" - scan markup]
lac o164372 "[crossed out - scan markup]
dac clistp i "[crossed out - scan markup]
cla "[crossed out - scan markup]
jms dsplanet "[crossed out - scan markup]
loop4: "[inside a drawn box - scan markup]
dac i clistp
lac o164372
dac clistp i
cla
jms dsplanet
loop4:
sys time "put delay here.....
"** 12-92-119.pdf page 3
dzm dispcl
+1 -1
View File
@@ -26,7 +26,7 @@ updshp: 0
sma
jmp .+3
2:
lac accflg "[arrow pointing here from the text "how to set?" - scan markup]
lac accflg
sma
jmp .+3
fad; maxa
+19 -19
View File
@@ -6,27 +6,27 @@ displa: 0
sad cplan
skp
jmp 2f
lac locflg "[arrow points here from the text "how to set?" - scan markup]
lac locflg
sma
jmp 1f
fld; cphi "[-\ - scan markup]
fmp; absy "[ | - scan markup]
fst; ftmp1 "[ | - scan markup]
fld; sphi "[ | - scan markup]
fmp; absx "[ | - scan markup]
fad; ftmp1 "[ | - scan markup]
fdv; dpar "[ | - scan markup]
fst; stheta "[ \ lock calculation - scan markup]
fld; sphi "[ / - scan markup]
fmp; absy "[ | - scan markup]
fng "[ | - scan markup]
fst; ftmp1 "[ | - scan markup]
fld; cphi "[ | - scan markup]
fmp; absx "[ | - scan markup]
fad; ftmp1 "[ | - scan markup]
fdv; dpar "[ | - scan markup]
fst; ctheta "[ | - scan markup]
jmp 2f "[-/ - scan markup]
fld; cphi
fmp; absy
fst; ftmp1
fld; sphi
fmp; absx
fad; ftmp1
fdv; dpar
fst; stheta
fld; sphi
fmp; absy
fng
fst; ftmp1
fld; cphi
fmp; absx
fad; ftmp1
fdv; dpar
fst; ctheta
jmp 2f
1:
fld; sphi
fst; stheta
+2 -2
View File
@@ -152,7 +152,7 @@ dssca:
dsety 255
vecy 767
dsetx 127
dsety 639 "[--- - scan markup]
vecx 767 "[an arrow starts between vecx and dspl, it points to the right - scan markup]
dsety 639
vecx 767
dspl:
0400000
+18 -25
View File
@@ -1,30 +1,29 @@
"** 01-s1.pdf page 57 -- system assembly map
. 004671 r
.ac 004102 r
. 004671 r
.ac 004012 r
.chown 000426 r
.close 000725 r
.capt 000404 r
.creat 000665 r
.creat 000665 r
.chdir 000622 r
.chmod 000414 r
.chmod 000414 r
.dskb 004105 r
.dspb 005547 r
.dsptm 004104 r
.dske 004106 r
.exit 001170 r
.fork 001116 r
.getuid 000433 r
.getuid 000433 r
.halt 001343 r
.int1 004100 r
.insys 004077 r
.int2 004101 r
.intrp 000257 r
.link 000474 r
.link 000474 r
.lpba 005550 r
.open 000633 r
.rmes 001204 r
.rele 000410 r
.rename 000574 r
.rename 000547 r
.read 000731 r
.smes 001232 r
.savblk 004103 r
@@ -46,7 +45,7 @@ badcal 001153 r
betwen 001654 r
c1 004270 r
chkint 000320 r
chkint1 001546 r
chkink1 001546 r
char 005522 r
cnop 003453 r
coldentr 004520 r
@@ -61,7 +60,7 @@ d.name 005761 r
d.uniq 005765 r
d.i 005760 r
"** 01-s1.pdf page 58
d0 004127 r
d0 004127 r
d10 004141 r
d1 004130 r
d2 004131 r
@@ -70,7 +69,7 @@ d3 004132 r
d4 004133 r
d5 004134 r
d6 004135 r
d65 004152 r
d65 004155 r
d7999 004166 r
d7 004136 r
d8 004137 r
@@ -96,7 +95,7 @@ dskrd 002127 r
dsktrans 002231 r
dsploc 004455 r
dslot 002474 r
dsplno 004456 r
dspino 004456 r
dspbufp3 004116 r
dspbufp 005506 r
dspresta 003523 r
@@ -106,11 +105,6 @@ dskwr 002157 r
dspput 002551 r
dspleft 002573 r
dspbuf 004457 r
dskswap 002300 r
dspinit 002617 r
dspnl 002605 r
edskbsp 005504 r
edspbuf 004115 r
error 001542 r
exitrw 001041 r
f.badd 005771 r
@@ -122,8 +116,8 @@ fget 002371 r
finac 003401 r
fnode 005770 r
"** 01-s1.pdf page 59
forall 002423 r
fput 002413 r
forall 002434 r
fput 003413 r
free 001615 r
getchar 001756 r
getw 004635 r
@@ -176,11 +170,11 @@ o100000 004177 r
o140000 004200 r
o14 004142 r
o15 004143 r
o155 004157 r
0155 004157 r
o2000 004164 r
o200001 004262 r
o20001 004172 r
o20 004145 r
020 004145 r
o212 004161 r
o200000 004201 r
"** 01-s1.pdf page 60
@@ -189,7 +183,6 @@ o33 004146 r
o300000 004203 r
o4000 004165 r
o40000 004173 r
o40001 004174 r
o40 004147 r
o400000 004204 r
o500000 004205 r
@@ -198,7 +191,7 @@ o577777 004206 r
o600000 004207 r
o640000 004210 r
o777 004163 r
o77 004151 r
o77 004157 r
o70000 004175 r
o77777 004176 r
o777760 004213 r
@@ -259,8 +252,8 @@ u.limit 005664 r
u.cdir 005657 r
u.count 005663 r
u.base 005662 r
u.rg 005644 r
ulist 005572 r
u.rq 005644 r
ulsit 005562 r
uniqpid 005524 r
uquant 005505 r
userdata 005642 r
+1 -1
View File
@@ -258,7 +258,7 @@ pbadr: .=.+1
blink: .=.+1
blk1: .=.+1
blk2: .=.+1
9: .=.+t
9: .=.+1
stack:
dnop = 040040
+1 -1
View File
@@ -37,7 +37,7 @@ error:
mes:
077; 012
n.out:
<n.>;<ou>;<t 040;040040
<n.>;<ou>;<t 040; 040040
d1: 1
d6: 6
View File
-10
View File
@@ -1,4 +1,3 @@
"** 05-1-4.pdf page 2
" adm
lac 017777 i
@@ -61,7 +60,6 @@ floop1:
dac fi
-1
"** 05-1-4.pdf page 3
tad name
dac 8
-4
@@ -123,7 +121,6 @@ eof:
dac buf+3 " final check sum
jms putcard
jmp floop
"** 05-1-4.pdf page 4
getword: 0
lac ipt
@@ -185,7 +182,6 @@ putcard: 0
jmp floop
"** 05-1-4.pdf page 5
ferror:
lac name
dac 1f
@@ -247,7 +243,6 @@ disflg: 0
flush: 0
lac noc
sna
"** 05-1-4.pdf page 6
jmp flush i
law 0104
jms message; tbuf
@@ -309,7 +304,6 @@ putw: 0
1: 0
putc: 0
"** 05-1-4.pdf page 7
and o177
dac opt i
-0141
@@ -370,7 +364,6 @@ connect: 0
and ilock
sna
jmp 1b
"** 05-1-4.pdf page 8
law 041
dac echoch
law 0102
@@ -432,7 +425,6 @@ retry:
jms transch
isz c2
jmp 1b
"** 05-1-4.pdf page 9
" put out etx character
2:
@@ -494,7 +486,6 @@ retry:
lac opch
sad o122
jmp i message
"** 05-1-4.pdf page 10
lac disflg
sna
jmp discon
@@ -556,7 +547,6 @@ d14: 14
o400000: 0400000
o577777: 0577777
o200500: 0200500
"** 05-1-4.pdf page 11
o122: 0122
o3: 3
o2: 2
+1 -11
View File
@@ -79,7 +79,7 @@ cloop:
jmp 1f
dac 0f
lac fo
sys write; obuf; 0:..
sys write; obuf; 0;..
1:
lac fo
sys close
@@ -229,16 +229,6 @@ putword: 0
jmp putword i
jmp putword i
ferror:
lac buf
dac 1f
lac d1
sys write; 1:..; 4
lac d1
sys write; 1f; 1
jmp loop
1: 077012
d1: 1
d2048: 2048
d14: 14
+1 -1
View File
@@ -593,7 +593,7 @@ transcd: 0
jms transch
isz c2
jmp 1b
jmp transcd i
jmp transch i
transch: 0
lmq
+1 -6
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 7
" bc
jmp start
@@ -61,7 +60,6 @@ trace: 0
jmp trace i
dtrace: 0
"** 06-5-12.pdf page 8
lac pc
dac 8
lac 8 i
@@ -123,7 +121,6 @@ dspblk: 0
dac t1
dzm t2
1:
"** 06-5-12.pdf page 9
lac t1
sna
jmp 1f
@@ -185,7 +182,6 @@ histog: 0
tad histbuf
dac t1
isz t1 i
"** 06-5-12.pdf page 10
jmp histog i
jmp .
@@ -213,7 +209,7 @@ olddp: 0
dspbuf: 0
dspbp: 0
instr: 0
pbs: 0
obs: 0
inslitr: n 5
insasg: b 1
o17: 017
@@ -247,7 +243,6 @@ badsp:
badasgn:
jms flush
lac d1
"** 06-5-12.pdf page 11
sys write; mas; mass
jmp stop
mpc:
-8
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 12
" bi
start:
@@ -61,7 +60,6 @@ binop:
tad .+3
dac .+1
jmp .. i
"** 06-5-12.pdf page 13
jmp . i
basg; bor; band; beq; bne; ble; blt; bge; bgt; brsh; blsh
badd; bmin; bmod; bmul; bdiv
@@ -123,7 +121,6 @@ blt:
bge:
lac t1 i
cma
"** 06-5-12.pdf page 14
tad t2 i
spa cla
lac d1
@@ -185,7 +182,6 @@ bdiv:
consop:
lac sp
"** 06-5-12.pdf page 15
tad d1
dac sp i
isz sp
@@ -247,7 +243,6 @@ call:
lac 8 i
dac t1
lac t1 i
"** 06-5-12.pdf page 16
dac 9 i
isz 8
-1
@@ -308,7 +303,6 @@ goto:
tad t1 i
dac pc
jmp fetch
"** 06-5-12.pdf page 17
retrn:
-2
@@ -371,7 +365,6 @@ unaop:
uadr; umin; uind; unot
uadr:
"** 06-5-12.pdf page 18
lac t1
dac t3 i
jmp fetch
@@ -434,7 +427,6 @@ addr: 0
pc = 017
"** 06-5-12.pdf page 19
sp: stack
dp: stack
ap: stack
-4
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 3
" bl
jmp start
@@ -61,7 +60,6 @@ getc: 0
lac cibufp
sad eibufp
jmp 1f
"** 06-5-12.pdf page 4
lac cibufp i
and o777
dac iflg
@@ -123,7 +121,6 @@ stop:
flush: 0
lac oflg
sza
"** 06-5-12.pdf page 5
isz cobufp
lac cobufp
cma
@@ -185,7 +182,6 @@ initio: 0
.fin: 0
.fout: 1
eibufp: 0
"** 06-5-12.pdf page 6
cibufp: 0
iflg: 0
eobufp: 0
+551
View File
@@ -0,0 +1,551 @@
:ca
v
af
nl
x
hd
v
hi
x
mn
r
:cb
x
ga
v
gi
ik
kk
mi
ma
aa
ai
ck
ek
gi
x
mn
r
:cc
x
kk
v
mi
mc
ka
ca
ac
ai
dl
x
mn
r
:cd
v
aa
ai
ck
kk
mi
ma
x
mn
r
:ce
x
mk
v
ma
aa
ak
x
gh
v
ga
x
mn
r
:cf
v
aa
ak
x
gh
v
ga
x
mn
r
:cg
x
gf
v
gk
nk
x
kk
v
mi
mc
ka
ca
ac
ai
dl
x
mn
r
:ch
x
aa
v
na
x
gb
v
gk
x
ak
v
nk
x
mn
r
:ci
x
md
v
mi
x
lf
v
af
x
ad
v
ai
x
mn
r
:cj
x
ka
v
mc
mg
ki
ai
x
ag
v
al
x
mn
r
:ck
x
aa
v
na
x
ak
v
ia
x
mk
v
fe
x
mn
r
:cl
x
aa
v
ma
mk
x
mn
r
:cm
v
aa
hf
ak
nk
x
mn
r
:cn
x
ak
v
mk
aa
na
x
mn
r
:co
x
ai
v
ch
ei
ck
ai
ac
ca
ka
mc
mi
kk
ck
x
mn
r
:cp
v
aa
ai
ck
ek
gi
ga
x
mn
r
:cq
x
mc
v
ka
ca
ac
ai
ck
kk
mi
mc
x
jh
v
nl
x
mn
r
:cr
v
aa
ai
ck
ek
gi
ga
x
mk
v
gf
x
mn
r
:cs
x
ka
v
mc
mi
kk
ik
gi
gc
ea
ca
ac
ai
dl
x
mn
r
:ct
x
aa
v
al
x
mf
v
af
x
mn
r
:cu
x
aa
v
ka
mc
mi
kk
x
ak
v
lk
x
mn
r
:cv
x
aa
v
mf
x
ak
v
mf
x
mn
r
:cw
x
aa
v
mc
af
x
ak
v
mi
af
x
mn
r
:cx
v
gf
x
ak
v
gf
x
aa
v
nl
x
mn
r
:cy
x
aa
v
if
x
ak
v
if
nf
x
mn
r
:cz
x
aa
v
ak
ma
ml
x
mn
r
:c0
x
ck
v
ai
ac
ca
ka
mc
mi
kk
ck
x
mn
r
:c1
x
ce
v
af
mf
x
md
v
mi
x
mn
r
:c2
x
ca
v
ac
ai
ck
ek
gi
gc
ia
ma
ml
x
mn
r
:c3
x
aa
v
ak
fe
fi
hk
kk
mi
mc
x
ka
v
nd
x
mn
r
:c4
x
mh
v
ah
ia
il
x
mn
r
:c5
x
ak
v
aa
fa
fi
hk
kk
mi
mc
x
ka
v
nd
x
mn
r
:c6
x
ck
v
ai
ac
ca
ka
mc
mi
kk
hk
fi
fc
ha
x
mn
r
:c7
x
aa
v
ak
nb
x
mn
r
:c8
x
gc
v
ea
ca
ac
ai
ck
ek
gi
gc
ia
ka
mc
mi
kk
ik
gi
x
mn
r
:c9
x
ka
v
mc
mi
kk
ck
ai
ac
ca
fa
hc
hi
fk
x
mn
r
-3
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 21
" cat: cat arg1 [arg2 ...]
" Load the pointer pointer in 017777 to see if we have any arguments
@@ -64,7 +63,6 @@ done:
and d1
sna cla
jmp 1f
"** 06-5-12.pdf page 22
jms putc " Store the character in the buffer
jmp done " and loop back
1:
@@ -128,7 +126,6 @@ putc: 0
sad d128
skp
jmp putc i " No, so return (more room still in the buffer)
"** 06-5-12.pdf page 23
lac fo " Load fd1 (i.e stdout)
sys write; iopt+1; 64 " and write out the 64 words in the buffer
lac iopt
+1 -7
View File
@@ -1,4 +1,3 @@
"** 06-5-12.pdf page 25
" check
lac d1
@@ -61,7 +60,6 @@ iloop:
lac iflags
and o40
sza
"** 06-5-12.pdf page 26
jmp iloop
law idskps
dac t1
@@ -123,7 +121,6 @@ dupcheck: 0
lac d1
2: alss 0
dac bit
"** 06-5-12.pdf page 27
lac i t6
and bit
sza
@@ -173,7 +170,7 @@ print: 0
part2:
lac icnt
jms print
jmp print
lac d1
sys write; m3; m3s
lac licnt
@@ -185,7 +182,6 @@ part2:
lac d1
sys write; m5; m5s
lac blcnt
"** 06-5-12.pdf page 28
jms print
lac d1
sys write; m6; m6s
@@ -247,7 +243,6 @@ part3:
cla
llss 4
tad alsscom
"** 06-5-12.pdf page 29
dac 2f
lac d1
2: alss 0
@@ -309,7 +304,6 @@ t1: 0
t2: 0
t3: 0
t4: 0
"** 06-5-12.pdf page 30
t5: 0
t6: 0
-20
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 2
" db
"** pages 2-21 of 07-13-19.pdf
" Usage: db [ corefile [ namelist ] ]
@@ -63,7 +62,6 @@ wcorep: corename; 1
"
lac o52012 " prompt: "*\n"
jms wchar
"** 07-13-19.pdf page 3
law dotdot
dac nsearch
jms nlsearch
@@ -125,7 +123,6 @@ cmd:
jmp saddress
sad o75 " '='?
jmp address
"** 07-13-19.pdf page 4
sad o57 " '/'?
jmp octal
sad o72 " ':'?
@@ -187,7 +184,6 @@ saddress:
lac 9f
dac curdot
jmp mloop
"** 07-13-19.pdf page 5
9:0
"
symbol:
@@ -249,7 +245,6 @@ print:
spa
jmp error
lac rcore
"** 07-13-19.pdf page 6
sys read; inbuf; 64
spa
jmp error
@@ -311,7 +306,6 @@ prdec: "temp
proct:0
jms octw
6
"** 07-13-19.pdf page 7
jmp i proct
"
patch:
@@ -373,7 +367,6 @@ getexp:0
xloop:
jms rch
lmq
"** 07-13-19.pdf page 8
sad o044
skp
jmp 1f
@@ -435,7 +428,6 @@ xloop:
lac o40
sad rator
skp
"** 07-13-19.pdf page 9
jmp error
lacq
dac rator
@@ -497,7 +489,6 @@ spcai:
lac d1
dac reloc
jmp i getspec
"** 07-13-19.pdf page 10
"
getsym:0
lmq
@@ -559,7 +550,6 @@ skipt:
spa
jmp 2f " lc letter
1:
"** 07-13-19.pdf page 11
lac nchar1
tad om101
spa
@@ -621,7 +611,6 @@ num1:
jmp i getnum
tad om10
sma
"** 07-13-19.pdf page 12
jmp i getnum
lac nchar1
dzm nchar1
@@ -683,7 +672,6 @@ prsym:0 " print symbolic instruction
dac word
dzm relflg
dzm relocflg
"** 07-13-19.pdf page 13
dzm nsearch
and o760000
sad o760000
@@ -745,7 +733,6 @@ pr1:
tad d1
dac addr
lac o55
"** 07-13-19.pdf page 14
jms wchar
jmp 2f
1:
@@ -807,7 +794,6 @@ peae: " print EAE instruction
jmp i prsym
1:
law eaes
"** 07-13-19.pdf page 15
dac addr
jmp nfnd
"
@@ -869,7 +855,6 @@ pcal:
law syss
jms wrname
lac o40
"** 07-13-19.pdf page 16
jms wchar
lac addr
jms wrname
@@ -931,7 +916,6 @@ nloop:
lacq
tad d3
dac np
"** 07-13-19.pdf page 17
lac i np
sna
jmp nloop
@@ -993,7 +977,6 @@ testn:
skp
jmp nloop
isz minp
"** 07-13-19.pdf page 18
isz inbuf
isz value
jmp 1b
@@ -1055,7 +1038,6 @@ nlerr:
"
rch:0
lac nchar1
"** 07-13-19.pdf page 19
dzm nchar1
sza
jmp i rch
@@ -1117,7 +1099,6 @@ d12:12
d8:8
d3:3
o177:0177
"** 07-13-19.pdf page 20
o136: 0136
o45: 045
sysflag: 0
@@ -1179,7 +1160,6 @@ nchar1:0
nchar:0
o177000:0177000
o56040:056040 " ". "
"** 07-13-19.pdf page 21
nsearch:0
word:0
relflg:0
-5
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 23
" dmabs
" takes a list of files on command line and punches out each
@@ -75,7 +74,6 @@ dump2: " (label not used)
dump3: " block loop
-1 " reset i8 to buffer
tad bufp
"** 07-13-19.pdf page 24
dac 8
-64 " get count
dac c1
@@ -137,7 +135,6 @@ dump4: " end of block
done: " here at end of input file
lac tracmd " get transfer command (jmp)
jms put " write to tape
"** 07-13-19.pdf page 25
cla " write a zero word
jms put
lac oldsum " get checksum
@@ -199,7 +196,6 @@ boot:
2:
jms get1-boot+org " get command word from tape
dac cmd-boot+org
"** 07-13-19.pdf page 26
jms get1-boot+org " get count from tape
cma
dac cnt-boot+org " store complemented (incremented below)
@@ -261,7 +257,6 @@ punout: <pp>;<to>;<ut>;040040
o17: 017
fi: 0
"** 07-13-19.pdf page 27
fo: 0
count: 0
oldsum: 0
+3 -10
View File
@@ -1,4 +1,3 @@
"** 07-13-19.pdf page 30
" ds
lac 017777 i
@@ -66,13 +65,12 @@ loop:
lac i1 i
sad ddfilp i
jmp 2f
"** 07-13-19.pdf page 31
isz i1
isz c1
jmp 1b
lac ddfilp
tad d1
tad i1
dac i1
lac i1 i
dac .+3
@@ -129,7 +127,6 @@ loop:
sad i2 i
skp
jmp 3f
"** 07-13-19.pdf page 32
-1
tad i1
dac i3
@@ -192,7 +189,6 @@ loop:
jms putname; scrname
jms putname; dd
law 012
"** 07-13-19.pdf page 33
jms putc
3:
@@ -254,7 +250,7 @@ longout: 0
lac statbuf+10
jms octal; -5
jmp longout i
"** 07-13-19.pdf page 34
readdir: 0
law 012
jms putc
@@ -317,7 +313,6 @@ readdir: 0
lac i1
dac 8
lac 8 i
"** 07-13-19.pdf page 35
dac fsopt i
isz fsopt
lac 8 i
@@ -382,7 +377,7 @@ octal: 0
lac octal i " Save the actual number of print digits into c
dac c " as a negative number.
1:
ecla
cla
llss 3 " Shift 3 more bits into AC
tad o60 " Add AC to ASCII '0'
jms putc " and print out the digit
@@ -444,7 +439,6 @@ putc: 0
spa " If the bit was set, we already have one
jmp 1f " character at 2f+1. If no previous character,
lac 2f i " merge the old and new character together
"** 07-13-19.pdf page 37
xor 2f+1
jmp 3f " and go to the "save it in buffer" code
1:
@@ -507,7 +501,6 @@ ddfilp: .=.+1
ddfiles: .=.+1
statbuf: .=.+13
c: .=.+1
"** 07-13-19.pdf page 38
i1: .=.+1
i2: .=.+1
i3: .=.+1
+47 -90
View File
@@ -1,121 +1,78 @@
"** 07-13-19.pdf page 42
" dskio
" Reads 10 blocks from side 0 at block address AC into buffer dskbuf
dskrd0: 0
dzm side " set side to 0
jms dskio; 02000 " read 10 blocks starting at block AC on side 0
jmp i dskrd0 " return to caller
dzm side
jms dskio; 02000
jmp i dskrd0
" Writes 10 blocks from buffer dskbuf onto side 0 at block address AC
dskwr0: 0
dzm side " set side to 0
jms dskio; 03000 " write 10 blocks tarting at block AC on side 0
jmp i dskwr0 " return to caller
dzm side
jms dskio; 03000
jmp i dskwr0
" Reads 10 blocks from side 1 at block address AC into buffer dskbuf
dskrd1: 0
lmq " set side to 1
lmq
lac o200000
dac side
lacq
jms dskio; 02000 " read 10 blocks starting at block AC on side 1
jmp i dskrd1 " return to caller
jms dskio; 02000
jmp i dskrd1
" Writes 10 blocks from buffer dskbuf onto side 1 at block address AC
dskwr1: 0
lmq " Set side to 1
lmq
lac o200000
dac side
lacq
jms dskio; 03000 " write 10 blocks starting at block AC on side 1
jmp i dskwr1 " return to caller
jms dskio; 03000
jmp i dskwr1
" dskio depends on the DSLS_BITS after jump to subroutine:
" jms dskio; DSLS_BITS
" DSLS_BITS 02000 causes a read, 03000 causes a write.
"
" In both cases 10 blocks worth of data is either transferred from
" disk into dskbuf (read), or transferred from dskbuf onto the disk
" (write). A block is the same as a segment, each comprising 64 words.
"
" The location on disk is controlled by the variable "side" and the
" value in AC, representing the number of blocks from the start
" of the side.
"
" dskio takes the block address passed in AC, divides it by 80
" to get the track address, and as a remainder the segment address.
" Both are then re-encoded as BCD, shifted to the correct bit
" positions (explained below) and ORed together with the value of
" the "side" variable (representing the hundreds flag in the disk
" address). This disk address is then passed on to the disk just
" before starting the transfer in chunks of 10 segments each.
"
" The disk address for RB09 disks is formatted like this:
"
" * Bit 0 not used
" * Bit 1 hundreds flag for track address
" * Bits 2-5 Tens digit for track address as BCD
" * Bits 6-9 Units digit for track address as BCD
" * Bits 10-13 Tens digit for segment address as BCD
" * Bits 14-17 Units digit for segment address as BCD
"
" If the disk indicates an error the transfer is attempted 10 times
" before dskio gives up and halts the program.
dskio: 0
cll; idiv; 80 " compute binary track and segment addresses
dac 2f " store binary segment address
lacq " get binary track address back into AC
idiv; 10 " compute BCD track address from binary track address
cll; idiv; 80
dac 2f
lacq
idiv; 10
dac 3f
lls 22
xor 3f " OR together Tens and Units digits of BCD track address
als 8 " shift BCD track address to bit position in disk address
dac 3f " store BCD track address
lac 2f " load binary segment address
idiv; 10 " compute BCD segment address from binary segment address
xor 3f
als 8
dac 3f
lac 2f
idiv; 10
dac 2f
lls 22
xor 2f " OR together Tens and Units digits of BCD segment address
xor 3f " OR together track and segment addresses
xor side " OR together side, track and segment addresses
" to make the complete disk address
dac 2f " store disk address
-10 " do at most 10 transfer attempts
xor 2f
xor 3f
xor side
dac 2f
-10
dac 3f
1:
dscs " clear disk status
-640 " prepare transfer of 10 segments (10 blocks)
dscs
-640
dslw
lac dskbufp " load pointer to dskbuf into MAC
lac dskbufp
dslm
lac 2f " load previously computed disk address
lac 2f
dsld
lac dskio i " load disk status register (one bit is the read/write flag)
lac dskio i
dsls
dssf " wait for ERROR/DONE
dssf
jmp .-1
"** 07-13-19.pdf page 43
dsrs " read disk status into AC, bit 0 indicates errors
sma " if bit 0 of AC is set, AC is negative.
" if AC is negative, continue below and do another
" transfer attempt...
jmp 1f " ...otherwise jump to the subroutine exit code below
isz 3f " increment transfer attempts, and...
jmp 1b " ...retry if more attempts remain
hlt " when no more attempts remain, stop program due to
" persistent disk error
dsrs
sma
jmp 1f
isz 3f
jmp 1b
hlt
1:
isz dskio " skip over argument passed to dskio
jmp i dskio " return to caller
isz dskio
jmp i dskio
2: 0
3: 0
2: 0 " local variable storing first binary segment address,
" then disk address
3: 0 " local variable storing first BCD track address,
" then loop counter
o200000: 0200000
dskbufp: dskbuf
o200000: 0200000 " bit corresponding to set Hundreds flag in disk address
dskbufp: dskbuf " pointer to transfer buffer
side: .=.+1 " which side to access
dskbuf: .=.+640 " transfer buffer for 10 blocks
side: .=.+1
dskbuf: .=.+640
+14 -21
View File
@@ -1,33 +1,26 @@
"** 07-13-19.pdf page 41
" dskres
" Copies the entire file system (except system image and
" swap area) from side 0 of the disk onto same location
" on side 1.
"
" I.e. copies the first 6400 blocks from side 0 to side 1.
iof " disable interrupts
hlt " halt the computer!
dzm track " start copying from block address 0
-640 " transfer 640 chunks of 10 blocks each
iof
hlt
dzm track
-640
dac c1
1:
lac track " read chunk of blocks starting at block "track" on side 0
lac track
jms dskrd0
lac track " write chunk of blocks starting at block "track" on side 1
lac track
jms dskwr1
lac track " proceed to next chunk (of 10 blocks)
lac track
tad d10
dac track
isz c1 " increment chunks transferred, if there are chunks remaining
jmp 1b " ...loop and transfer the next chunk
isz c1
jmp 1b
hlt " ...otherwise halt the computer!
sys exit " call exit system call
hlt
sys exit
track: 0 " block address of chunk to transfer
c1: 0 " number of chunks remaining
d10: 10
track: 0
c1: 0
d10: 10
+13 -20
View File
@@ -1,33 +1,26 @@
"** 07-13-19.pdf page 40
" dsksav
" Copies the entire file system (except system image and
" swap area) from side 1 of the disk onto same location
" on side 0.
"
" I.e. copies the first 6400 blocks from side 1 to side 0.
iof " disable interrupts
hlt " halt the computer!
dzm track " start copying from block address 0
-640 " transfer 640 chunks of 10 blocks each
iof
hlt
dzm track
-640
dac c1
1:
lac track " read chunk of blocks starting at block "track" on side 1
lac track
jms dskrd1
lac track " write chunk of blocks starting at block "track" on side 0
lac track
jms dskwr0
lac track " proceed to next chunk (of 10 blocks)
lac track
tad d10
dac track
isz c1 " increment chunks transferred, if there chunks remaining
jmp 1b " ...loop and transfer the next chunk
isz c1
jmp 1b
hlt " ...otherwise halt the computer!
sys exit " call exit system call
hlt
sys exit
track: 0 " block address of chunk to transfer
c1: 0 " number of chunks remaining
track: 0
c1: 0
d10: 10
+2 -5
View File
@@ -1,7 +1,6 @@
"** 08-rest.pdf page 8
"[handwritten page number top right of scan - 1]
" ed1
lac d1
sys write; 1f; 3 " say hello
lac o17
@@ -33,7 +32,6 @@
jmp advanc
1:
<ed>; <it>; 012
advanc:
jms rline
lac linep
@@ -94,7 +92,6 @@ comand:
sad o75 " =?
jmp ceq
jmp error
ca: " a(ppend)
jms newline
jms setfl
@@ -152,7 +149,7 @@ cp1:
lac d1
sys write; line; 2: 0
lac addr1
sad addr2
sad addr1
jmp advanc
tad d1
dac addr1
@@ -219,7 +216,6 @@ cr: " r(ead)
isz c1
jmp 2b
jmp 1b
cw: " w(rite)
jms setfl
lac i addr1
@@ -714,6 +710,7 @@ addline: 0
jmp 1b
jmp i addline
getdsk: 0 "[the entire getdsk procedure was surrounded
and o776000 " by a box that was Xed out]:
sad diskin " --
+1 -2
View File
@@ -81,7 +81,6 @@ cs:
skp
jmp 3b
jms addline
2:
lac addr1
sad addr2
@@ -342,7 +341,7 @@ found: 0
jmp 2f
jmp 3f
1: "???
lac lchrno
lac charno
cma
tad charno
spa
+29 -30
View File
@@ -1,5 +1,4 @@
"** 09-1-35.pdf page 1
"[handwritten in the top center of scan - fop.s ]
jms = 0100000
"
q:0
@@ -87,49 +86,49 @@ fdv = jms q
lac hms
sna
sys save
ral "[box drawn around instruction - scan markup]
dac 2f "[separate box around the three dac instructions - scan markup]
ral
dac 2f
dac 3f
dac 4f
-1
tad hexp "[-\ - scan markup]
cma "[ | delta aep??? - scan markup]
tad aexp "[ | - scan markup]
dac aexp "[-/ / Ams \ - scan markup]
lac ans "[hand written to the right: Rem | --- | Hls??? - scan markup]
lmq "[ \ Hms / ----- - scan markup]
lac ams "[circle around ams ---------- Hms - scan markup]
sna cll "[ Hms - scan markup]
tad hexp
cma
tad aexp
dac aexp
lac ans
lmq
lac ams
sna cll
jmp 8f
div
2:0
szl
sys save
dac ce10 "[arrow pointing from ce10 to "REm" +-----+-----+ - scan markup]
lacq "[ handwritten to the right: | A |+ B | - scan markup]
dac 5f "[circle around 5f +-----+-----+ - scan markup]
lac ce10 "[ | C |+ D | - scan markup]
frdiv "[ +-----+-----+ - scan markup]
3:0 "[line from 3:0 to a circled "Hms" - scan markup]
dac ce10
lacq
dac 5f
lac ce10
frdiv
3:0
szl
sys save
lacq
dac ce10 "[line from ce10 to text "Q1" - scan markup]
dac ce10
lac hls
and o377777
frdiv "[ X - scan markup]
4:0 "[handwritten to the right: ----- - scan markup]
szl "[ A+B - scan markup]
frdiv
4:0
szl
sys save
lacq
dac 2b "[circle around 2b with arrow pointing to the right
dac 2b
spa cla
"** 09-1-35.pdf page 3
-1 "[vertical line to the right of instructions... - scan markup]
-1
tad 2b
cll "[underlined ...vertical line ends here - scan markup]
cll
mul
5:0 "[line from 5:0 to "Q" - scan markup]
5:0
dzm 2b
spa
isz 2b
@@ -140,11 +139,11 @@ fdv = jms q
isz 3b
skp
isz 2b
lac ce10 "[lac ce10 circled - scan markup]
lac ce10
lmq
lac 3b
sna
jmp 6f "[arrow pointing down starts to the right of 6f - scan markup]
jmp 6f
cma
tad d1
stl
@@ -152,7 +151,7 @@ fdv = jms q
lmq
szl
isz 2b
6:lac 2b "[arrow above points to between this instruction and the next one - scan markup]
6:lac 2b
sma
tad d1
tad 5b
@@ -725,7 +724,7 @@ sqrt = jms q
xor o200000
xor o400000
dac 1f
lac ams "[a centered dot drawn after ams - scan markup]
lac ams
frdiv; 1:..
szl
clq
@@ -779,7 +778,7 @@ sres: 0;0;0
rsign: 0
sign: 0
fp1: 1;0200000;0
fp1: 1;0200000; 0
o400000: 0400000
o640500: 0640500
-5
View File
@@ -1,5 +1,4 @@
" init
"** 07-13-19.pdf page 47
-1
sys intrp
@@ -61,7 +60,6 @@ login:
sad o72
skp
jmp 2b
"** 07-13-19.pdf page 48
lac 9 i
sad o72
jmp 1f
@@ -122,7 +120,6 @@ login:
cll; als 3
omq
dac nchar
"** 07-13-19.pdf page 49
jmp 1b
2:
lac nchar
@@ -185,7 +182,6 @@ rline: 0
sad 8
jmp 1b " and loop back
-1
"** 07-13-19.pdf page 50
tad 8 " Otherwise, move the pointer in location 8 back one
dac 8
jmp 1b " and loop back
@@ -247,7 +243,6 @@ m1:
m1s = .-m1
m2:
<?; 012
"** 07-13-19.pdf page 51
m2s = .-m2
m3:
<pa>;<ss>;<wo>;<rd>;<: 040
+1 -1
View File
@@ -181,7 +181,7 @@ loop:
dac ball1+vx
2:
lac toptest
tad ball1+y
tad ball1+vy
spa
jmp 2f
jms pockettb
+22 -23
View File
@@ -9,24 +9,24 @@
tad d1
dac .pbp1
restart:
fld; arg1 "[ g = arg1 - scan markup]
fst; g "[ fact = arg2 - scan markup]
fld; arg2 "[ d = 1.0 - scan markup]
fst; fact "[ z = 0 - scan markup]
fld; fp01 "[ oldx = 0 - scan markup]
fst; d "[ oldy = 0 - scan markup]
jms capture "[loop: - scan markup]
-100 "[ b = z - 110. - scan markup]
dac j "[ ---------- - scan markup]
fld; fp0 "[ radians - scan markup]
fst; z "[ z = z + g - scan markup]
fst; oldx "[ g = -g * fact - scan markup]
fst; oldy "[ fact = 1 / fact - scan markup]
lac o400000 "[ exex = 500. * d * sin(b + pi/2) - scan markup]
dac i 11 "[ ni() - scan markup]
dac i 11 "[ yy = 500. * d * sin(b) - scan markup]
lac setx "[ ni() - scan markup]
dac i 10 "[ goto loop " an arrow points up to loop: above - scan markup]
fld; arg1
fst; g
fld; arg2
fst; fact
fld; fp01
fst; d
jms capture
-100
dac j
fld; fp0
fst; z
fst; oldx
fst; oldy
lac o400000
dac i 11
dac i 11
lac setx
dac i 10
lac sety
dac i 10
@@ -51,7 +51,7 @@ loop:
sin
fmp; d
fmp; fp500
fst; exex
fst; xx
jms in
jmp done
fld; b
@@ -67,7 +67,7 @@ loop:
dac i 11
fld; oldx
fng
fad; exex
fad; xx
fix
spa
xor o775777
@@ -81,7 +81,7 @@ loop:
xor o775777
tad vecy
dac i 10
fld; exex
fld; xx
fst; oldx
fld; yy
fst; oldy
@@ -261,7 +261,7 @@ release: 0
char: 0
stick: 0
exex: 0; 0; 0
xx: 0; 0; 0
oldx: 0; 0; 0
yy: 0; 0; 0
oldy: 0;0 0; 0
@@ -277,7 +277,6 @@ o177777: 0177777
o12000: 012000
o61000: 061000
om60: -060
d1: 1
d13: 13
d500: 500
o141000: 0141000
-551
View File
@@ -1,554 +1,3 @@
:ca
v
af
nl
x
hd
v
hi
x
mn
r
:cb
x
ga
v
gi
ik
kk
mi
ma
aa
ai
ck
ek
gi
x
mn
r
:cc
x
kk
v
mi
mc
ka
ca
ac
ai
dl
x
mn
r
:cd
v
aa
ai
ck
kk
mi
ma
x
mn
r
:ce
x
mk
v
ma
aa
ak
x
gh
v
ga
x
mn
r
:cf
v
aa
ak
x
gh
v
ga
x
mn
r
:cg
x
gf
v
gk
nk
x
kk
v
mi
mc
ka
ca
ac
ai
dl
x
mn
r
:ch
x
aa
v
na
x
gb
v
gk
x
ak
v
nk
x
mn
r
:ci
x
md
v
mi
x
lf
v
af
x
ad
v
ai
x
mn
r
:cj
x
ka
v
mc
mg
ki
ai
x
ag
v
al
x
mn
r
:ck
x
aa
v
na
x
ak
v
ia
x
mk
v
fe
x
mn
r
:cl
x
aa
v
ma
mk
x
mn
r
:cm
v
aa
hf
ak
nk
x
mn
r
:cn
x
ak
v
mk
aa
na
x
mn
r
:co
x
ai
v
ch
ei
ck
ai
ac
ca
ka
mc
mi
kk
ck
x
mn
r
:cp
v
aa
ai
ck
ek
gi
ga
x
mn
r
:cq
x
mc
v
ka
ca
ac
ai
ck
kk
mi
mc
x
jh
v
nl
x
mn
r
:cr
v
aa
ai
ck
ek
gi
ga
x
mk
v
gf
x
mn
r
:cs
x
ka
v
mc
mi
kk
ik
gi
gc
ea
ca
ac
ai
dl
x
mn
r
:ct
x
aa
v
al
x
mf
v
af
x
mn
r
:cu
x
aa
v
ka
mc
mi
kk
x
ak
v
lk
x
mn
r
:cv
x
aa
v
mf
x
ak
v
mf
x
mn
r
:cw
x
aa
v
mc
af
x
ak
v
mi
af
x
mn
r
:cx
v
gf
x
ak
v
gf
x
aa
v
nl
x
mn
r
:cy
x
aa
v
if
x
ak
v
if
nf
x
mn
r
:cz
x
aa
v
ak
ma
ml
x
mn
r
:c0
x
ck
v
ai
ac
ca
ka
mc
mi
kk
ck
x
mn
r
:c1
x
ce
v
af
mf
x
md
v
mi
x
mn
r
:c2
x
ca
v
ac
ai
ck
ek
gi
gc
ia
ma
ml
x
mn
r
:c3
x
aa
v
ak
fe
fi
hk
kk
mi
mc
x
ka
v
nd
x
mn
r
:c4
x
mh
v
ah
ia
il
x
mn
r
:c5
x
ak
v
aa
fa
fi
hk
kk
mi
mc
x
ka
v
nd
x
mn
r
:c6
x
ck
v
ai
ac
ca
ka
mc
mi
kk
hk
fi
fc
ha
x
mn
r
:c7
x
aa
v
ak
nb
x
mn
r
:c8
x
gc
v
ea
ca
ac
ai
ck
ek
gi
gc
ia
ka
mc
mi
kk
ik
gi
x
mn
r
:c9
x
ka
v
mc
mi
kk
ck
ai
ac
ca
fa
hc
hi
fk
x
mn
r
:la
x
fb
+103 -103
View File
@@ -3,18 +3,18 @@
t = 0
start: "[------ stuff for gravity - scan markup]
law 13 " 13 = pbsflgs
sys sysloc " get pbsflgs location
dac .pbson " store in .pbson
start:
law 13
sys sysloc
dac .pbson
lac pww
dac 1f
dac 2f
lac pw
dac 3f
-32
dac cplan " cplan = -32
4: " while (cplan != 0) {
dac cplan
4:
fld; 1:0
fmp; 2:0
-1
@@ -22,7 +22,7 @@ start: "[------ stuff for gravity - scan markup]
dac aexp
fng
fad; fpone
fst; 3:0 " pw[i] = - (pww[i] * pww[i]) / 2 + 1
fst; 3:0
lac 1b
tad d3
dac 1b
@@ -30,36 +30,36 @@ start: "[------ stuff for gravity - scan markup]
lac 3b
tad d3
dac 3b
isz cplan " cplan++
jmp 4b " }
isz cplan
jmp 4b
law dspl-1
dac clistp
dac lanflg " lanflg = true
dzm crflg " crflg = false
dzm goflg " goflg = false
dzm .pbsint " pbsint = 0
dzm forflg " forflg = false
dzm bacflg " bacflg = false
dzm dspflg "[line connecting this instruction to... - scan markup]
dzm locflg " locflg = false
dzm locpar "[... this instruction - scan markup]
dac lanflg
dzm crflg
dzm goflg
dzm .pbsint
dzm forflg
dzm bacflg
dzm dspflg
dzm locflg
dzm locpar
lac d1
dac par " par = 1
jms dispname " dispname()
dac par
jms dispname
fld; prsq+4
sqrt
fst; rpar " rpar = sqrt(prsq[par])
fst; y " y = rpar
fst; oy " oy = y
fst; rpar
fst; y
fst; oy
fld; fpone
fst; sphi " sphi = 1
fst; stheta " stehta = sphi
jms dspsca " dspsca()
fst; sphi
fst; stheta
jms dspsca
fld; fpzero
fst; x " x = 0
fst; ox " ox = x
fst; cphi " cphi = ox
fst; ctheta " ctheta = cphi
fst; x
fst; ox
fst; cphi
fst; ctheta
law displist
"** 12-92-119.pdf page 2
sys capt
@@ -68,174 +68,174 @@ start: "[------ stuff for gravity - scan markup]
loop:
law dspl-1
dac clistp
jms contrl "[arrow from below points to this instruction - scan markup]
jms contrl
lac par
jms absxy " absxy(par)
jms shipxy " shipxy()
jms absxy
jms shipxy
lac goflg
spa
jmp loop3 "[long dash after loop3 - scan markup] if (!goflg) {
jmp loop3
fld; fpzero
fst; ax " ax = 0
fst; ay " ay = 0
fst; maxa " maxa = 0
lac nplan " AC = nplan
fst; ax
fst; ay
fst; maxa
lac nplan
skp
loop1:
lac cplan " AC = cplan
tad dm1 " AC--
lac cplan
tad dm1
spa
jmp loop2 " while (AC >= 0) {
dac cplan " cplan = AC
jmp loop2
dac cplan
tad fppar
dac fcplan
lac i fcplan
dac fcplan
jms updacc " updacc()
jms displa " displa()
jms updacc
jms displa
lac cplan
sza
jms updpln " if (cplan) updpln()
jms updpln
lac cplan
and o7
sad o7
jms contrl " if (cplan & 7 == 7) contrl()
jmp loop1 " }
jms contrl
jmp loop1
loop2:
lac lanflg
sma
jms updshp " if (!lanflg) updshp()
loop3: " }
fld; horizv "[a box enclosing all code from loop3 to loop4 - scan markup]
lac scale "[arrow drawn from box up to location above - scan markup]
jms updshp
loop3:
fld; horizv
lac scale
cma
tad vscale
tad aexp
dac aexp
jms inscr
jmp loop4 " if ((AC = inscr(horizv / 2**(vscale-scale-1)))) {
jmp loop4
tad o141577
dac i clistp "[crossed out with an arrow pointint to "dac dspvel" - scan markup]
lac o164372 "[crossed out - scan markup]
dac clistp i "[crossed out - scan markup]
cla "[crossed out - scan markup]
jms dsplanet "[crossed out - scan markup] dsplanet(0)
loop4: "[inside a drawn box - scan markup] }
dac i clistp
lac o164372
dac clistp i
cla
jms dsplanet
loop4:
sys time "put delay here.....
"** 12-92-119.pdf page 3
dzm dispcl " dispcl = ""
dzm dispcl
lac crflg
sma
jmp 1f " if (crflg)
jmp 1f
lac o20714 "cl
dac dispcl " dispcl = "CL"
dac dispcl
jmp 2f
1:
lac lanflg
sma
jmp 2f " else if (lanflg)
jmp 2f
lac o114 "l
dac dispcl " dispcl = "L"
dac dispcl
2:
lac dhalt
dac i clistp
jmp loop " check 2-display question
contrl: 0
lac i .pbson " load push button flags
lac i .pbson
xor .pbsint
and .pbson i " AC = (.pbson ^ .pbsint) & .pbson
and .pbson i
sna
jmp noneon " if (AC) {
jmp noneon
lmq
spa ral
sys exit " if (pbson[0]) exit()
sys exit
sma
jmp 1f " if (pbson[1]) {
dzm goflg " goflg = false
dzm crflg " crflg = false
1: " }
jmp 1f
dzm goflg
dzm crflg
1:
lacq
als 6
sma ral
jmp 1f " if (pbson[6]) {
jmp 1f
spa
jmp noneon " if (!pbson[7]) {
isz scale " scale++
jmp noneon
isz scale
nop
jms dspsca "uprange
jmp noneon " }
1: " }
jmp noneon
1:
sma
jmp noneon " if (pbson[7]) {
jmp noneon
-1
tad scale
dac scale " scale--
dac scale
jms dspsca "downrange
noneon: " } }
dzm forflg " forflg = false
dzm bacflg " bacflg = false
noneon:
dzm forflg
dzm bacflg
lac i .pbson
dac .pbsint
als 2
sma
jmp 1f " if (pbson[2]) {
jmp 1f
lac dhalt
dac forflg " forflg = true
dac forflg
lac goflg
sma
"** 12-92-119.pdf page 4
dzm lanflg " if (!goflg) lanflg = false
1: " }
dzm lanflg
1:
lac i .pbson
als 3
sma
jmp 1f " if (pbson[3]) {
jmp 1f
lac dhalt
dac bacflg " bacflg = true
dac bacflg
lac goflg
sma
dzm lanflg " if (!goflg) lanflg = false
1: " }
dzm lanflg
1:
lac i .pbson
als 4
sma
jmp 1f " if (pbson[4]) {
jmp 1f
ral
spa
jmp i contrl " if (pbson[5]) return
dzm 9f+t " 9f+t = false
jmp i contrl
dzm 9f+t
jmp 2f
1: " } else {
1:
ral
sma
jmp i contrl " if (!pbson[5]) return
jmp i contrl
lac dhalt
dac 9f+t " 9f+t = true
2: " }
dac 9f+t
2:
fld; cphi
fmp; sdphi
lac 9f+t
sma
fng
fst; ftmp1 " ftmp1 = cphi * sdphi * (9f+t ? 1 : -1)
fst; ftmp1
fld; sphi
fmp; cdphi
fad; ftmp1
fst; ftmp2 " ftmp2 = sphi * cdphi + ftmp1
fst; ftmp2
fld; sphi
fmp; sdphi
lac 9f+t
spa
fng
fst; ftmp1 " ftmp1 = sphi * sdphi * (9f+t ? -1 : 1)
fst; ftmp1
fld; cphi
fmp; cdphi
fad; ftmp1
fst; cphi " cphi = cphi * cdphi + ftmp1
fst; cphi
fld; ftmp2
fst; sphi " sphi = ftmp2
fst; sphi
jmp i contrl
t = t+1
@@ -244,10 +244,10 @@ shipxy: 0
fld; absx
fad; x
fng
fst; shipx " shipx = -(absx + x)
fst; shipx
fld; absy
fad; y
"** 12-92-119.pdf page 5
fng
fst; shipy " shipy = -(absy + y)
fst; shipy
jmp i shipxy
+67 -67
View File
@@ -9,32 +9,32 @@ absv: 0
dzm absy+1
dzm absy+2
1:
dac absi " absi = AC
dac absi
sna
jmp i absv " while (absi) {
jmp i absv
tad fppar
dac 9f+t
jms invert " invert(absi) -> ftmp1 = px[absi], ftmp2 = py[absi]
jms invert
fld; ftmp1
fng
fad; absx
fst; absx " absx -= ftmp1
fst; absx
fld; ftmp2
fng
fad; absy
fst; absy " absy -= ftmp2
jms invert " invert(absi) -> ftmp1 = px[absi], ftmp2 = py[absi]
fst; absy
jms invert
fld; ftmp1
fad; absx
fst; absx " absx += ftmp1
fst; absx
fld; ftmp2
fad; absy
fst; absy " absy += ftmp2
fst; absy
lac absi
tad ppar
dac 9f+t
lac i 9f+t " absi = ppar[absi]
jmp 1b " }
lac i 9f+t
jmp 1b
invert: 0
lac i 9f+t
@@ -50,12 +50,12 @@ invert: 0
dac 4f
fld; 1:..
fng
fst; 2:.. " pww[par] = -pww[par]
jms updpln " updpln()
fst; 2:..
jms updpln
fld; 3:..
fst; ftmp1 " ftmp1 = px[par]
fst; ftmp1
fld; 4:..
fst; ftmp2 " ftmp2 = py[par]
fst; ftmp2
jmp i invert
t = t+1
@@ -82,122 +82,122 @@ updpln: 0
dac 8f
fld; 1:..
fst; ftmp1 " ftmp1 = px[fcplan]
fst; ftmp1
fmp; 2:..
fst; ftmp2 " ftmp2 = ftmp1 * pw[fcplan]
fst; ftmp2
fld; 3:..
fmp; 4:..
fng
fad; ftmp2
fst; 5:.. " px[fcplan] = - (py[fcplan] * pww[fcplan]) + ftmp2
fst; 5:..
fld; 6:..
fmp; 7:..
fst; ftmp2 " ftmp2 = py[fcplan] * pw[fcplan]
fst; ftmp2
fld; ftmp1
fmp; 8:..
fad; ftmp2
fst; 0:.. " py[fcplan] = ftmp1 * pww[fcplan] + ftmp2
fst; 0:..
jmp updpln i
updacc: 0 " update acceleration
updacc: 0
lac cplan
sad par
jmp upda2 " if (cplan != par) {
jms absxy " absxy(cplan)
jmp upda2
jms absxy
fld; absx
fad; shipx " FAC = absx + shipx
jmp 1f " } else {
fad; shipx
jmp 1f
upda2:
fld; x
fng " FAC = -x
1: " }
fst; absx " absx = FAC
fng
1:
fst; absx
fmp; absx
fst; ftmp1 " ftmp1 = absx * absx
fst; ftmp1
lac cplan
sad par
jmp 1f " if (cplan != par)
jmp 1f
fld; absy
fad; shipy " FAC = absy + shipy
fad; shipy
jmp 2f
1:
fld; y
fng " else FAC = -y
fng
"** 12-92-119.pdf page 8
2:
fst; absy
fmp; absy
fad; ftmp1
fst; dtmp1 " dtmp1 = absy * absy + ftmp1
fst; dtmp1
sqrt
fst; dpar " dpar = sqrt(dtmp1)
fst; dpar
lac cplan
sad par
skp
jmp upda5 " if (cplan == par) {
jmp upda5
fld; ox
fng
fad; x
fst; ftmp1 " ftmp1 = -ox + x
fst; ftmp1
fmp; y
fst; horizv " horizv = ftmp1 * y
fst; horizv
fld; y
fng
fad; oy
fst; ftmp2 " ftmp2 = -y + oy
fst; ftmp2
fmp; x
fad; horizv
fdv; dpar
fst; horizv " horizv = (ftmp2 * x + horizv) / dpar
fst; horizv
fld; dpar
fcp; rpar
sma
jmp upda5 " if (dpar < rpar) {
jmp upda5
lac lanflg
spa
jmp upda5 " if (!lanflg) {
jmp upda5
fld; ftmp1
fmp; ftmp1
fst; ftmp1 " ftmp1 *= ftmp1
fst; ftmp1
fld; ftmp2
fmp; ftmp2
fad; ftmp1
fcp; crash
spa
jmp 1f " if (ftmp2 * ftmp2 + ftmp1 > crash) {
jmp 1f
lac dhalt
dac goflg " goflg = true
dac crflg " crflg = true
1: " }
dac goflg
dac crflg
1:
lac dhalt
dac lanflg " lanflg = true
dac lanflg
fld; rpar
fdv; dpar
fst; ftmp1 " ftmp1 = rpar / dpar
fst; ftmp1
fmp; x
fst; x " x *= ftmp1
fst; ox " ox = x
fst; x
fst; ox
fld; ftmp1
fmp; y
fst; y " y *= ftmp1
fst; oy " oy = y
fst; y
fst; oy
lac par
jms absxy " absxy(par)
jms shipxy " shipxy()
jmp upda2 " } } }
jms absxy
jms shipxy
jmp upda2
"** 12-92-119.pdf page 9
upda5:
fcp; fardst
spa
jmp 1f " if (dpar > fardst) {
jmp 1f
lac cplan
sna
jmp 1f " if (cplan) {
jmp 1f
lac dhalt
dac grvflg " grvflg = true
jmp i updacc " return
1: " } }
dzm grvflg " grvflg = false
dac grvflg
jmp i updacc
1:
dzm grvflg
lac fcplan
tad accl
dac 1f
@@ -205,18 +205,18 @@ upda5:
fdv; dtmp1
fcp; maxa
spa
jmp 2f " if (accl[fcplan] / dtmp1 > maxa) {
fst; maxa " maxa = accl[fcplan] / dtmp1
jmp 2f
fst; maxa
lac cplan
dac maxj " maxj = cplan
2: " }
dac maxj
2:
fdv; dpar
fst; ftmp1 " ftmp1 = (accl[fcplan] / dtmp1) / dpar
fst; ftmp1
fmp; absx
fad; ax
fst; ax " ax += ftmp1 * absx
fst; ax
fld; ftmp1
fmp; absy
fad; ay
fst; ay " ay += ftmp1 * absy
fst; ay
jmp i updacc
+60 -60
View File
@@ -7,111 +7,111 @@ updshp: 0
jmp .+4
lac bacflg
sma
jmp 3f " if (forflg || bacflg) {
fld; ascale " FAC = ascale
jmp 3f
fld; ascale
lac forflg
sma
jmp 1f
lac bacflg
sma
jmp 1f+1
fld; fpzero " if (forflg && bacflg) FAC = 0
fld; fpzero
jmp 2f
1:
fng " if (!forflg) FAC = -FAC
fng
lac scale
tad aexp
dac aexp " FAC = FAC * 2**scale
dac aexp
lac forflg
sma
jmp .+3
2:
lac accflg "[arrow pointing here from the text "how to set?" - scan markup]
lac accflg
sma
jmp .+3
fad; maxa " if (accflg) FAC += maxa
fng " FAC = -FAC
fad; maxa
fng
fst; ftmp1
fmp; ctheta
fad; ax
fst; ax " ax += ftmp1 * ctheta
fst; ax
fld; ftmp1
fmp; stheta
fad; ay
fst; ay " ay += ftmp1 * stheta
3: " }
fst; ay
3:
fld; ox
fng
fad; ax
fst; ftmp1 " ftmp1 = -ox + ax
fst; ftmp1
fld; x
lac aexp
tad d1
dac aexp
fad; ftmp1
fst; ftmp1 " ftmp1 += x*2
fst; ftmp1
fld; x
fst; ox " ox = x
fst; ox
fld; ftmp1
fst; x " x = ftmp1
fst; x
fld; oy
fng
fad; ay
fst; ftmp1 " ftmp1 = -oy + ay
fst; ftmp1
fld; y
lac aexp
tad d1
"** 12-92-119.pdf page 11
dac aexp
fad; ftmp1
fst; ftmp1 " ftmp1 += y*2
fst; ftmp1
fld; y
fst; oy " oy = y
fst; oy
fld; ftmp1
fst; y " y = ftmp1
fst; y
lac par
sad maxj
jmp i updshp " if (par == maxj) return
jms absxy " absxy(par)
jms shipxy " shipxy()
jmp i updshp
jms absxy
jms shipxy
lac par
jms absv " absv(par)
jms absv
fld; ox
fng
fad; x
fad; absx
fst; ox " ox = -ox + x + absx
fst; ox
fld; oy
fng
fad; y
fad; absy
fst; oy " oy = -oy + y + absy
fst; oy
lac maxj
dac par " par = maxj
jms absv " absv(par)
dac par
jms absv
fld; ox
fng
fad; absx
fst; ox " ox = -ox + absx
fst; ox
fld; oy
fng
fad; absy
fst; oy " oy = -oy + absy
fst; oy
lac par
jms absxy " absxy(par)
jms absxy
fld; absx
fad; shipx
fng
fst; x " x = -(absx + shipx)
fst; x
fad; ox
fst; ox " ox += x
fst; ox
fld; absy
fad; shipy
fng
fst; y " y = -(absy + shipy)
fadins: " fad instruction
fst; y
fadins:
fad; oy
fst; oy " oy += y
fst; oy
lac par
tad fppar
dac 1f
@@ -120,69 +120,69 @@ fadins: " fad instruction
dac 1f
fld; 1:..
sqrt
fst; rpar " rpar = sqrt(prsq[par])
jms dspsca " dspsca()
fst; rpar
jms dspsca
lac par
"** 12-92-119.pdf page 12
jms dispname " dispname(par)
jms dispname
jmp i updshp
inscr: 0 " in screen
inscr: 0
fng
fix " AC = (int) -FAC
tad d383 " AC += 383
fix
tad d383
spa
jmp i inscr " if (AC < 0) return
tad dm768 " AC -= 768
sma " if (AC >= 0) return
jmp i inscr
tad dm768
sma
jmp i inscr
isz inscr
jmp i inscr " return AC
jmp i inscr
absxy: 0
sna
jmp 7f " if (AC) {
jmp 7f
lmq
lac fldins
dac 2f-1 " C(2f-1) = fld
dac 4f-1 " C(4f-1) = fld
dac 2f-1
dac 4f-1
lacq
1: " while (true) {
dac absi " absi = AC
1:
dac absi
sna
jmp i absxy " if (!absi) return
jmp i absxy
tad fppar
dac 9f+t
lac i 9f+t
5:
tad px
dac 2f
fldins: " fld instruction
fldins:
fld; absx
fad; 2:..
fst; absx " if (i==0) absx = px[absi]; else absx += px[absi]
fst; absx
lac i 9f+t
6:
tad py
dac 4f
fld; absy
fad; 4:..
fst; absy " if (i==0) absy = py[absi]; else absy += py[absi]
fst; absy
lac fadins
dac 2b-1
dac 4b-1
lac absi
tad ppar
dac 9f+t
lac i 9f+t " AC = ppar[absi]
jmp 1b " }
7: " } else {
dzm absx " absx = 0
lac i 9f+t
jmp 1b
7:
dzm absx
dzm absx+1
dzm absx+2
dzm absy " absy = 0
dzm absy
dzm absy+1
dzm absy+2
jmp i absxy " }
jmp i absxy
"** 12-92-119.pdf page 13
t = t+1
+91 -91
View File
@@ -5,37 +5,37 @@ displa: 0
lac locpar
sad cplan
skp
jmp 2f " if (cplan == locpar) {
lac locflg "[arrow points here from the text "how to set?" - scan markup]
jmp 2f
lac locflg
sma
jmp 1f " if (locflg) {
fld; cphi "[-\ - scan markup]
fmp; absy "[ | - scan markup]
fst; ftmp1 "[ | - scan markup] ftmp1 = cphi * absy
fld; sphi "[ | - scan markup]
fmp; absx "[ | - scan markup]
fad; ftmp1 "[ | - scan markup]
fdv; dpar "[ | - scan markup]
fst; stheta "[ \ lock calculation - scan markup] stheta = (sphi * absx + ftmp1) / dpar
fld; sphi "[ / - scan markup]
fmp; absy "[ | - scan markup]
fng "[ | - scan markup]
fst; ftmp1 "[ | - scan markup] ftmp1 = - (sphi * absy)
fld; cphi "[ | - scan markup]
fmp; absx "[ | - scan markup]
fad; ftmp1 "[ | - scan markup]
fdv; dpar "[ | - scan markup]
fst; ctheta "[ | - scan markup] ctheta = (cphi * absx + ftmp1) / dpar
jmp 2f "[-/ - scan markup]
1: " } else {
fld; sphi
fst; stheta " stheta = sphi
jmp 1f
fld; cphi
fst; ctheta " ctheta = cphi
2: " } }
fmp; absy
fst; ftmp1
fld; sphi
fmp; absx
fad; ftmp1
fdv; dpar
fst; stheta
fld; sphi
fmp; absy
fng
fst; ftmp1
fld; cphi
fmp; absx
fad; ftmp1
fdv; dpar
fst; ctheta
jmp 2f
1:
fld; sphi
fst; stheta
fld; cphi
fst; ctheta
2:
fld; absx
sfmp; ctheta
fst; ftmp1 " ftmp1 = absx * ctheta
fst; ftmp1
fld; absy
sfmp; stheta
fad; ftmp1
@@ -44,30 +44,30 @@ displa: 0
tad scale
cma
dac aexp
fst; spy " spy = (absy * stheta + ftmp1) / 2**scale
dzm inflg " inflg = false
fst; spy
dzm inflg
jms inscr
jmp 1f " if ((AC = inscr(spy))) {
jmp 1f
tad o145777
dac clistp i
jms rotx " rotx()
jms rotx
lac dhalt
dac inflg " inflg = true
dac inflg
jms inscr
jmp 1f " if ((AC = inscr(spx))) {
jmp 1f
tad o161577
dac i clistp
lac cplan
jms dsplanet " dsplanet(cplan)
1: " } }
jms drcirc " drcirc()
jms dsplanet
1:
jms drcirc
"** 12-92-119.pdf page 15
jmp i displa
rotx: 0
fld; absx
sfmp; stheta
fst; ftmp1 " ftmp1 = absx * stheta
fst; ftmp1
fld; absy
sfmp; ctheta
fng
@@ -77,70 +77,70 @@ rotx: 0
tad scale
cma
dac aexp
fst; spx " spx = (-(absy * ctheta) + ftmp1) / 2**scale
fst; spx
jmp i rotx
surf: 0
-1
tad setx
cma
dac tsetx " tsetx = -setx
dac tsetx
lac setx
tad o141577
dac i clistp
-1
tad sety
cma
dac tsety " tsety = -sety
dac tsety
lac sety
tad o165777
dac clistp i
lac narcs
dac nt " nt = narcs
dac nt
fld; wx
fst; twx " twx = wx
fst; twx
fld; wy
fst; twy " twy = wy
fst; twy
fld; v
fng
fst; v " v = -v
2: " while (nt != 0) {
fst; v
2:
fld; v
sfmp; twy
fng
fst; ftmp1 " ftmp1 = -(v * twy)
fst; ftmp1
fld; vv
sfmp; twx
fad; ftmp1
fst; ftmp2 " ftmp2 = vv * twx + ftmp1
fst; ftmp2
fld; v
sfmp; twx
fst; ftmp1 " ftmp1 = v * twx
fst; ftmp1
fld; vv
sfmp; twy
fad; ftmp1
fst; twy " twy = vv * twy + ftmp1
fst; twy
fad; spy
jms inscr
jmp 1f " if (!(AC = inscr(twy + spy))) return false
jmp 1f
"** 12-92-119.pdf page 16
tad tsety
dac dely " dely = AC + tsety
dac dely
cma
tad d1
tad tsety
dac tsety " tsety -= dely
dac tsety
fld; ftmp2
fst; twx " twx = ftmp2
fst; twx
fad; spx
jms inscr
jmp 1f " if (!(AC = inscr(twx + spx))) return false
jmp 1f
tad tsetx
dac delx " delx = res + tsetx
dac delx
cma
tad d1
tad tsetx
dac tsetx " tsetx -= delx
dac tsetx
lac delx
sma
jmp .+3
@@ -156,17 +156,17 @@ surf: 0
tad delx
tad o220000
dac i clistp
isz nt " nt++
jmp 2b " }
jmp i surf " return true
isz nt
jmp 2b
jmp i surf
1:
isz surf
jmp i surf
drcirc: 0 " draw circle
drcirc: 0
lac grvflg
spa
jmp i drcirc " if (grvflg) return
jmp i drcirc
lac fcplan
tad prsq
dac .+2
@@ -177,79 +177,79 @@ drcirc: 0 " draw circle
tad scale
cma
dac aexp
fst; dtmp1 " dtmp1 = sqrt(prsq[fcplan]) / (2**scale)
fst; dtmp1
fcp; thrs
spa
jmp i drcirc " if (dtmp1 < thrs) return
jmp i drcirc
fng
lac dpar
cma
tad scale
"** 12-92-119.pdf page 17
cma
dac dpar " dpar /= (2**scale)
dac dpar
fad; dpar
sfdv; dpar
fst; dtmp2 " dtmp2 = (-dtmp1 + dpar) / dpar
fst; dtmp2
sfmp; spy
fst; wy " wy = dtmp2 * spy
jms inscr " if (!(AC = inscr(wy)))
jmp i drcirc " return
dac sety " sety = AC
fst; wy
jms inscr
jmp i drcirc
dac sety
lac inflg
sma
jms rotx " if (!inflg) rotx()
jms rotx
fld; dtmp2
sfmp; spx
fst; wx " wx = dtmp2 * spx
jms inscr " if (!(AC = inscr(wx)))
jmp i drcirc " return
dac setx " setx = AC
fst; wx
jms inscr
jmp i drcirc
dac setx
fld; spy
fng
fad; wy
fst; wy " wy -= spy
fst; wy
fld; spx
fng
fad; wx
fst; wx " wx -= spx
fst; wx
fld; dtmp1
sfmp; pid10 " FAC = dtmp1 * pid10
sfmp; pid10
fcp; f400
spa
jmp 1f " if (FAC > 400) {
jmp 1f
lac d400
dac narcs " narcs = 400
jmp 2f " } else {
dac narcs
jmp 2f
1:
fix " AC = (int) FAC
fix
tad dm20
spa
cla " if (AC - 20 < 0) AC = 0
tad d20 " AC += 20
dac narcs " narcs = AC
flt " }
cla
tad d20
dac narcs
flt
2:
fst; dtmp1
-1
tad narcs
cma
dac narcs " narcs = -narcs
dac narcs
fld; f2pi
sfdv; dtmp1
fst; v " v = f2pi / dtmp1
fst; v
sfmp; v
-1
tad aexp
dac aexp
fng
fad; fpone
fst; vv " vv = -(v*v)/2 + 1
lac o40004 " intens 0
fst; vv
lac o40004
dac i clistp
"** 12-92-119.pdf page 18
jms surf
jmp i drcirc " if (surf()) return
jmp i drcirc
jms surf
jmp i drcirc " if (surf()) return
jmp i drcirc
jmp i drcirc
+15 -15
View File
@@ -1,11 +1,11 @@
"** 12-92-119.pdf page 19
" space travel 5
dsplanet: 0 " display planet center
tad points " add points address to ac (planet index)
dsplanet: 0
tad points
dac 9f+t
lac i 9f+t
dac i clistp " set planet brightness
dac i clistp
lac o246256
dac i clistp
lac o253052
@@ -14,8 +14,8 @@ dsplanet: 0 " display planet center
dac i clistp
jmp dsplanet i
dispname: 0 " display planet name
tad names " add names address to ac (planet index)
dispname: 0
tad names
dac 9f+t
lac i 9f+t
tad dm1
@@ -50,26 +50,26 @@ dispname: 0 " display planet name
t = t+2
dspsca: 0 " display scale
lac scale " AC = scale
dspsca: 0
lac scale
sma
jmp 1f " if (scale < 0) {
jmp 1f
lac o55 "-
dac dssca " dssca[0] = '-'
dac dssca
-1
tad scale
cma " AC = -AC
cma
jmp 2f
1: " } else {
1:
"** 12-92-119.pdf page 20
lac o53 "+
dac dssca " dssca[0] = '+'
dac dssca
lac scale
2: " }
2:
cll; idiv; 10
tad o60
dac dssca+2 " dssca[2] = (AC % 10) + '0'
dac dssca+2
lacq
tad o60
dac dssca+1 " dssca[1] = (AC / 10) + '0'
dac dssca+1
jmp i dspsca
+6 -6
View File
@@ -69,7 +69,7 @@ umbriel: <um>;<br>;<ie>;<l
uranus: <ur>;<an>;<us>;0
venus: <ve>;<nu>;<s
points: .+1 " planet center point brightness
points: .+1
br3
br2
br0
@@ -109,13 +109,13 @@ fppar: .+1
48;51;54;57;60;63;66;69
72;75;78;81;84;87;90;93
ppar: .+1 " planet orbits (indices)
ppar: .+1
0;0;036;015;01;016;031;031
015;015;031;031;015;0;0;0
031;036;0;022;036;016;031;0
031;0;031;031;022;036;0;0
prsq: .+1 " planet radius squared relative to earth (radius 1)
prsq: .+1
016;0272245;075341
1;0200000;0
-07;0244122;0506362
@@ -150,7 +150,7 @@ prsq: .+1 " planet radius squared relative to earth (radius 1)
05;0206115;0
0;0362406;0
accl: .+1 " mass of each planet times gravitational constant
accl: .+1
0;0204365;0
-023;0320324;0
-036;0227207;0
@@ -184,7 +184,7 @@ accl: .+1 " mass of each planet times gravitational constant
-017;0275653;0
-023;0252667;0
px: .+1 " planet x position relative to orbit (unit=earth radius)
px: .+1
"** 12-92-119.pdf page 24
0;000000;0
015;0620356;0
@@ -219,7 +219,7 @@ px: .+1 " planet x position relative to orbit (unit=earth radius)
023;0650051;0
016;0233751;0
py: .+1 " planet y position relative to orbit (unit=earth radius)
py: .+1
000;0000000;0
017;0664054;0
002;0662035;0
+53 -53
View File
@@ -2,81 +2,81 @@
" space travel 7
clistp = 017
br0 = 040004 " intens 0
br1 = 040005 " intens 1
br2 = 040006 " intens 2
br3 = 040007 " intens 3
br0 = 040004
br1 = 040005
br2 = 040006
br3 = 040007
d10: 10
d3: 3
o246256: 0246256 " incr n=1 dir=1 (NE), n=2 dir=6 (W)
o253052: 0253052 " incr n=2 dir=4 (S), n=2 dir=2 (E)
o246036: 0246036 " incr n=1 dir=0 (N), n=1 dir=6 (W)
o177: 0177 " 7-bit mask (127)
nplan: 32 " number of planets
o246256: 0246256
o253052: 0253052
o246036: 0246036
o177: 0177
nplan: 32
d1: 1
d20: 20
dm1: -1
o141577: 0141577 " dsetx 895 (view right)
o161577: 0161577 " dsetx (delay) 895 (view right)
o164372: 0164372 " dsety (delay) 250 (view bottom)
o114: 0114 " ascii L
o20714: 020714 " ascii "CL"
d383: 383 " 895 (view right) - 512 (scope width / 2)
dm768: -768 " 127 (view left) - 895 (view right)
o145777: 0145777 " dsety 1023 (view top)
o165777: 0165777 " dsety (delay) 1023 (view top)
o141577: 0141577
o161577: 0161577
o164372: 0164372
o114: 0114
o20714: 020714
d383: 383
dm768: -768
o145777: 0145777
o165777: 0165777
o7: 7
o60: 060
o55: 055
o53: 053
o41: 041
o220000: 0220000 " short vec vis
o220000: 0220000
d400: 400
dm20: -20
o40004: 040004
fardst: 020;0200000; 0 " fardst = 32768
f2pi: 03;0311037;552421 " 2 * pi, missing octal prefix
pid10: -01;0240662;756647 " pi / 10, missing octal prefix
thrs: 02;0200000;0 " threshold = 2.0
fardst: 020;0200000; 0
f2pi: 03;0311037;552421
pid10: -01;0240662;756647
thrs: 02;0200000;0
f400: 011;0310000;0
crash: -028;0200000;0 " crash ~ 0
crash: -028;0200000;0
stheta: 01;0200000;0
ctheta: 0;0;0
fpzero: 0;0;0
scale: 0
vscale: 6
ascale: -1 " loaded as a float = -1;0777773;0253436 ~ -0.5
sdphi: -05;0253436;0700177 " sin(1.2 deg)
cdphi: 000;0377743;0201725 " cos(1.2 deg)
ascale: -1
sdphi: -05;0253436;0700177
cdphi: 000;0377743;0201725
dhalt: 0400000
fpone: 01;0200000;0
9: .=.+t
horizv: .=.+3 " horizontal velocity
horizv: .=.+3
.pbson: .=.+1
.pbsint: .=.+1
dspflg: .=.+1
par: .=.+1 " current planet
par: .=.+1
absi: .=.+1
absx: .=.+3
"** 12-92-119.pdf page 27
absy: .=.+3
v: .=.+3
vv: .=.+3
spx: .=.+3 " screen position x
spy: .=.+3 " screen position y
spx: .=.+3
spy: .=.+3
wx: .=.+3
wy: .=.+3
twx: .=.+3
twy: .=.+3
setx: .=.+1
sety: .=.+1
narcs: .=.+1 " number of arcs
narcs: .=.+1
nt: .=.+1
inflg: .=.+1
grvflg: .=.+1 " gravity flag
grvflg: .=.+1
dtmp1: .=.+3
dtmp2: .=.+3
delx: .=.+1
@@ -85,26 +85,26 @@ tsetx: .=.+1
tsety: .=.+1
accflg: .=.+1
locpar: .=.+1
crflg: .=.+1 " crash landing flag
rpar: .=.+3 " planet radius
dpar: .=.+3 " distance to planet
crflg: .=.+1
rpar: .=.+3
dpar: .=.+3
ax: .=.+3
ay: .=.+3
maxa: .=.+3 " strongest gravity acceleration
maxj: .=.+1 " index of planet with strongest gravity
maxa: .=.+3
maxj: .=.+1
dcplan: .=.+1
fcplan: .=.+1 " floating point count planet (float index)
cplan: .=.+1 " count planet (index)
fcplan: .=.+1
cplan: .=.+1
shipx: .=.+3
shipy: .=.+3
x: .=.+3 " x position relative to planet
y: .=.+3 " y position relative to planet
x: .=.+3
y: .=.+3
ox: .=.+3
oy: .=.+3
lanflg: .=.+1 " landing flag
goflg: .=.+1 " game over flag
forflg: .=.+1 " forward flag
bacflg: .=.+1 " backward flag
lanflg: .=.+1
goflg: .=.+1
forflg: .=.+1
bacflg: .=.+1
sphi: .=.+3
cphi: .=.+3
ftmp1: .=.+3
@@ -116,21 +116,21 @@ dsety = 0164000
vecx = 0120000
vecy = 0124000
m = 02000
displist: " display list
displist:
075057 "scale 1 intens 3 blink on lp 0 sym 0
dsetx 800
dsety 20
dispcl: " display L/CL
dispcl:
0
060004 "intens 0 blink off
"** 12-92-119.pdf page 28
dsetx 0
dsety 20
namedsp: " display name
namedsp:
.=.+10
dsetx 400
dsety 20
dssca: " display scale
dssca:
.=.+3
040040 "scale 0
dsetx 127
@@ -152,7 +152,7 @@ dssca: " display scale
dsety 255
vecy 767
dsetx 127
dsety 639 "[--- - scan markup]
vecx 767 "[an arrow starts between vecx and dspl, it points to the right - scan markup]
dspl: " display planets
dsety 639
vecx 767
dspl:
0400000
+23 -30
View File
@@ -1,10 +1,4 @@
"** 13-120-147.pdf page 5
" TMG
" console switches:
" bit 0: do not save/dump core!!
" bit 15: trace first recognition or generate instruction & halt
" bit 16: trace all generation instructions
" bit 17: trace all recognition instructions
t=0
main:
lac 017777 i
@@ -29,16 +23,16 @@ main:
jms advance; jmp 1f
jmp rinterp
0:lac 2f " get EOS
jms obuild " add to obuf
1:lac owrite " here on retreat
spa " anything in obuf?
jmp 0b " no, put EOS
jms oflush " flush buffered output
las " get switches
spa " high bit set?
sys exit " yes: exit
sys save " no, dump core!!!!
0:lac 2f
jms obuild
1:lac owrite
spa
jmp 0b
jms oflush
las
spa
sys exit
sys save
2:o777
@@ -46,23 +40,22 @@ main:
"puts out and octal strin g from symtab entry
symoct: " BUILTIN: (output last symtab ent in octal?)
symoct:
lac equ
add equbot
dac 9f+t " save temp pointer
lac 1f " fetch "gf" (execute native code) inst below
jms twoktab; lac 9f+t i " second word is contents of word *temp
" first word of "two word ktab" entry:
1:gf .+1 x " invoke native code (below), and exit
lac ii " fetch instruction pointer
dac 8 " save in auto-increment register 8
lac 8 i " fetch word after *ii
add symbot " use as offset into symtab
dac 9f+t " save in temp
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 " fetch symtab word *temp
jms putoct " output octal
lac onenl " output newline
2:lac 9f+t i
jms putoct
lac onenl
jms obuild
lac 9f+t i
and o600600
+228 -286
View File
@@ -1,112 +1,96 @@
"** 13-120-147.pdf page 7
" recognition stack frame advance
" push stack frame: called in both recognition and generation
" (despite above comment).
" recognition frame size is 6, generation frame size is 4.
" 0: pointer to previous frame
" 1: jmp instr from after "jms advance" (for retreat/return)
" 2: saved ii (inst ptr)
" 3: saved ignore/env
" 4: saved j (always overwritten by nframe in recog. mode)
" 5: saved k
advance:0
lac frame " get frame pointer
dac 8 " save in auto-increment register 8
lac advance i " get (retreat) instruction after "jms advance"
dac 8 i " save at offset 1
lac ii " instruction pointer
dac 8 i " save at offset 2
lac ignore " ignore mask pointer (env in recog. mode?)
dac 8 i " save at offset 3
lac j " input char pointer
dac 8 i " save at offset 4
lac k " result pointer
dac 8 i " save at offset 5
lac frame " save current frame pointer
dac nframe i " at nframe offset zero
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 " set frame pointer to nframe (new frame)
add dffrmsz " add current frame size
dac nframe " set new new frame pointer
dac nframe " AGAIN??!!
jms between; add rbot; add rtop " check for overflow
dac frame
add dffrmsz
dac nframe
dac nframe
jms between; add rbot; add rtop
jms halt
isz advance " skip instruction after jms
jmp advance i " return
" Here on failure/backup (w/ fflag set to 760000)
" AND at (successful) end of rule
" (exit/indirect bit set on last instr).
" Always restores j/k on failure:
" (no such thing as "failure" in generation mode(?))
isz advance
jmp advance i
retreat:
dzm junk
lac gflag " in generation mode?
lac gflag
sza
jmp 1f " yes, skip bundling
jms bundlep " no, bundle
dac junk " save pointer (may be zero if no result)
jmp 1f
jms bundlep
dac junk
1:lac frame
dac nframe " reset nframe to current frame pointer
lac frame i " fetch prev. frame pointer from current frame
dac frame " pop current frame
dac 8 " save in (pre) auto-increment register 8
lac 8 i " restore saved instruction
dac nframe
lac frame i
dac frame
dac 8
lac 8 i
dac 3f "retrun address
lac 8 i
dac ii " restore saved instruction pointer
dac ii
lac 8 i
dac ignore " restore saved ignore ("env" in gen mode???)
lac fflag " get failure flag
sna " any bits set?
jmp 2f " no, skip
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 " get bundle/result(s)
sna " got anything?
jmp 3f " no
2:lac junk
sna
jmp 3f
dac nframe i "stass reslts
isz nframe
3:jmp " (jump following original "jms advance" call)
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 " check failure flag
sza " clear?
lac fflag
sza
jmp 2f "no results on failure
jms nframe0 " yes: get initial nframe pointer
dac 9f+t " save
cma " get negative, minus one
tad nframe " add current value
cma " get nframe0 - nframe! (-N or zero)
dac 9f+t+1 " save
sma " negative result?
jmp 2f " no, no change
sad m1 " -1 (one result)
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 " get initial nframe
tad m1 " decrement
dac 8 " save in (pre-)auto-increment reg. 8
lac 9f+t
tad m1
dac 8
1:lac 8 i " fetch result
jms kput " save in ktab
isz 9f+t+1 " increment negative count until zero
jmp 1b " more left, continue
1:lac 8 i
jms kput
isz 9f+t+1
jmp 1b
lac k "make up result pointer
add l.gk " return as gk instruction
add l.gk
jmp bundlep i
2:cla " here with no results, return zero
2:cla
jmp bundlep i
3:lac 9f+t i " here with one result, fetch it
3:lac 9f+t i
jmp bundlep i
t=t+1 "where to find results
t=t+1 "negative of result count
@@ -114,58 +98,54 @@ 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 " fetch instr. at saved intruction pointer
jms s1get; add d.ii
dac junk
lac junk i " fetch word referenced by instruction
lac junk i
dac junk
lac junk i " fetch word referenced by that word!!
and opmask " get instruction portion
sad l.rw " is it an "rw" instruction?
jmp 1f " yes.
lac refrsz " no, use recog frame size as offset
lac junk i
and opmask
sad l.rw
jmp 1f
lac refrsz
jmp 2f
1:lac junk i " get contents of word ref'ed by rw instr
and o17777 " get rw instr address portion (offset)
2:add frame " make nframe pointer
jmp nframe0 i " return
1:lac junk i
and o17777
2:add frame
jmp nframe0 i
" halt on various error conditions:
" various table overflows
" console switch 15 set (trace and halt)
" invalid recognize/generate opcodes
halt:0
lac 1f
jms obuild " output "\n?"
jms obuild
lac halt
jms putoct " output return address in octal
jms putoct
lac onenl
jms obuild " output newline
xct rstack+1 " execute retreat jump from initial advance?!
1:.+1;012077;end " "\n?"; end=-1 -- two 0777 EOSes
jms obuild
xct rstack+1
1:.+1;012077;end
"** 13-120-147.pdf page 9
rinterp: " recognition mode interpreter
rinterp:
las "trace check
and d5
sna
jmp .+3
lac bugr
jms bug " trace
jms bug
lac fflag " fetch failure flag
ral " rotate top bit into LINK
lac ii i " fetch current instruction
and opmask " get opcode
sad l.ra " "ra" (conditional branch on LINK set/fail)?
jmp rera " yes
sad l.rb " "rb" (conditional branch on LINK clear/succ)?
jmp rerb " yes
szl " LINK set (failure)?
jmp retreat " yes: retreat!!
lrs 14 " no: shift opcode bits down
and o17 " isolate opcode bits
add rbranch " create indirect jmp thru rbranch tabe
dac .+1 " save as next
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:
@@ -173,7 +153,7 @@ rbranch:
reno
rerx
rerc
regc " opcode is "rt"!
regc
rerf
rerw
rera
@@ -187,112 +167,104 @@ rbranch:
reuu
reuu
reuu: " recognition unused operation
jms halt " halt
reuu:
jms halt
rerb: " recognition "rb" instruction
cml " complement LINK bit
rera: " recognition "ra" instruction
dzm fflag " clear failure flag
snl " LINK bit set?
jmp goon " no: continue (w/ exit check)
jms aget " yes: fetch address part
dac ii " save as new instruction pointer
jmp rinterp " go on (w/o exit check)
rerb:
cml
rera:
dzm fflag
snl
jmp goon
jms aget
dac ii
jmp rinterp
backup: " here on failure from "rx", eof, char builtins
backup:
lac jsav
dac j
nuts: " here on failure from find/prev builtins
" (could possibly be used as a "fail" builtin?)
law " get 0760000
nuts:
law
"** 13-120-147.pdf page 10
dac fflag " set failure flag
dac fflag
reno: " recognition no(op) instruction
goon: " "go on" on success from recog. builtins, ops
lac ii i " fetch current instruction
isz ii " advance instruction pointer
and exitmask " was exit (indirect) bit set on prev instr?
reno:
goon:
lac ii i
isz ii
and exitmask
sza
jmp retreat " yes, retreat/return
jmp rinterp " no, go on
jmp retreat
jmp rinterp
rerw: " recognition rw instr (nframe0 looks for one!)
jms aget " get address portion of instruction
add frame " use as frame size
dac nframe " set nframe pointer
rerw:
jms aget
add frame
dac nframe
jmp goon
rerc: " recognition rc (call tmg code) instruction
jms advance; jmp goon " push new frame, continue on retreat
jms aget " get address from instruction
dac ii " use as new instruction pointer
jmp rinterp " go on (w/o exit check)
rerc:
jms advance; jmp goon
jms aget
dac ii
jmp rinterp
gegf: " gen. "gf" intr (invoke builtin func)
rerf: " recognition rf inst (invoke builtin func)
jms aget " get address from instruction
add ljmp " make into abs jmp to native code
gegf:
rerf:
jms aget
add ljmp
dac .+1
jmp " go to native code
jmp
rerx: " recognition rx instruction (compare lit str)
rerx:
lac j
dac jsav " save j (input char pointer) in jsav
jms aget " get address from instruction
dac jsav
jms aget
1:dac 9f+t
jms lchar " get lit character
sad o777 " EOS?
jmp goon " yes, continue (success)
dac 9f+t+1 " no, save char
jms getj " get next input char
sad 9f+t+1 " as expected?
jmp 2f " yes
jmp backup " no: restore j and fail.
2:lac 9f+t " continue matching (increment lit ptr)
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 " fetch address portion of current instruction
aget:0
lac ii i
and o17777
jmp aget i
" Places copy of instruction with exit bit set on stack.
" Interpreted as a "gc" instruction (see note at gegc).
regc: " recognition "rt" instruction [sic]
lac ii i " fetch instruction word
and o757777 " clear exit bit
xor exitmask " set (toggle) exit bit
dac nframe i " push @nframe
regc:
lac ii i
and o757777
xor exitmask
dac nframe i
"** 13-120-147.pdf page 11
isz nframe " advance nframe pointer
jmp goon " succeed
isz nframe
jmp goon
" push result in AC at "k" (kbuf)
" called from bundlep and twice from twoktab (two word ktab entry)
" returns w/ AC unmodified, k contains index of new entry
kput:0
isz k
dac junk1
lac k
jms between; add d0; add kmax
jms halt " halt on ktab overflow
jms halt
add kbot
dac junk
lac junk1
dac junk i
jmp kput i
" fetch word from current frame using "add offset" following jms.
" Only used by parsedo, to restore k.
s0get:0
lac frame
xct s0get i
@@ -301,8 +273,6 @@ s0get:0
isz s0get
jmp s0get i
" fetch word via ptr in current frame using "add offset" following jms.
" Only used by nframe0, w/ "ii" instruction pointer
s1get:0
lac frame i
xct s1get i
@@ -311,8 +281,6 @@ s1get:0
isz s1get
jmp s1get i
" set word in current frame using "add offset" following jms.
" Only used by "gk" instruction to set "ii"
s0put:0
lmq
lac frame
@@ -325,145 +293,119 @@ s0put:0
" here is the generaion interpreter
" the k table cant move while its active
geno: " gen. noop instruction
ggoon: " "go on" from gen. builtins, ops
lac ii i " fetch prev instr
isz ii " increment
and exitmask " isolate exit bit
geno:
ggoon:
lac ii i
isz ii
and exitmask
sza
jmp retreat " exit bit set, return.
jmp retreat
ginterp:
las "trace check
and d6
sna
jmp .+3
lac bugg
jms bug " trace
jms bug
lac ii i " fetch current instruction
lrss 14 " shift down to opcode
and o7 " get low 3 of opcode
lac ii i
lrss 14
and o7
"** 13-120-147.pdf page 12
add gbranch " make indirect branch thru gbranch table
dac .+1 " save as next instruction
add gbranch
dac .+1
jmp
gbranch:
jmp .+1 i
geno
gegx
geuu " was once "gz" (in bugg tab)
geuu
gegc
gegf
gegk
gegp
gegq
geuu: " gen. ununimplemented instruction
geuu:
jms halt
" pdp-11 analog is .txs? output string
gegx: " gen. "gx" instruction
lac ii i " fetch instruction
and o417777 " extract character address
jms obuild " copy to output
jmp ggoon " continue (checking for exit)
gegx:
lac ii i
and o417777
jms obuild
jmp ggoon
" pdp-11 analog may be .tq: load translation parameter ($1, $2)??
" manual says:
" A translation rule may have parameters, and if it
" does, their number is declared by a parenthesized
" integer prefixed to its body.
gegq: " gen. "gq" instruction
jms advance; jmp ggoon " push state
gegq:
jms advance; jmp ggoon
lac env
add d.ii " get addr of env->ii
add d.ii
dac junk
jms aget " get address portion of gq instruction
add junk i " add value at *env->ii
jms aget
add junk i
dac junk
lac junk i " fetch *(*env->ii + aget())
dac ii " save param list ptr as instruction pointer?
lac env
add d.env " get addr env->env
dac junk
lac junk i " fetch env->env
dac env " restore env ptr (pop env)
jmp ginterp " go on (w/o exit check)
" pdp-11 analog is .tp?
" execute rule called for by 1 2 ...
" found relative to instruction counter in the k environment
gegp: " gen. "gp" instruction
jms advance; jmp ggoon " push current state
lac env " get saved env pointer
add d.ii " get pointer to saved instruction pointer
dac junk " save in temp
lac frame i " get prev frame pointer
dac env " save as env pointer
jms aget " get address portion of instruction
cma " one's complement negation + one's c. add!!
add junk i " back up env instruction pointer by -aget()
lac junk i
dac ii
jmp ginterp " go on (w/o exit check)
lac env
add d.env
dac junk
lac junk i
dac env
jmp ginterp
" pdp-11 comment @ gk:
" delivered compound translation
" instruction counter is in ktable
" set the k environment for understanding 1, 2 ...
" to designate this frame
" PDP-7 NOTES: only place that sets "env" w/o reading first;
" twoktab stores gk instructions in ktab.
gegk: " gen. "gk" instruction
lac ii i " load instruction (value ignored)
jms aget " get address portion of instruction
add kbot " add to ktab base
dac ii " store as new instruction pointer
jms s0put; add d.ii " set frame saved instruction pointer too
lac frame " get frame pointer
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 " save as env pointer
jmp ginterp " go on (w/o exit check)
dac env
jmp ginterp
" NOTE: recognition opcode "rt" (code at label regc!) places
" a copy of itself, with exit bit set on stack, since rt and
" gc use the same opcode, the stacked instruction comes here
" (addr points to "gen" code), so it calls the referenced code.
gegc: " gen. "gc" inst (call tmg coded subroutine)
jms advance; jmp ggoon " push current state
jms aget " get address from instruction
dac ii " use as new instruction pointer
jmp ginterp " go on (w/o exit check)
gegc:
jms advance; jmp ggoon
jms aget
dac ii
jmp ginterp
" trace routine (not a bug!)
" invoked from rinterp if switch 15 or 17 set (mask 05)
" invoked from ginterp if switch 15 or 16 set (mask 06)
" calls halt if switch 15 set (mask 04)
bug:0
dac 1f+2 " save pointer to instruction names
lac onenl " output newline
dac 1f+2
lac onenl
jms obuild
lac ii " output instruction address in octal
lac ii
jms putoct
lac ii i " get instruction
lrs 14
and o17 " get high four bits (opcode)
add 1f+2 " add to instruction name list pointer
dac 1f+2 " save (into output string!)
lac 1f+2 i " fetch two character instruction name
dac 1f+2 " save back into output string
lac 1f " get pointer to output string
jms obuild " output
lac ii i " get instruction
jms putoct " output in octal
las " get console switches
and d4 " is bit 15 set?
sza " no.
jms halt " yes: halt (output return address, then quit)
jmp bug i " no: continue.
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 " char ptr to <SPACE> XX <SPACE> <EOS>
" where XX will be instr name
1:0400000 .+1; 040; 0; 040777
+160 -175
View File
@@ -1,172 +1,161 @@
"** 13-120-147.pdf page 14
" move characters
" call with source address in AC
" dest addr after "jms move" instruction
move: 0
dac 9f+t " save source addr
lac move i " get dest addr
1:dac 2f " save dest addr after dchar call
lac 9f+t " restore source addr
jms lchar " load char
dac 9f+t+1 " save source char
jms dchar " store char
2: 0 " dest addr
lac 9f+t+1 " examine source char
sad o777 " EOS?
jmp 3f " yes
lac o400000 " get char addr increment
add 9f+t " add to source addr
dac 9f+t " save incremented source addr
lac o400000 " get char addr increment
add 2b " get incremented dest addr
jmp 1b " go back to top of loop (save dest addr)
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 " skip dest addr arg
lac 2b " return dest addr
3:isz move
lac 2b
jmp move i
t=t+1 "source address
t=t+1 "source character
" load character
" takes source character address in AC
lchar:0
dac junk " save source address
ral " rotate addr up (high bit into link)
lac junk i " fetch source word
snl " link set?
lrs 9 " no: move high 9 down
and o777 " get just 9 bits
jmp lchar i " return
dac junk
ral
lac junk i
snl
lrs 9
and o777
jmp lchar i
" deposit character
" takes dest addr after jms instruction
dchar:0
lmq " save char in MQ
lac dchar i " get dest addr
dac junk " save
spa " high bit set?
jmp 1f " yes: get mask for high 9
llss 9 " no: shift AC/MQ up 9 (LINK fills MQ low bits)
lac o777 " get mask for low 9
lmq
lac dchar i
dac junk
spa
jmp 1f
llss 9
lac o777
jmp .+2
1:0777000 " get mask for high 9
and junk i " and dest word w/ mask
omq " or MQ in
dac junk i " deposit in dest word
isz dchar " increment return to skip dest addr
jmp dchar i " return
1:0777000
and junk i
omq
dac junk i
isz dchar
jmp dchar i
" gets designated character from input
" (reads block from disk if needed)
" does not increment j
jget:0
1:lac j " get input char addr [here also from jmore]
jms cbetween; add jmin; add jmax " in current block?
jmp jmore " no: not in memory, read block
1:lac j
jms cbetween; add jmin; add jmax
jmp jmore
cma
add jmin
cma " get j-jmin
add jbot " make buffer address
jms lchar " fetch character from buffer
jms class; add ignore " char in "ignore" mask?
cma
add jbot
jms lchar
jms class; add ignore
"** 13-120-147.pdf page 15
jmp jget i " no: return character
lac j " yes: get source char addr
add o400000 " increment
dac j " save
jmp 1b " try again (may have crossed block boundary)
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 " get char offset for start of block
dac jmin " save as first
add ljsiz " add buf size
dac 9f+t " save in t0
lac jmax " get current end addr
jms cbetween; add jmin; add 9f+t " in range jmin<=jmax<t0?
lac jmin " not in range: get jmin
dac jmax " save as new jmax
dac 1f " and for seek
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 " 1's complement add!
cma " get jmin-jmax
add jbot " make buffer address
dac 2f " save as read dest
lac input " get input fd
sys seek " seek fd
add jmin
cma
add jbot
dac 2f
lac input
sys seek
1:0;0
-1 " get 0777777
dac 2f i " save in first word of read buffer
lac input " get input fd
sys read " read (ptr, count follow)
-1
dac 2f i
lac input
sys read
2:0;jsiz
sna " get anything?
lac d1 " zero: get 1 instead (will fetch 0777)
add jmax " add to block base
dac jmax " save as max char
jmp jget+1 " try jget again
sna
lac d1
add jmax
dac jmax
jmp jget+1
t=t+1
" gets next character from input
" called only from "rx" instruction
getj:0
lac j " input char addr
jms jget " get character
dac junk " save
lac j " increment character addr
lac j
jms jget
dac junk
lac j
add o400000
dac j
lac junk " return character
lac junk
jmp getj i
" compare two strings - assume both left justified
" called only from "find"
" takes one addr in AC, other following jms
" skips on match(?)
comp:0
dac 9f+t " save first argument pointer
lac comp i " fetch word after jms
dac 9f+t+1 " save second argument pointer
isz comp " skip argument word
1:lac 9f+t i " top of loop: fetch word from arg1
sad 9f+t+1 i " compare to arg2
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 " identical: check for EOS
jmp 3f
and 9f+t+1 i "do both start with eof?
spa " no: return without skip
2:isz comp " yes, give skip return
spa
2:isz comp
jmp comp i
3:and o600600 "is there an eof?
sza " NO
jmp 2b " YES: saw EOS w/ matching words: skip return
isz 9f+t " no EOS, increment ptr 1
isz 9f+t+1 " increment ptr 2
jmp 1b " loop.
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 " copy string to output
lmq " save char addr in AC in MQ
lac owrite " get obuf index
add obot " get obuf addr
dac 2f " save as move dest
lacq " get char addr back
1:jms move " move
2:0 " move dest
cma
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 " obuf full?
skp " yes
jmp obuild i " no: return
jms cbetween; add d0; add omax
skp
jmp obuild i
lac lochunk
jms oflush
@@ -187,92 +176,88 @@ oflush:0
" outputs octal string from sesignated value
octal: " BUILTIN
isz ii " increment instruction pointer
lac ii i " fetch instruction word
dac 2f " save as geoctal argument??
lac 1f " fetch "gf geoctal x" instr
jms twoktab " make two word ktab entry and goon
octal:
isz ii
lac ii i
dac 2f
lac 1f
jms twoktab
lac 2f i
1:gf geoctal x
2:0 " copy of inst word after octal invocation
" (ptr to word to output????)
2:0
"** 13-120-147.pdf page 17
geoctal: " native code invoked by "gf" inst in ktab
lac ii " get instruction pointer
dac 8 " save in auto-pre-increment reg 8
lac 8 i " fetch second ktab word
jms putoct " output as octal
jmp ggoon " success
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 " save output value
lac 7f " output "0"
dac 9f+t
lac 7f
jms obuild
dzm 9f+t+2 " clear non-zero digit flag
dzm 9f+t+2
-6
dac 9f+t+1 " init digit count to -6
dac 9f+t+1
1:lac 9f+t " get value
cll " clear link
lrs 15 " get high 3 bits right justified
add o60 " convert to ASCII digit
dac 8f+1 " save in output buffer
lls 18 " left justify remaining bits
dac 9f+t " save back in value
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 " yes: go output
jmp 2f
lac 8f+1 "no,is this nonzero?
sad o60
jmp 3f "no
2:lac 8f " output non-zero digit
2:lac 8f
jms obuild
law " get 760000
dac 9f+t+2 " save as non-zero digit seen flag
3:isz 9f+t+1 " increment digit count
jmp 1b " non-zero: keep going
jmp putoct i " count now zero: return
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 " "0" + EOS
8:0400000 .+1;0;end " digit, two 0777 EOS bytes
7: .+1; 060777
8:0400000 .+1;0;end
eof: " BUILTIN (succeed at EOF)
eof:
lac j
dac jsav " save j
dac jsav
jms jget
sad o777 " at EOF?
jmp goon " yes, succeed
jmp backup " no, restore j from jsav, and fail
"
" called with jms class; add chrtabptr
" skip on return if char in AC in referened character table
sad o777
jmp goon
jmp backup
class:0
dac junk1 " save input char
dac junk1
lrss 7
sza " high (0200) bit of input set?
jmp 2f " yes, fail
lls 3 " get word number (16 bits per word)
xct class i " execute "add table" instr after "jms class"
isz class " skip the add on return
dac junk " save word pointer
sza
jmp 2f
lls 3
xct class i
isz class
dac junk
"** 13-120-147.pdf page 18
cla
llss 4 " get low four of character (bit number)
add l.llss " make into lls instr
llss 4
add l.llss
dac 1f
lac junk i " get word from mask
1:llss " shift up by bit number (into sign bit)
spa " bit set?
2:isz class " yes: give skip return
lac junk1 " restore character
lac junk i
1:llss
spa
2:isz class
lac junk1
jmp class i
+82 -85
View File
@@ -1,115 +1,112 @@
"** 13-120-147.pdf page 19
" put symbuf symbol into table
table: " BUILTIN
lac equwrite " get equtab write index
dac equ " save as last found
table:
lac equwrite
dac equ
jms between; add d0; add equmax
jms halt " overflow
add delta " increment
dac equwrite " save as next to write
lac equ " get our entry index
add equbot " get our entry address
tad m1 " decrement for pre-auto-increment
dac 8 " save in auto-increment reg
lac symwrite " get name index into symtab
dac 8 i " save in equtab
add symbot " get symtab addr
dac 2f " save as move dest
lac mdelta " get negative equtab entry word count
1:dzm 8 i " zero equtab word
tad d1 " increment count
spa " positive?
jmp 1b " no, loop and zero another
lac sbbot " yes, get symbuf base
jms move " copy string into symtab (string table)
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 " increment char addr
add o400000
cma
add symbot
cma
add o400000
and o17777
dac symwrite " save new symtab write pointer
dac symwrite
jms between; add d0; add symmax
jms halt " symtab overflow
jmp goon " success
jms halt
jmp goon
" find occurrence of symbuf symbol in equtab
prev: " BUILTIN
lac equ " last entry found/created
jmp find+1 " start search
find: " BUILTIN
lac equwrite " get end index to equ table
dac 9f+t " save
lac o777 " get EOS
jms sbput " append to sbbuf
lac sbbot " get sbbuf base
dac 2f " stash as "comp" argument 2 (loop invariant)
1:lac 9f+t " get equbuf index
tad mdelta " decrement (by two)
dac 9f+t " save
spa " still positive?
jmp nuts " no: return failure
add equbot " turn into equbuf pointer
dac junk " save as temp
lac junk i " get symtab entry offset
add symbot " get symtab entry address
jms comp " compare
2:0 " compare arg2 here
jmp 1b " non-skip return: continue
lac 9f+t " skipped: get offset
dac equ " save as last found
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 " success!
jmp goon
t=t+1 "next equtab location to test
sbput:0 " put character in AC into symbuf (sbbuf)
lmq " save character in MQ
lac sbwrite " get sbbut write index
add sbbot " add to start of sbbuf
dac 1f " save as dchar dest
lacq " get char back
jms dchar " save
sbput:0
lmq
lac sbwrite
add sbbot
dac 1f
lacq
jms dchar
1:0
lac sbwrite " get sbbuf write index
add o400000 " increment
dac sbwrite " save back
lac sbwrite
add o400000
dac sbwrite
jms cbetween; add d0; add sbmax
jms halt " sbbuf overflow
jms halt
jmp sbput i
getname: " BUILTIN
lac equ " get last entry index
add equbot " get equtab addr (addr of pointer to string)
dac 9f+t " save in temp
lac 1f " get "gf" instruction
jms twoktab; lac 9f+t i " make 2-work ktab entry (does not return)
getname:
lac equ
add equbot
dac 9f+t
lac 1f
jms twoktab; lac 9f+t i
1:gf .+1 x " jump to native code & exit
lac ii " get instruction pointer
dac 8 " save in auto-pre-increment reg 8
lac 8 i " fetch next word (symtab index)
add symbot " make pointer into symtab
and o17777 " get just address
jms obuild " send to output
jmp ggoon " success
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
" takes first word (addr for gk instr) in AC
" and indirect load instr after "jms twoktab"
" Called (as final action) by builtins (symoct,octal,getname)
" DOES NOT RETURN!!!
twoktab:0
jms kput " save AC in ktab
jms kput
lac l.gk
add k " make gk intruction, pointing to new entry
dac nframe i " push onto nframe
add k
dac nframe i
isz nframe
xct twoktab i " execute lac i instruction after "jms twoktab"
jms kput " save in ktab as second word
jmp goon " success
xct twoktab i
jms kput
jmp goon
+38 -38
View File
@@ -1,75 +1,75 @@
"** 13-120-147.pdf page 21
char: " BUILTIN: match one char from bitset or fail.
char:
lac j
dac jsav
isz ii
jms ctest
jmp backup " not in bitset: restore j from jsav, fail
jmp backup
jmp goon
string: " BUILTIN: match zero or more chars from bitset
string:
isz ii
jms ctest
jmp goon " not in bitset, quit (but do not fail)
jmp goon
jmp string+1
ctest:0
jms jget
jms class; add ii i " bitset check w/ table ptr *ii
jmp ctest i " char not in bitset, return w/o skip
jms sbput " matched: add to symbuf
lac j " increment j (char ptr)
jms class; add ii i
jmp ctest i
jms sbput
lac j
add o400000
dac j
isz ctest " give skip return
isz ctest
jmp ctest i
mark: " BUILTIN: clear symbuf
jms jget " consume ignored characters
mark:
jms jget
dzm sbwrite
jmp goon
parsedo: " BUILTIN: invoke rule
parsedo:
isz ii
jms advance; jmp 3f " on retreat restore k
jms advance; jmp 1f " on retreat switch to generation
jms aget " get new instruction pointer
jms advance; jmp 3f
jms advance; jmp 1f
jms aget
dac ii
jmp rinterp
1:lac frame " on retreat (second advance call)
1:lac frame
add refrsz
dac ii " set instruction pointer to "nframe"
sad nframe " was anything pushed onto nframe??
jmp retreat " no: retreat again.
dac gflag " yes: set gflag (don't bundle on retreat)
dac ii
sad nframe
jmp retreat
dac gflag
lac gefrsz
dac dffrmsz " change (advance) frame size to generate size
jms advance; jmp 2f " on retreat switch back to recognition mode
jmp ginterp " interpret generate instructions!
dac dffrmsz
jms advance; jmp 2f
jmp ginterp
2:lac refrsz " on retreat from generate mode
dac dffrmsz " switch back to recognition sized frames
2:lac refrsz
dac dffrmsz
add frame
dac nframe " reset nframe pointer
dzm gflag " clear gflag (resume bundling on retreat)
jmp retreat " retreat (again)!!
dac nframe
dzm gflag
jmp retreat
3:jms s0get; add d.k " on retreat (first advance call)
dac k " restore k from current frame
3:jms s0get; add d.k
dac k
jmp goon
bundle: " BUILTIN: bundle results
jms bundlep " get bundle of results (if more than one)
bundle:
jms bundlep
"** 13-120-147.pdf page 22
dac 9f+t
sna " got any?
jmp goon " nope. success.
jms nframe0 " look for original nframe
dac nframe " restore
lac 9f+t " get bundle result ptr (in ktab if multi-word)
dac nframe i " push @nframe
sna
jmp goon
jms nframe0
dac nframe
lac 9f+t
dac nframe i
isz nframe
jmp goon
t=t+1
+108 -110
View File
@@ -1,63 +1,63 @@
"** 13-120-147.pdf page 23
rerm: " recognition "rm" instruction
jms aget " get address portion (abs addr)
jmp 1f " join "rs"to fetch
rers: " recognition "rs" instruction
jms aget " get address portion (positive frame offset)
add frame " add frame pointer
1:dac holdlv " save as "hold lvalue"
lac holdlv i " fetch addressed word
jmp 2f " go push
rerv: " recognition "rv" instruction
jms aget " get address portion
lls 6 " discard high six bits
lrs 6 " replac with six copies of LINK bit
2:dac nframe i " save @nstack
isz nframe " increment
jmp goon " success
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: " recognition "ro" (opr) instruction
jms decnf " pop top of nstack
dac rand1 " save as (op)rand 1
jms aget " get address portion of instruction
and o77 " get low six bits for sub-opcode
add obranch " make xct into o(pr)branch table
dac 2f " save
cma " negate (minus one)
tad unary " add unary base xct
spa " positive?
jmp 1f " no: was unary, skip second arg fetch
jms decnf " yes: binary op, pop second arg from nstack
dac rand2 " save as second (ope)rand
1:lac rand1 " get first (ope)rand in AC
2:xct " execute instruction from obranch table
jmp result " if noop, join result processing
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 " (no)op
jmp rorel ;le=op;op=op+1 " relop <=
jmp rorel ;ne=op;op=op+1 " relop !=
jmp rorel ;lt=op;op=op+1 " relop <
jmp rorel ;ge=op;op=op+1 " relop >=
jmp rorel ;eq=op;op=op+1 " relop ==
jmp rorel ;gt=op;op=op+1 " relop >
tad rand2 ;ad=op;op=op+1 " binop +
jms sub ;sb=op;op=op+1 " binop -
and rand2 ;an=op;op=op+1 " binop &
jmp roor ;or=op;op=op+1 " binop |
xor rand2 ;xo=op;op=op+1 " binop ^ (xor)
jmp rosr ;sr=op;op=op+1 " binop <<
jmp rosl ;sl=op;op=op+1 " binop >>
jmp romn ;mn=op;op=op+1 " binop min??
jmp romx ;mx=op;op=op+1 " binop max??
lac rand2 ;as=op;op=op+1 " binop ??? (always returns rh operand)
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 " unary + (noop)
jmp romi ;mi=op;op=op+1 " unary - (negate)
cma ;cm=op;op=op+1 " unary ~ (complement)
jmp roindir;indir=op;op=op+1 " unary indirect (fetch *holdlv)
lac holdlv ;addr=op;op=op+1 " unary addr (return last holdlv)
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
@@ -78,8 +78,6 @@ rorel: "<= 001
cma
jmp result
" return rand1 minus rand2
" used by rorel, rosub
sub:0
cma
tad rand2
@@ -87,79 +85,79 @@ sub:0
jmp sub i
roor:
lmq " save rand1 in MQ
lac rand2 " get rand2 in AC
omq " or AC and MQ
lmq
lac rand2
omq
jmp result
rosr:
lac rand2 " get rh operand
add l.lrs " make long right shift (fills with LINK)
cll " clear link
lac rand2
add l.lrs
cll
jmp 1f
rosl:
lac rand2 " get rh operand
add l.lls " make long left shift (fills from MQ)
clq " clear MQ
1:dac .+2 " save shift instruction
lac rand1 " get left hand operand
0 " perform shift
jmp result " join result processing
lac rand2
add l.lls
clq
1:dac .+2
lac rand1
0
jmp result
romn:
jms sub " get rand1-rand2
cma " complement (rand2-rand1-1)
jms sub
cma
jmp .+2
romx:
jms sub " get rand1-rand2
ral " rotate left (sign bit into LINK)
lac rand1 " get first operand
szl " link clear?
lac rand2 " no, get second operand instead
jmp result " return result
jms sub
ral
lac rand1
szl
lac rand2
jmp result
romi: " unary minus
cma " complement
tad d1 " add one
romi:
cma
tad d1
jmp result
roindir:
dac holdlv " save as "hold lvalue"
lac holdlv i " fetch value
dac holdlv
lac holdlv i
"** 13-120-147.pdf page 25
jmp result " return result
jmp result
result: " ro result processing
dac junk " save in temp
dac nframe i " store at *nframe++
result:
dac junk
dac nframe i
isz nframe
lac ii i " fetch original instruction
and stbit " get st(ore?) bit
sna " set?
jmp exprtest " no
lac junk " yes: get result
dac holdlv i " store at *holdlv
lac ii i " fetch original instruction
and fibit " fi(nal?) bit set?
sza " no, skip
jms decnf " yes: discard stacked result
jmp goon " succeed
exprtest: " here if st(ore?) bit not set
lac ii i " fetch instruction
and fibit " get fi(nal?) bit
sna " set?
jmp goon " no: succeed
jms decnf " yes: poped stacked result
lac nframe i " (redundant?????)
sza " was result zero?
-1 " no: get all ones
cma " complement (zero -> -1, -1 -> zero)
dac fflag " save as failure flag
lac ii i
and stbit
sna
jmp exprtest
lac junk
dac holdlv i
lac ii i
and fibit
sza
jms decnf
jmp goon
decnf:0 " decrement nframe, return stacked value
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
+69 -49
View File
@@ -1,8 +1,8 @@
"** 13-120-147.pdf page 26
9:.=.+t
end = -1 " end of string (two 0777 bytes)
" recognition / generation opcodes:
end = -1
no = 0000000
rx = 0040000; gx = rx
rc = 0100000
@@ -16,23 +16,23 @@ rm = 0440000
rs = 0500000
rv = 0540000
" literal words
ljmp:jmp
l.llss:llss
l.lrs:lrs
l.lls:lls
l.ra:ra " used for comparison
l.rb:rb " used for comparison
l.rw:rw " used for comparison
l.gk:gk " used to create instr in twoktab
l.gcx:gc x " NOT USED?
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
x = 020000 " exit bit (on all recog/gen instrs)
st = 0100 " store(?) bit on recog op (ro) instrs
fi = 0200 " final(?) bit on recog op (ro) instrs
opmask:0740000 " opcode mask
exitmask: x " exit bit mask
" number lits:
m1:0-1
d0:o0:0
d1:o1:1
@@ -43,18 +43,13 @@ d5:o5:5
d6:o6:6
d7:o7:7
d8:o10:8
asciisp:040 " ascii space (NOT USED)
asciinl:012 " ascii newline (NOT USED)
nl:012777 " newline + EOS
onenl:nl " pointer to newline+EOS
bugr:.+1;<rn>;<rx>;<rc>;<rt>;<rf>;<rw>;<ra>;<rb> " ptr to rec. op names
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> " ptr to gen. op names
" NOTE! ginterp ignores high bit of
" opcode (to allow as char indicator
" bit for gx instruction), but bug
" routine does not, so table should
" include two more entries???
bugg:.+1;<gn>;<gx>;<gz>;<gc>;<gf>;<gk>;<gp>;<gq>
o17:017
o60:060
@@ -71,7 +66,6 @@ o17777:017777
o757777:0757777
o600600:0600600
" variables
junk:0
junk1:0
@@ -106,29 +100,55 @@ sbbot:sbbuf
fflag:0
gflag:0
ignore:.+1;0400000;0;0;0;0;0;0;4 " pointer to ignored character set
" default ignore set (NUL and DEL)
" set stored using first (high) 16 of each wd.
frame:rstack " frame pointer
nframe:rstack+6 " next frame pointer
ignore:.+1;0400000;0;0;0;0;0;0;4
frame:rstack
nframe:rstack+6
env = ignore
d.ii = d2 " frame offset for instruction pointer
d.env = d3 " frame offset for env/ignore
d.blkmod = d3 " SYMBOL NOT USED
d.j = d4 " frame offset for saved j
d.k = d5 " frame offset for saved k
dffrmsz:6 " current frame size (one of [rg]efrsz)
framsiz:4 " LOCATION NOT USED
refrsz = d6 " recognition frame size
gefrsz = d4 " generation frame size
ii: start " interpreter instruction pointer
k:0 " saved data (ktab) pointer
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 " stack size
rmax: rsiz " stack size as variable
rbot:rstack " pointer to first stack entry
rtop:rstack+rsiz " pointer to last stack entry
rsiz = 500
rmax: rsiz
rbot:rstack
rtop:rstack+rsiz
owrite:0 " index into obuf
obot:obuf " pointer to first word of output buffer
osiz=64 " output buffer size
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?
+43 -43
View File
@@ -4,50 +4,50 @@
" no iot ops are defined
" system cal entries are defined
"
dac = 0040000 " MEM: deposit AC
jms = 0100000 " MEM: jump to subroutine
dzm = 0140000 " MEM: deposit zero to memory
lac = 0200000 " MEM: load AC
xor = 0240000 " MEM: XOR with AC
add = 0300000 " MEM: one's complement add
tad = 0340000 " MEM: two's complement add
xct = 0400000 " MEM: execute
isz = 0440000 " MEM: increment and skip if zero
and = 0500000 " MEM: AND
sad = 0540000 " MEM: skip if AC different
jmp = 0600000 " MEM: jump
eae = 0640000 " Extended Arithmetic Element
i = 020000 " indirect
opr = 0740000 " Operator (bit encoded)
law = opr i " OPR: load accumulator with (instr)
cma = opr 1 " OPR: complement AC
cml = opr 2 " OPR: complement LINK
ral = opr 010 " OPR: rotate AC left
rar = opr 020 " OPR: rotate AC right
sma = opr 0100 " OPR: skip on minus AC
sza = opr 0200 " OPR: skip on zero AC
snl = opr 0400 " OPR: skip on non-zero link
skp = opr 01000 " OPR: skip unconditionally
spa = opr 01100 " OPR: skip on positive AC
sna = opr 01200 " OPR: skip on non-zero AC
szl = opr 01400 " OPR: skip on zero link
cll = opr 04000 " OPR: clear link
cla = opr 010000 " OPR: clear AC
las = opr 010004 " OPR: load AC from switches
lrs = eae 0500 " EAE: long right shift
lrss = i lrs " EAE: long right shift, signed
lls = eae 0600 " EAE: long left shift
llss = i lls " EAE: long left shift, signed
als = eae 0700 " EAE: AC left shift
alss = i als " EAE: AC left shift, signed
lacq = eae 01002 " EAE: load AC with MQ
lacs = eae 01001 " EAE: load AC with SC (not used)
clq = eae 010000 " EAE: clear MQ
omq = eae 2 " EAE: OR MQ into AC
cmq = eae 4 " EAE: complement MQ
lmq = eae 012000 " EAE: load MQ from AC
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 " CAL instruction w/ indirect bit
sys = i
save = 1
open = 3
read = 4

Some files were not shown because too many files have changed in this diff Show More