Skip to content

Commit b46b160

Browse files
authored
Assemble psych and include it in the build. (DoctorWkt#232)
Psych was added to the build system. It requires fops.s for maths. Two notable things need to be fixed to make it assemble: * d1 must be defined, presumably to a 1 following the patterns of other decimal numbers. * variable xx must be renamed so it doesn't clash with the xx instruction mnemonic used by the perl cross assembler.
1 parent dd6b613 commit b46b160

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

build/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ cmd: dirs \
133133
$(BINDIR)/moo \
134134
$(BINDIR)/nm \
135135
$(BINDIR)/p \
136+
$(BINDIR)/psych \
136137
$(BINDIR)/rm \
137138
$(BINDIR)/rn \
138139
$(BINDIR)/roff \
@@ -227,6 +228,10 @@ P=$(CMDSRC)/p1.s $(CMDSRC)/p2.s $(CMDSRC)/p3.s $(CMDSRC)/p4.s $(CMDSRC)/p5.s
227228
$(BINDIR)/p: $(P)
228229
$(AS) $(ASARGS) -o $(BINDIR)/p $(P)
229230

231+
PSYCH=$(CMDSRC)/psych.s $(CMDSRC)/fop.s
232+
$(BINDIR)/psych: $(PSYCH)
233+
$(AS) $(ASARGS) -o $(BINDIR)/psych $(PSYCH)
234+
230235
$(BINDIR)/rm: $(CMDSRC)/rm.s
231236
$(AS) $(ASARGS) -o $(BINDIR)/rm $(CMDSRC)/rm.s
232237

build/proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dd drwr- -1 4
5050
nm frwr- -1 bin/nm
5151
od frwr- -1 bin/od
5252
p frwr- -1 bin/p
53+
psych frwr- -1 bin/psych
5354
rm frwr- -1 bin/rm
5455
rn frwr- -1 bin/rn
5556
roff frwr- -1 bin/roff

src/cmd/psych.s

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ restart:
2222
fst; z "[ z = z + g - scan markup]
2323
fst; oldx "[ g = -g * fact - scan markup]
2424
fst; oldy "[ fact = 1 / fact - scan markup]
25-
lac o400000 "[ xx = 500. * d * sin(b + pi/2) - scan markup]
25+
lac o400000 "[ exex = 500. * d * sin(b + pi/2) - scan markup]
2626
dac i 11 "[ ni() - scan markup]
2727
dac i 11 "[ yy = 500. * d * sin(b) - scan markup]
2828
lac setx "[ ni() - scan markup]
@@ -51,7 +51,7 @@ loop:
5151
sin
5252
fmp; d
5353
fmp; fp500
54-
fst; xx
54+
fst; exex
5555
jms in
5656
jmp done
5757
fld; b
@@ -67,7 +67,7 @@ loop:
6767
dac i 11
6868
fld; oldx
6969
fng
70-
fad; xx
70+
fad; exex
7171
fix
7272
spa
7373
xor o775777
@@ -81,7 +81,7 @@ loop:
8181
xor o775777
8282
tad vecy
8383
dac i 10
84-
fld; xx
84+
fld; exex
8585
fst; oldx
8686
fld; yy
8787
fst; oldy
@@ -261,7 +261,7 @@ release: 0
261261

262262
char: 0
263263
stick: 0
264-
xx: 0; 0; 0
264+
exex: 0; 0; 0
265265
oldx: 0; 0; 0
266266
yy: 0; 0; 0
267267
oldy: 0;0 0; 0
@@ -277,6 +277,7 @@ o177777: 0177777
277277
o12000: 012000
278278
o61000: 061000
279279
om60: -060
280+
d1: 1
280281
d13: 13
281282
d500: 500
282283
o141000: 0141000

0 commit comments

Comments
 (0)