APPLICATIONSPROGRAMMATION ★ CHECKSUM MK II (CPC COMPUTING) ★

Checksum MK II (CPC Computing)Applications Programmation
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

Try out this re-vamped version of ROLAND WADDILOVE's life-saving debugging tool

EVER since we published the Checksum utility in June 1987, we've been swamped with requests for a reprint from readers who missed it. So, in response to popular demand here it is again, but this time we have an enhanced version adapted by an enterprising reader, Arthur Smart.

If you didn't see the first version of Checksum and have been pondering the significance of the Get it right! numbers, the idea is that alongside major listings we publish a list of checksums, one for each line. You can use this utility to generate checksums from the version of the program you have typed in. Lines whose checksums don't match the magazine contain one or more typing errors.

To check the program from start to end, follow the instructions in the panel. The value of line must be the first line number in the program, usually 10. Pressing the spacebar will display the checksum for the lines one at a time, and the routine will end when it runs out of program.

When a difference is spotted, it's a simple matter to stop the program by pressing the Escape key and edit the offending line. You can now start the routine again with CALL &9000,line, where line is the one you've just altered.

IF YOU HAVE THE ORIGINAL

If you're happy using the original version of Checksum, don't feel you have to change over to this one, as both versions will generate the same numbers.

The main difference is that you now specify a starting line number - useful if you want to resume checking midway through a program after editing a line. Also, when an end-of-line space is detected you now have the option of continuing.

The old checksum had a minor bug in that if the number 32 appeared at the end of a line, as in a=32, the program took this as a space character (Ascii value 32) and stopped. This has now been cured, although you are unlikely to have encountered the problem because we rearrange dodgy lines before publication.

If you have typed extra spaces at the end of the line a message is displayed, and unlike the old version it's possible to tell the program to ignore it and carry on. The checksum number is then displayed and the routine continues as normal. At some stage you should remove the extra spaces and recheck the offending lines. When copying a listing make sure that everything is exactly as shown.

Common mistakes are missing out the % sign on variables and typing in the wrong case, for instance M instead of m. To help avoid this, try entering the listing in lower case — abcde... instead of ABCDE.... Your CPC will automatically change them to upper case when it needs to. You must not type extra spaces within a line because, although the program may run correctly, the extra characters will give an incorrect checksum value.

The reason for not running a program after it has loaded for checksumming is that its structure - and so the checksum values - is altered when you run it. This is invisible when you list it, but inside the machine changes have been made.

It's perfectly all right to run a listing, save it, and reload it for checksumming, as the process is reversed when you save the program. Note that if you want to check Checksum itself, you must run it and reload it.

Finally, quite a few people have been asking how the routine calculates the values. It's done using something called a cyclic redundancy check, which is bit to complicated to explain. In fact, even Roland isn't sure!

Compared to doing a simple sum of the character values in the line, CRC has the advantage that it will spot characters that are correct but out of order.

There is no way that a program which generates values between 0 and 65536 is going to produce an unique number for lines with up to 255 characters, because there are billions upon billions of possible lines of Basic. However, the chances of you mistyping a line in such a way that it produces the correct checksum are vanishingly small.


THIS IS WHAT YOU DO
  • Load and run the checksum program.
  • Load (but DO NOT run) the program to check.
  • Enter CALL &9000,line
  • Tap the spacebar for each checksum.
  • Compare the numbers with those in the magazine, and edit lines which are different.
  • When the checksums match, save the corrected listing and reset before trying to run it.

CPC Computing

★ PUBLISHER: CPC Computing
★ YEAR: 1988
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: COMPUTING WITH THE AMSTRAD 1988
★ AUTHOR: ROLAND WADDILOVE
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» Checksum  MK2    (CPC  Computing)    ENGLISHDATE: 2020-08-15
DL: 164
TYPE: ZIP
SiZE: 4Ko
NOTE: Typed by Nicholas CAMPBELL ; 40 Cyls
.HFE: Χ

» Checksum  MK2    (CPC  Computing)    LISTINGDATE: 2013-09-15
DL: 208
TYPE: PDF
SiZE: 121Ko
NOTE: 1 page/PDFlib v1.6

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Slr Z - 80 Disassembler
» Applications » CPC-Expert
» Applications » Graphic - Split Modes (Computing With the Amstrad)
» Applications » User's Little Basic Helper (Schneider Aktiv)
» Applications » Teach Yourself Amstrad Basic - A Tutorial Guide part 2
» Applications » CPC-Macro
Je participe au site:
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 365 millisecondes et consultée 1693 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.