diff --git a/build/Makefile b/build/Makefile index 1451390..9c6388b 100644 --- a/build/Makefile +++ b/build/Makefile @@ -79,8 +79,8 @@ dirs: # The commands that came from the original scans cmd: dirs $(BINDIR)/as $(BINDIR)/cat $(BINDIR)/check $(BINDIR)/chmod \ - $(BINDIR)/chown $(BINDIR)/chrm $(BINDIR)/cp $(BINDIR)/ds $(BINDIR)/ed \ - $(BINDIR)/init + $(BINDIR)/chown $(BINDIR)/chrm $(BINDIR)/cp $(BINDIR)/ds \ + $(BINDIR)/dskres $(BINDIR)/dsksav $(BINDIR)/ed $(BINDIR)/init # Alternate commands: no dd, but . and .. altcmd: dirs $(BINDIR)/as $(BINDIR)/cat $(BINDIR)/check $(BINDIR)/chmod \ @@ -114,6 +114,12 @@ $(BINDIR)/cp: $(CMDSRC)/cp.s $(BINDIR)/ds: $(CMDSRC)/ds.s $(AS) $(ASARGS) -o $(BINDIR)/ds $(CMDSRC)/ds.s +$(BINDIR)/dskres: $(CMDSRC)/dskres.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s + $(AS) $(ASARGS) -o $(BINDIR)/dskres $(CMDSRC)/dskres.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s + +$(BINDIR)/dsksav: $(CMDSRC)/dsksav.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s + $(AS) $(ASARGS) -o $(BINDIR)/dsksav $(CMDSRC)/dsksav.s $(CMDSRC)/dskio.s $(SYSSRC)/sop.s + $(BINDIR)/ed: $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s $(AS) $(ASARGS) -o $(BINDIR)/ed $(CMDSRC)/ed1.s $(CMDSRC)/ed2.s diff --git a/build/proto b/build/proto index 2d90dbc..2892d88 100644 --- a/build/proto +++ b/build/proto @@ -27,6 +27,8 @@ dd drwr- -1 4 cp frwr- -1 bin/cp date frwr- -1 bin/date ds frwr- -1 bin/ds + dskres frwr- -1 bin/dskres + dsksav frwr- -1 bin/dsksav ed frwr- -1 bin/ed init frwr- -1 bin/init ln frwr- -1 bin/ln diff --git a/src/cmd/dskio.s b/src/cmd/dskio.s index 30cf100..28cbe0c 100644 --- a/src/cmd/dskio.s +++ b/src/cmd/dskio.s @@ -27,7 +27,7 @@ dskwr1: 0 jmp i dskwr1 -iskio: 0 +dskio: 0 cll; idiv; 80 dac 2f lacq @@ -75,4 +75,4 @@ o200000: 0200000 dskbufp: dskbuf side: .=.+1 -dskbuf: .=.+640 \ No newline at end of file +dskbuf: .=.+640 diff --git a/src/cmd/ed1.s b/src/cmd/ed1.s index 1a05695..eb9e192 100644 --- a/src/cmd/ed1.s +++ b/src/cmd/ed1.s @@ -100,7 +100,7 @@ ca: ca1: jms rline lac line - sad o56012 + sad o56012 " . NL? jmp advanc jms append jmp ca1 diff --git a/src/cmd/init.s b/src/cmd/init.s index fd966bf..6ba4867 100644 --- a/src/cmd/init.s +++ b/src/cmd/init.s @@ -4,16 +4,16 @@ sys intrp jms init1 " Fork the first child connected to ttyin/ttyout jms init2 " Fork the second child connected to keyboard/display -1: +l: sys rmes " Wait for a child to exit sad pid1 jmp 1f " It was child 1, so jump to 1f and restart it sad pid2 jms init2 " It was child 2, so restart it - jmp 1 " and loop back. XXX: weird use of 1: not 1b. I don't like it! + jmp l " and loop back. 1: jms init1 - jmp 1 " Weird use of 1: not 1b. I don't like it! + jmp l init1: 0 sys fork " Fork a child process diff --git a/src/other/pbsh.s b/src/other/pbsh.s index 989a3b6..63ed3c0 100644 --- a/src/other/pbsh.s +++ b/src/other/pbsh.s @@ -332,7 +332,7 @@ rline: 0 1: cla; sys read; char; 1 " Read in one character from stdin sna " read ok? - sys exit " EOF: quit + jmp quit " no lac char lrss 9 " Get it and shift down 9 bits sad o100 " '@' (kill) character? @@ -353,6 +353,11 @@ rline: 0 dac 8 jmp 1b " and loop back +quit: + lac d1; sys smes " wake up init + sys exit + +" copied from cat.s: putc: 0 and o177 " Keep the lowest 7 bits and save into 2f+1 dac 2f+1 diff --git a/src/sys/s3.s b/src/sys/s3.s index c686a6e..9bf9cc9 100644 --- a/src/sys/s3.s +++ b/src/sys/s3.s @@ -283,11 +283,11 @@ rkbdi: lmq and o155 sad o55 - jmp 1f + jmp 1f " -/=? map to =?-/ ??? lacq and o137 sad o134 - skp + skp " \| map to Ll ??? jmp 2f 1: lacq diff --git a/src/sys/s7.s b/src/sys/s7.s index 6f3ea7d..f6b2a7a 100644 --- a/src/sys/s7.s +++ b/src/sys/s7.s @@ -77,18 +77,18 @@ cnop: " fetched as constant in iread 1: lds " load display status (see 03-scope.pdf pg 25) sma ral " display trap set? (and rotate left) jmp 1f " not set - cdf " clear display flags + cdf " display done executing; clear display flags lac .dspb sna - jmp piret + jmp piret " return now if .dspb == 0 tad dm3 sna - jmp dsprestart - dac .dspb + jmp dsprestart " start display if .dspb == 3 + dac .dspb " otherwise, .dspb -= 3 and return jmp piret dsprestart: lac d1 - dac .dspb " set .dsbp = 1 + dac .dspb " set .dspb = 1 lac dspbufp " load display buf pointer beg " start display processor -10