CHECK SUM (13 bytes)

See all articles from CATS v3 n8
Author(s): Brian Little
Publication: CATS Newsletter
Pub Details: CATS v3 n8 (Volume 3, Issue 8)
Date: December 1985
Pages: 12

This routine when use with LET Z=USR XXXX will return with a number in z that will be the one number if the program loaded correctly. The following statement could be used to check the program:

IF Z<>xx THEN STOP

where xx=the correct loading number.

NN=hex length of MC to be checked

PP=hex address where MC starts

(NN & PP are Low High order)

21 PP PP  LD HL,address
97 SUB A
06 NN LD B,length
86 ADD A,(HL)
23 INC HL
05 DEC B
20 FB JR NZ FB
4F LD C,A
C9 RET

Brian Little

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.