ChexsumApplications Divers
★ 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 ★ 

The unique CHEXSUM program validation


When a book of programs such as this book is keyed in, everybody invariably makes reading and typing mistakes and then spends ages trying to sort out where and what is causing the error (errors).

Even experienced programmers often cannot identify an error just by listing the relevant line and need to do the tedious job of going back to the book, especially with DATA statements.

Realising that this is a major cause of frustration in keying the programs, we decided to do something about it.

There is a short routine in this book which you should key in and save BEFORE you key in other programs.

Using this routine you will be able to find out if you have made any keying errors at all and in which lines, before you even run the program.

In effect this means that with this book you need not waste time looking for keying errors, you simply run the routines and look at the display to identify lines containing errors. It's that easy.

The principle behind the routines is a unique chexsum which is calculated on each individual line of the program as you have keyed it in. Compare this chexsum value with the value for that line in the list at the end of the program listing; if they are the same the line is correct, if not there is an error in that line.


The simplest method is to enter the CHEXSUM program in now and save it to tape or disk.

You can type in the chexsum program at any time, even if you have started to type in a program. You cannot, of course LOAD in CHEXSUM from tape or disk because it will erase all you have typed so far.

The obvious solution is to MERGE the programs. The CHEXSUM program should be saved onto a separate cassette to allow easy access.


After having keyed CHEXSUM the logical thing would be to chexsum the program to make sure it is correct. But is it possible to do this? If you follow the instructions you will be able to check CHEXSUM.

  1. Type and save CHEXSUM.
  2. RUN ChexSum and it will check itself.
  3. Check output against the table of values at the end of the program.
  4. If the program is incorrect, edit the incorrect lines and resave the program.

Below is the listing of CHEXSUM and instructions on its use.

The greatest problem encountered when typing in programs from a book is errors made by the user. Most of these are picked up when the computer responds to the RUN command with the 'Syntax Error' message. The user then has only to LIST the line and compare it with the line in the book. Unfortunately, some errors are more subtle and not fatal to program operation. These types of errors will cause the program to run, but incorrectly, and the computer will not be able to detect them as such.

ChexSum is a special program which generates a unique sum for each line in a program and a grand total of all line sums. After each program listing is a table of check sums. You need only compare the numbers in the ChexSum table for each program with those generated by ChexSum. If two numbers differ, check that particular line.

1. Type in your game program, Patterns, say. Save it to tape or disk with the statement; SAVE “PATTERNS".

2. Reload your game program if necessary, using the statement; LOAD “PATTERNS" for the first game in the book. Do not RUN the game at this point.

3. To join ChexSum to the end of your program, enter the statement; MERGE "CHEXSUM".

4. When merged, enter RUN 60000 to activate ChexSum. The program will prompt:


Enter a P will cause output to go to the printer, and entering S will cause output to go to the screen.

5. ChexSum next prompts:


Enter the first line number in the program to be checked and press ENTER.

6. ChexSum will now output the check-sum table for the program. To halt the program press the escape key once, and to restart the output press any key other than escape. When ChexSum has finished you may remove ChexSum from memory with the DELETE instruction. For example:

DELETE 60000 — 62990

7. Check your grand total with that in the book. If they differ a line has been entered incorrectly. Compare line numbers until you locate the bad ones and then edit them.

8. Repeat steps 4 to 7 until the games program is debugged. In step 5 enter the line number of the first bad line to avoid ChexSum verifying the games program from the first line.

9. When the games program is running satisfactorily, delete the ChexSum program as described above.

10. Finally save the debugged version onto a clean tape or disk, with:


★ PUBLISHERS: Beam Software , Melbourne House
★ YEAR: 1985
★ COLLECTIONS: Amstrad Games Book , El Libro Gigante De Los Juegos Para Amstrad
★ AUTHOR(S): ???
★ INFO: Porgrams in this book were written or adapted by Warwick McArthur , Paul Copeland , Andrew Lacey , Kevin Bergin and Graeme Stretton.


  » Chexsum    (Amstrad  Games  Book)    LISTING    ENGLISHDATE: 2021-09-08
DL: 6 fois
SIZE: 110Ko
NOTE: 2 pages/PDFlib v1.6

Je participe au site:
» Vous avez des infos personnel, des fichiers que nous ne possédons pas concernent ce programme ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.
★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

» Applications » Data Base 464
» Applications » Basic Compiler
» Applications » Clock
» Applications » Newcastle Database (The Amstrad User)
» Applications » Cree Data (CPC Revue)
» Applications » Datastore 2

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