|★ APPLICATIONS ★ PROGRAMMATION ★ Basic Checksum ★|
|Basic Checksum (Computing With the Amstrad)||Applications Programmation|
ROLAND WADDILOVE introduces a simple method of finding out where you could have gone wrong when typing in a listing
We are always striving to improve the standard of our listings here at Computing with the Amstrad CPC. Our aim is to bring you the very best programs written by our readers.
Each is given a thorough testing by our panel of technical experts and only the best finally make it to print.
If an error does manage to creep in an amendment will appear in our Postbag section the following month. Fortunately this is quite rare, and you can rest assured that our listings are correct and bug free.
In the early days of the magazine all listings were produced on an Epson printer. Now programs are passed straight from a CPC to a professional laser typesetting machine, and the output is crystal clear. This makes them easier to read and easier to type in.
One of the first lessons to learn when entering listings from Computing with the Amstrad CPC is that the programs will rarely work first time. This isn't because they are incorrect, it is simply impossible for anyone to enter a long complex listing without making a single typing error or slip of the fingers. I know I can't!
So, assuming you've made a few typing errors how do you find them? This can be quite difficult at the best of times. However, with the aid of the checksum utility presented here the task will be much easier.
This program will store a machine code routine high up in memory. When called it will analyse a Basic program and produce a unique number - a cyclic redundancy check -for each line of the listing.
Every month we will be publishing a list of these numbers alongside each major Basic listing. After entering the program all you need to do is call the machine code and you will be presented with your own list of numbers, hopefully identical.
You can tick off each line you have entered correctly - the checksums will be the same, and any lines containing errors will produce different checksums and stand out like a sore thumb. So it should then be an easy task to list that line and correct it.
Finally, when all the checksums match, you should have a perfect working copy of the program to save.
To see how it works try it on itself -enter and save the checksum listing. Now run it and the machine code will be stored in memory.
At this point you would type in or load a Basic program, but as there's already one in memory - the checksum Basic loader - we'll use that.
Call the machine code with: CALL &9000
and tap the spacebar to see the checksums. If you come across a line that is wrong press Escape to abort the checksum utility, list the line and correct it. Now call the machine code again and check that it is OK.
You may occasionally be told that there are extra spaces at the start or end of the line and the checksum routine will come to a halt. These must be removed before you can continue.
And that's all there is to it. With the aid of this powerful utility you should be able to produce perfect working copies of all our listings. Let us know how you get on...
Following are the checksums for the programs indicated, which can be found in the pages of this issue.