------------------------------------------------------------------------------
LINC SPACE WAR, A. J. Hance, April 1965
------------------------------------------------------------------------------
Notes on the edition:
The listing consists of two parts, the actual printout on the left side,
followed by additional comments at the right side. These comments are not part
of the actual printout, but are annotations added by AJH using a typewriter
and a pen for the spaceship outlines and range brackets. These amendments are
here separated by consecutive 2 tab stops from the actual listing.
Underlined text in the annotations is represented as "_TEXT_".
Blank lines indicate page breaks in the original printout.
Columns are address, source line, label, assembler code (and annotations).
Assembler comments start with "[".
All numbers are octal, decimal values in annotations are suffixed by "(10)".
Program start at 0020 (line 5, "@" = LINC keyboard code 065 SQUARED MINUS).
Transliteration: Norbert Landsteiner, April 2021
------------------------------------------------------------------------------


	0001	[SPACE WAR.			          [SPACE WAR.
	0002	[VERSION OF
	0003	[APR.1965
	0004	[AJH LINC
	0005	@20
0020	0006		SETi6		/make sure that both missiles are
0021	0007		7777		 inactive
0022	0010		SETi7
0023	0011		7777
0024	0012		SAM 0		/interrogate knob 0 for _L_eft
0025	0013		SCR 3		 vehicle X direction and velocity
0026	0014		STA		 (X increment)
0027	0015		7M
0030	0016		ADD 6M		/obtain new X coordinate for L
0031	0017		BCLi		 vehicle from old coordinate plus
0032	0020		7000		 X increment. Clear leftmost
0033	0021		STC 6M		 3 bits to keep vehicle one
0034	0022		SAM 1		 plane of hyperspace
0035	0023		SCR 3		/knob 1 gives Y direction and
0036	0024		STA		 increment for L vehicle
0037	0025		7N		 (Y increment)
0040	0026		ADD 6N		/derive new Y coordinate for L
0041	0027		BCLi		 vehicle
0042	0030		7000
0043	0031		STC 6N
0044	0032		SAM 6		/knob 6 gives X increment for
0045	0033		SCR 3		 _R_ight vehicle
0046	0034		STA
0047	0035		7O
0050	0036		ADD 6O		/derive new X coordinate for R
0051	0037		BCLi		 vehicle
0052	0040		7000
0053	0041		STC 6O
0054	0042		SAM 7		/knob 7 gives Y increment for
0055	0043		SCR 3		 R vehicle
0056	0044		STA
0057	0045		7P
0060	0046		ADD 6P		/derive new Y coordinate for R
0061	0047		BCLi		 vehicle
0062	0050		7000
0063	0051		STC 6P
0064	0052		SETi1		 /parameters for display routine
0065	0053	#6M	200		/L vehicle, X coordinate
0066	0054		SETi2
0067	0055	#6N	0		/L vehicle, Y coordinate
0070	0056		SETi4
0071	0057	#7M	0		/L vehicle, X increment
0072	0060		SETi5
0073	0061	#7N	0		/L vehicle, Y increment
0074	0062	#5A	JMP 7I		/jump to _vehicle display_
0075	0063		SETi1
0076	0064	#6O	600		/R vehicle, X coordinate
0077	0065		SETi2
0100	0066	#6P	0		/R vehicle, Y coordinate
0101	0067		SETi4
0102	0070	#7O	0		/R vehicle, X increment
0103	0071		SETi5
0104	0072	#7P	0		/R vehicle, Y increment
0105	0073	#5B	JMP 7I		/jump to _vehicle display_
0106	0074		XSK 6		/is L missile in flight?
0107	0075	#5C	JMP 7W		/yes, jump to _display L missile_
0110	0076		XSK 7		/is R missile in flight?
0111	0077	#5D	JMP 7X		/yes, jump to _display R missile_

0112	0100		SNSi5		          [SPACE WAR.
0113	0101	#5E	JMP 7U		/launch L missile if sense switch
0114	0102		SNSi0		 5 is up
0115	0103	#5F	JMP 7V		/launch R missile if sense switch
0116	0104		JMP 6X		 0 is up
	0105	[LAUNCH MIS			/jump to _check coincidence_
0117	0106	#7U	LDA		/launch L missile at twice X
0120	0107		7M		 velocity of L vehicle (i.e.
0121	0110		ROL 1		 missile increment is twice that
0122	0111		STC 7O		 of vehicle at time of launch)
0123	0112		ADD 6M
0124	0113		STAi
0125	0114	#4L	0		/X coordinate of vehicle (or L
0126	0115		STC 11		 missile) at time of launch
0127	0116		ADD 7N		/L missile Y velocity (increment)
0130	0117		ROL 1		 twice that of L vehicle at time
0131	0120		STC 7R		 of launch
0132	0121		ADDi
0133	0122		STAi
0134	0123	#4M	0		/Y coordinate of launch point of
0135	0124		STC 6R		 L missile
0136	0125		SETi6		/set timer for missile life of
0137	0126		7500		 191(10) display cycles
0140	0127		JMP 0		/return jump
0141	0130	#7V	LDA		/launch R missile at twice X
0142	0131		7O		 increment of R vehicle
0143	0132		ROL 1
0144	0133		STC 7S
0145	0134		ADD 6O
0146	0135		STAi
0147	0136	#4R	0		/X coordinate of R missile launch
0150	0137		STC 12		 point
0151	0140		ADD 7P		/R missile Y increment is twice
0152	0141		ROL 1		 that of R vehicle
0153	0142		STC 7T
0154	0143		ADD 6P
0155	0144		STAi
0156	0145	#4S	0		/Y coordinate of R missile launch
0157	0146		STC 6T		 point
0160	0147		SETi7		/set timer for R missile life
0161	0150		7500
0162	0151		JMP 0		/return jump
	0152	[DISPLAY MIS
0163	0153	#7W	LDAi		DISPLAY L MISSILE
0164	0154	#7Q	0		/L missile increment plus old
0165	0155		ADD 11		 coordinate given new L missile
0166	0156		BCLi		 X coordinate
0167	0157		7000
0170	0160		STC 11		/L missile X coordinate in reg.11
0171	0161		LDAi		/L missile increment plus old
0172	0162	#7R	0		 coordinate give L missile
0173	0163		ADD 6R		 Y coordinate
0174	0164		BCLi
0175	0165		7000
0176	0166		STAi
0177	0167	#6R	0		/L missile Y coordinate
0200	0170		DIS 11		/display
0201	0171		LDAi6		/index life counter
0202	0172		JMP 0		/return jump
0203	0173	#7X	LDAi		DISPLAY R MISSILE
0204	0174	#7S	0		/R missile increment plus old
0205	0175		ADD 12		 coordinate given new R missile
0206	0176		BCLi		 X coordinate
0207	0177		7000

0210	0200		STC 12		          [SPACE WAR.
0211	0201		LDAi		/R missile X coordinate in reg.12
0212	0202	#7T	0		/R missile increment plus old
0213	0203		ADD 6T		 coordinate given new R missile
0214	0204		BCLi		 Y coordinate
0215	0205		7000
0216	0206		STAi
0217	0207	#6T	0		/R missile Y coordinate
0220	0210		DIS 12		/display
0221	0211		LDAi7		/index life counter
0222	0212		JMP 0		/return jump
	0213	[DISPL VEHICLE			VEHICLE DISPLAY
0223	0214	#7I	SET 10		/store return jump in reg.10
0224	0215		0
0225	0216		LDA		/X increment to accumulator
0226	0217		4
0227	0220		AZEi
0230	0221		JMP 7J		/if zero, vehicle is perpendicular
0231	0222		APO
0232	0223		JMP 7K		/if negative, vehicle points left
0233	0224		LDA		/if positive, vehicle points right
0234	0225		5		/pointing right.Check Y increment
0235	0226		AZEi
0236	0227		JMP 6D		/if zero, points horizontally R
0237	0230		APO
0240	0231		JMP 6H		/if neg., points down and R
0241	0232		JMP 6G		/if pos., points up and R
0242	0233	#7K	LDA		/pointing left.Check Y increment
0243	0234		5
0244	0235		AZEi		/if zero, points horizontally L
0245	0236		JMP 6C
0246	0237		APO
0247	0240		JMP 6F		/if neg., points down and L
0250	0241		JMP 6E		/if pos., points up and L
0251	0242	#7J	LDA		/perpendicular. Check Y increment
0252	0243		5
0253	0244		AZE
0254	0245		APOi		/if zero or pos.,points perpendic-
0255	0246		JMP 6A		 ularly up
0256	0247		JMP 6B		/if neg. points perpendic. up
0257	0250	#6A	SETi3
0260	0251		7A		/entry for perpendic. up
0261	0252		JMP 7L
0262	0253	#6B	SETi3
0263	0254		7B		/entry for perpendic.down
0264	0255		JMP 7L
0265	0256	#6C	SETi3
0266	0257		7C		/entry for horiz. left
0267	0260		JMP 7L
0270	0261	#6D	SETi3
0271	0262		7D		/entry for horiz. right
0272	0263		JMP 7L
0273	0264	#6E	SETi3
0274	0265		7E		/entry for pointing L and up
0275	0266		JMP 7L
0276	0267	#6F	SETi3
0277	0270		7F		/entry for pointing L and down
0300	0271		JMP 7L
0301	0272	#6G	SETi3
0302	0273		7G		/entry for pointing R and up
0303	0274		JMP 7L
0304	0275	#6H	SETi3
0305	0276		7H		/entry for pointing R and down
0306	0277		JMP 7L

0307	0300	#7L	LDAi		          [SPACE WAR.
0310	0301		-14		/begin display of appropriate
0311	0302		ADM		 matrix. Reg. 3 points to matrix
0312	0303		1		 array to be used
0313	0304		LDAi		/X axis left edge coordinate to
0314	0305		14		 register 1
0315	0306		ADD 2		/Y coordinate from reg.2
0316	0307		SRO 3		/reg.3 points to 12-bit matrices
0317	0310		JMP p+3		 in vehicle display arrays
0320	0311		DISi1		/display
0321	0312		JMP p+2
0322	0313		XSKi1		/increment X axis by 2 for each
0323	0314		XSKi1		 point
0324	0315		NOP
0325	0316		SROi
0326	0317		3777		/repeat 12 times for one line of
0327	0320		JMP p-11		 matrix
0330	0321		ADAi
0331	0322		-2		/decrement Y axis by 2
0332	0323		STC 2
0333	0324		LDAi		/reset X axis to left edge
0334	0325		-30
0335	0326		ADM
0336	0327		1
0337	0330		XSKi3		/index to next line (12 bits) of
0340	0331		CLR		 display
0341	0332		SROi
0342	0333		3777		/repeat for 12 lines in matrix
0343	0334		JMP p-26
0344	0335		JMP 10		 /return jump
	0336	[MATRICES			 MATRICES FOR VEHICLES IN VARIOUS
0345	0337	#7A	7677		----+      POSITIONS
0346	0340		7437		    |
0347	0341		7017		    |--- /perpendicular & up
0350	0342		7017		    |
0351	0343		7017		    |           /\
0352	0344		7017		    |          |  |
0353	0345		7017		    |          +--+
0354	0346		7017		    |           ||
0355	0347		7017		    |
0356	0350	#7B	7537		--+ |
0357	0351		7537		  | |
0360	0352		7537		--|-+
0361	0353		7017		  |
0362	0354		7017		  |
0363	0355		7017		  |----- /perpendicular & down
0364	0356		7017		  |
0365	0357		7017		  |             ||
0366	0360		7017		  |            +--+
0367	0361		7017		  |            |  |
0370	0362		7437		  |             \/
0371	0363		7677		--+
0372	0364	#7D	7777		----+
0373	0365		7777		    |
0374	0366		7777		    |
0375	0367		6007		    |
0376	0370		4000		    |
0377	0371		0007		    |--- /horizontal, pointing right
0400	0372		4000		    |
0401	0373		6007		    |          +---
0402	0374	#7C	7777		--+ |        --|    \
0403	0375		7777		  | |        --|    /
0404	0376		7777		  | |          +---
0405	0377		7777		--|-+

0406	0400		7003		  |       [SPACE WAR.
0407	0401		0001		  |
0410	0402		7000		  |----- /horizontal, pointing left
0411	0403		0001		  |
0412	0404		7003		  |              ---+
0413	0405		7777		  |            /    |--
0414	0406	#7G	7777		--|-+          \    |--
0415	0407		7777		--+ |            ---+
0416	0410		6077		    |
0417	0411		6037		    |
0420	0412		6017		    |--- /pointing right and up
0421	0413		6007		    |             ___
0422	0414		7003		    |            /   |
0423	0415		7407		    |           /    |
0424	0416		7613		    |           \    |
0425	0417		7725		    |           /\  /
0426	0420		7772		    |            /\/
0427	0421	#7H	7775		--+-+
0430	0422		7772		  |
0431	0423		7725		  |
0432	0424		7613		  |
0433	0425		7407		  |----- /pointing right and down
0434	0426		7003		  |
0435	0427		6007		  |              \/\
0436	0430		6017		  |             \/  \
0437	0431		6037		  |             /    |
0440	0432		6077		  |             \    |
0441	0433	#7E	7777		--|-+            \___|
0442	0434		7777		--+ |
0443	0435		7703		    |
0444	0436		7603		    |
0445	0437		7403		    |--- /pointing left and up
0446	0440		7003		    |            ___
0447	0441		6007		    |           |   \
0450	0442		7017		    |           |    \
0451	0443		6437		    |           |    /
0452	0444		5277		    |            \  /\
0453	0445		2777		    |             \/\
0454	0446	#7F	5777		--+-+
0455	0447		2777		  |
0456	0450		5277		  |
0457	0451		6437		  |
0460	0452		7017		  |----- /pointing left and down
0461	0453		6007		  |
0462	0454		7003		  |               /\/
0463	0455		7403		  |              /  \/
0464	0456		7603		  |             |    \
0465	0457		7703		  |             |    /
0466	0460		7777		  |             |___/
0467	0461		7777		--+
0470	0462	#5Z	SETi4		EXPLOSION DISPLAY
0471	0463		-200
0472	0464		SETi3		/reg. 3 points to matrix array
0473	0465		6Z
0474	0466		SETi10		/set up return jump in reg.10
0475	0467		6000+5N
0476	0470		JMP 7L		/jump to part of vehicle display
0477	0471	#5N	LDAi
0500	0472		14
0501	0473		ADM		/reset Y axis
0502	0474		2
0503	0475		LDAi
0504	0476		14
0505	0477		ADM		/reset X axis

0506	0500		1		          [SPACE WAR.
0507	0501		XSKi4
0510	0502		JMP 5Z+2		/repeat explosion display 128(10)
0511	0503		LDAi		 times
0512	0504		6024
0513	0505		STA		/replace entries to explosion
0514	0506		6X		 display and coincidence check
0515	0507		STC 5Z		 with a recycling jump
0516	0510		JMP 24		/return to next display cycle
0517	0511	#6Z	7637		--- MATRIX FOR EXPLOSION
0520	0512		5635
0521	0513		6633
0522	0514		7007
0523	0515		7007
0524	0516		0000
0525	0517		0000
0526	0520		7007
0527	0521		7007
0530	0522		6633
0531	0523		5635
0532	0524		7637		----
0533	0525	#6X	XSK 6		CHECK COINCIDENCE
0534	0526		JMP p+2		/is left missile in flight?
0535	0527		JMP 4A		/no, go check right missile
0536	0530		LDA		/yes, is L missile armed?(i.e.
0537	0531		4L		 has it left the vicinity of the
0540	0532		ADD 4M		 launching point?)
0541	0533		COM
0542	0534		ADD 6M
0543	0535		ADD 6N
0544	0536		JMP 7Y		/jump to fuse criterion
0545	0537		AZEi
0546	0540		JMP 4A		/L missile is inactive, go check
0547	0541		LDA		                  R missile
0550	0542		6M		/check for X axis coincidence of
0551	0543		COM		 L missile and L vehicle
0552	0544		ADD 11
0553	0545		JMP 7Z		/jump to proximity criterion
0554	0546		AZE
0555	0547		JMP 4B		/L missile and L vehicle not
0556	0550		LDA		 coincident.Go check L missile &
0557	0551		6N		                    R vehicle
0560	0552		COM		/X axes coincident, check Y axis
0561	0553		ADD 6R		 coincidence of L missile and L
0562	0554		JMP 7Z		/jump to proximity criterion/ ve[hicle]
0563	0555		AZE
0564	0556		JMP 4B		/L missile & L vehicle not coin-
0565	0557		LDAi		 cident. Go check L missile & R
0566	0560		16		 vehicle
0567	0561		STA		/Coincidence of L missile and L
0570	0562		5A		 vehicle. Destroy entries to
0571	0563		STA		 L missile and L vehicle display
0572	0564		5C		 and to L missile launcher
0573	0565		STC 5E
0574	0566		JMP 5L		/and jump to L vehicle explosion
0575	0567	#4B	LDA
0576	0570		6O		/check X axes of L missile and
0577	0571		COM		 R vehicle
0600	0572		ADD 11
0601	0573		JMP 7Z		/jump tp proximity criterion
0602	0574		AZE		/L missile and R vehicle X axes
0603	0575		JMP 4A		 not coincident. Go check if R
0604	0576		LDA		 missile in flight
0605	0577		6P

0606	0600		COM		          [SPACE WAR.
0607	0601		ADD 6R		/X axes coincident. Check Y axis
0610	0602		JMP 7Z		 coincidence of L missile and R
0611	0603		AZE		 vehicle
0612	0604		JMP 4A		/not coincident. Go check if R
0613	0605		LDAi		 missile is in flight
0614	0606		16		/Y axes of L missile and R vehicle
0615	0607		STA		 are also coincident. Destroy
0616	0610		5B		 entries to L missile and R
0617	0611		STA		 vehicle display and to L missile
0620	0612		5C		 launcher
0621	0613		STC 5F
0622	0614		JMP 5R		/and jump to R vehicle explosion
0623	0615	#4A	XSK 7		/is R missile in flight?
0624	0616		JMP p+2
0625	0617		JMP 6W		/no, go check proximity of L & R
0626	0620		LDA		 vehicles
0627	0621		4R		/yes, is R missile armed?
0630	0622		ADD 4S
0631	0623		COM
0632	0624		ADD 6O
0633	0625		ADD 6P
0634	0626		JMP 7Y		/jump to fuse criterion
0635	0627		AZEi		/R missile is inactive. Go check
0636	0630		JMP 6W		 proximity of L & R vehicles
0637	0631		LDA		/check X axis coincidence of R
0640	0632		6O		 missile and R vehicle
0641	0633		COM
0642	0634		ADD 12
0643	0635		JMP 7Z		/jump to proximity criterion
0644	0636		AZE		/R missile and R vehicle not co-
0645	0637		JMP 4C		 incident. Check R missile & L
0646	0640		LDA		 vehicle
0647	0641		6P		/X axes coincident. Check Y axes
0650	0642		COM		 of R missile and R vehicle
0651	0643		ADD 6T
0652	0644		JMP 7Z		/jump to proximity criterion
0653	0645		AZE		/R missile and R vehicle not
0654	0646		JMP 4C		 coincident. Check R missile and
0655	0647		LDAi		 L vehicle
0656	0650		16		/R missile and R vehicle are
0657	0651		STA		 coincident. Destroy entries to
0660	0652		5B		 R missile and R vehicle displays
0661	0653		STA		 and R missile launcher
0662	0654		5D
0663	0655		STC 5F
0664	0656		JMP 5R		/and jump to R vehicle explosion
0665	0657	#4C	LDA		/check X axis coincidence of R
0666	0660		6M		 missile and L vehicle
0667	0661		COM
0670	0662		ADD 12
0671	0663		JMP 7Z		/jump to proximity criterion
0672	0664		AZE		/R missile and L vehicle not
0673	0665		JMP 6W		 coincident. Go check L & R
0674	0666		LDA		 vehicle coincidence
0675	0667		6N		/X axes coincident. Check Y axis
0676	0670		COM		 coincidence of R missile and L
0677	0671		ADD 6T		 vehicle
0700	0672		JMP 7Z		/jump to proximity criterion
0701	0673		AZE		/R missile and L vehicle not co-
0702	0674		JMP 6W		 incident. Go check L & R vehicle
0703	0675		LDAi		 coincidence
0704	0676		16		/R missile and L vehicle coincident
0705	0677		STA

0706	0700		5A		          [SPACE WAR.
0707	0701		STA		/destroy entries to R missile and
0710	0702		5D		 L vehicle displays and R missile
0711	0703		STC 5E		 launcher
0712	0704		JMP 5L		/and jump to L vehicle explosion
0713	0705	#6W	LDA		/check proximity of L & R vehicles
0714	0706		6M		 in X axis
0715	0707		COM
0716	0710		ADD 6O
0717	0711		JMP 7Z		/jump to proximity criterion
0720	0712		AZE		/R and L vehicles not coin-
0721	0713		JMP 24		 cident. Go repeat display cycle
0722	0714		LDA		/X axes coincident. Check Y axis
0723	0715		6N		 coincidence of R and L vehicles
0724	0716		COM
0725	0717		ADD 6P
0726	0720		JMP 7Z		/jump to proximity criterion
0727	0721		AZE		/Y axes not coincident. Go start
0730	0722		JMP 24		 new display cycle
0731	0723		LDAi		/R & L coincident.
0732	0724		16		/destroy entries into R vehicle
0733	0725		STA		 and L vehicle displays and entries
0734	0726		5A		 to L missile and R missile
0735	0727		STA		 displays
0736	0730		5B
0737	0731		STA
0740	0732		5E		/and enter R vehicle explosion
0741	0733		STC 5F
0742	0734	#5R	SET 1		/Right vehicle explosion
0743	0735		6O
0744	0736		SET 2
0745	0737		6P
0746	0740		JMP 5Z		/jump to _explosion display_
0747	0741	#5L	SET 1		/Left vehicle explosion
0750	0742		6M
0751	0743		SET 2
0752	0744		6N
0753	0745		JMP 5Z		/jump to _explosion display_
0754	0746	#7Y	SCR 7		FUSE CRITERION
0755	0747		JMP 0
0756	0750	#7Z	SCR 5		PROXIMITY CRITERION
0757	0751		JMP 0
	0752	[END
