L X Load Sys2

; Display the registers which will contain the overall checksum and
; component checksums
L D3 Addr LM 10
L D4 Addr LM 11
L D5 Addr LM 12
L D6 Addr LM 13
L D7 Addr LM 14

; Display the registers in which the checksums will be stored
L D8 Addr CSUMD
L D9 Addr CSUMD 1
L D10 Addr CSUMD 2
L D11 Addr CSUMD 3

; Clear the junk left for debugging
L D14 Addr 
L D15 Addr 
L D16 Addr 

; Now show the user what's happening
L X DisplayOn
L X TimeOut 3777;	2 sec timeout for "Go"
L X Go RESET
L X Skip 2;		Skip if "Go" finishes ok
L X ShowError RESET hung--hardware problem
L X Return 0;		Skip to EOF

L A0 SkipVEql 30;	Verify IMA=30 (RESET finished ok)
L X Skip 1
L X Skip 2
L X ShowError RESET should have halted at 30--hardware problem
L X Return 0;		Skip to EOF

; Now run the Checker
L X TimeOut 3777;	2 sec timeout for "Go"
L X Go INIT
L X Skip 2;		Skip if "Go" finishes ok
L X ShowError INIT hung--hardware problem
L X Return 0;		Skip to EOF

; Should finish at 20 if checksums bad or at 30 if checksums ok
L A0 SkipVEql 20
L X Skip 1
L X Skip 5
L A0 SkipVEql 30
L X Skip 1
L X Return 0;		Skip to EOF--checksums already set

L X ShowError INIT stopped at random address--hardware problem
L X Return 0;		Skip to EOF (Can't do Compare because not dumped yet)

; Copy the checksums from AC's to CSUMx's
R D4 Val 
L D8 Val
R D5 Val 
L D9 Val
R D6 Val 
L D10 Val
R D7 Val 
L D11 Val

; Verify that we have the right checksums now
L X TimeOut 3777
L X Go INIT
L X Skip 2
L X ShowError INIT hung--hardware problem
L X Return 0

; IMA=30 if checksums ok
L A0 SkipVEql 30
L X Skip 3
L X Confirm;		Supply confirmation for Dump which follows
L X Dump SYS2
L X Return 0
L X ShowError Command file bug--setting checksums failed