4 ms·
I'm curious, can you say more about "as you entered it"? Do you mean like, "for lines 1-20 the checksum should be 0xDEADBEEF"? This would let you find the erro
by tantalor 2y ago
I'm curious, can you say more about "as you entered it"?
Do you mean like, "for lines 1-20 the checksum should be 0xDEADBEEF"? This would let you find the error before finishing the program.
Or just at the end, it would checksum the whole thing?
- onre 2y agoI remember borrowing a book from the library, which had a type-in checksum program of this sort. It was done like was common for C=64 things of this kind - there's a BASIC FOR-loop iterating through a memory area, reading in bytes from DATA statements you've typed in and POKEing those bytes into memory, not completely unlike entering a program manually from the front-panel switches of an older computer. So, after typing that in and probably SYSing (C=64 BASIC command for executing machine code from arbitrary memory location) to some address, it did print out a two-digit (eight-bit) hex checksum after every BASIC line I entered on the C=64 and the program listing in the book had the correct checksums for every line, so spotting errors was more or less instantaneous. This stuff brings memories. FOR I=40960 TO 49152:POKE I,PEEK(I):NEXT I POKE 1,54 From top of my head; loop through the BASIC interpreter area, reading byte by byte with PEEK and POKEing those bytes back to the same addresses. Sounds nonsensical? Not so, because the C=64 does have full 64 kB of RAM, but some of it is overlapped by ROMs. What happens here is that you're reading from ROM but writes always go to RAM, so you're copying the BASIC interpreter from ROM to RAM. After that, the POKE statement turns off the ROM overlap and the interpreter is now run from RAM, so you can edit it live - and obviously cause all sorts of interesting crash situations. It sure did help later with career in IT to have understood this kind of stuff at age of around ten.
- rufus_foreman 2y agoA checksum for each line of code. COMPUTE! magazine used one, the article introducing it and explaining how to use it is at https://archive.org/details/1983-10-computegazette/page/n49/mode/2up?view=theater https://archive.org/details/1983-10-computegazette/page/n49/.... The code listings had a comment (rem) at the end of each line with a checksum number, when you used the checksum program it would display a checksum at the top of the screen that would match if you entered the line correctly. An example page of code with checksums is at https://archive.org/details/1983-10-computegazette/page/146/mode/2up?view=theater https://archive.org/details/1983-10-computegazette/page/146/.... A life changing event for those of us entering code from magazine listings in the early '80s.
- tantalor 2y agoThat's awesome. Thanks!