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
★ AUTHOR: ROLAND WADDILOVE

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listing:
» Checksum  MK2    LISTINGDATE: 2013-09-15
DL: 25 fois
TYPE: PDF
SIZE: 121Ko
NOTE: 1 page/PDFlib v1.6

Je participe au site:
» Newfile(s) upload/Envoye de fichier(s)
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » Thunder Basic
» Applications » Irom ROM
» Applications » Basic - Locomotive
» Applications » Lerm Software - Z80c Toolkit/Z80 Toolkit 3
» Applications » Morse Code Teletype (Amstrad Computer User)
» Applications » Microsoft Basic - 80

QUE DIT LA LOI FRANÇAISE:

L'alinéa 8 de l'article L122-5 du Code de la propriété intellectuelle explique que « Lorsque l'œuvre a été divulguée, l'auteur ne peut interdire la reproduction d'une œuvre et sa représentation effectuées à des fins de conservation ou destinées à préserver les conditions de sa consultation à des fins de recherche ou détudes privées par des particuliers, dans les locaux de l'établissement et sur des terminaux dédiés par des bibliothèques accessibles au public, par des musées ou par des services d'archives, sous réserve que ceux-ci ne recherchent aucun avantage économique ou commercial ». Pas de problème donc pour nous!

CPCrulez[Content Management System] v8.7-desktop/cache
Page créée en 550 millisecondes et consultée 768 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.