                /part 23
/test jdp and lap
/memory zeroed by part 22.
/best test of wild jump

0/

	23	/program number
stt,	szs 10	/if switch 1 up
	hlt	/halt after read-in

/begin tests

	cla	/test lap with zeroed ac first
	dac 3000	/also zero pc location for jdp
	lap	/first test of lap
	add thr	/add 3.  coincides with jdp test
	dac tmp	/save

jd1,	jdp 3000	/first test of jdp
	hlt	/error, jump failed

3000/

	0	/location for pc and garbage
	sas tmp	/be sure ac was not changed
	hlt	/error
	sas 3000	/ac and 3000 should agree
	hlt	/error
	law jd1 1
	xor 3000
	and msk	/get rid of garbage
	sza
	hlt	/error, pc not correctly saved

	clc	/777777 to ac
	dac 4777	/test save of pc into ones
	lap	/second lap test
	add thr	/thr is 3
	dac tmp

jd2,	jdp 4777	/second test of jdp
	hlt	/error, jump failed

4777/

	0	/location for pc and garbage
	sas tmp	/be sure ac was not changed
	hlt	/error
	sas 4777
	hlt	/error
	law jd2 1
	xor 4777
	and msk	/mask out garbage
	sza
	hlt	/error

	lap	/third test of lap
	add fiv	/5
	dac tmp	/save for test





                                                                      	dac 6000	/location for pc for next jdp
	cla	/this time, clear ac

jd3,	jdp 6000	/third and final jdp test
	hlt	/in case of error

6000/

	0	/location for pc and garbage
	sza	/if ac was changed,
	hlt	/big error--halt
	lac 6000	/get saved pc
	sas tmp	/should agree with last lap plus 5
	hlt	/error
	law jd3 1
	xor 6000
	and msk	/remove garbage
	sza
	hlt	/error

/end of jdp tests

	szs 20		/if switch 2 up,
	jmp stt 2	/jump back for iteration
	jmp 7772		/read in next test

/random constants

thr,	3
fiv,	5
msk,	7777
tmp,	0

/end of program

foo,

start
                                                              
                                                          
