Altra versione di PROOFREADER, questa volta per i computer APPLE (non MAC mi raccomando!!!)
Questi programmi sono progettati per consentire agli utenti degli home computer (anche se ne è uscito uno per IBM) di rilevare facilmente eventuali errori sui programmi digitati. Ad ogni invio veniva visualizzato un valore hash per ogni riga inserita che poteva essere confrontato con il valore di riferimento stampato nella rivista.
Infatti questa versione è sempre per un Commodore ma per il KIM. Purtroppo non posso provarlo su un KIM vero ma appena riesco lo testo su un emulatore.
Segue l’articolo con traduzione in italiano
"Apple Automatic Proofreader
Tim Victor. Editorial Programmer
Now it's easier than ever to enjoy COMPUTE! Programs for Apple II series computers.
Our "Automatic Proofreader" utility, formerly available only for Commodore, Atari, and IBM computers, has now been adapted and enhanced for the Apple II+, IIe, and Ile with either DOS 3.3 or ProDOS.
The Automatic Proofreader alerts you to most typing mistakes you might make while entering a COMPUTE! Program.
Beginning this month, there will be an extra two-digit hexadecimal number at the start of each program line in Applesoft BASIC program listings. This extra number is a checksum to be used with the "Apple Automatic Proofreader" utility. When you type in a program using the Automatic Proofreader, you can check for typing errors by comparing checksums instead of reading each line and comparing it, character by character, with the listing. The Proofreader and your computer do most of the work for you. The Automatic Proofreader loads a short machine language routine into memory and attaches it to your Apple's operating system. Each time you press RETURN to enter a program line, this routine displays a two-digit checksum at the top of your screen. If you've typed the line correctly, the checksum on your screen matches the one in the printed listing-it's that simple. You don't have to use the Proofreader to enter listings, but doing so greatly reduces the chance of making a typo. Getting Started First, type in the Apple Automatic Proofreader program following this article. The Proofreader can't check itseU before it's done, so you'll have to be extra careful to avoid mistakes. This chore might go a little faster if you remind yourself that this is the last time you'll have to do it. The Proofreader checks which operating system you're running before it hooks up the checksum routine, so you can type it in with either DOS 3.3 or ProDOS. If you want to use the Proofreader with both operating systems, you won't have to retype it. All you need is a utility to copy a file between disks with different formats, such as the one provided on the ProDOS System Utilities disk. As soon as you finish typing the Proofreader, save at least two copies. This is very important, because the Proofreader erases the BASIC portion of itself when you run it, leaving only the machine language portion in memory.
Now type RUN and hit RETURN. The Proofreader clears the screen, loads the machine language routine, displays the message PROOFREADER ACTIVATED, erases the BASIC portion of itself, and ends. If you type LIST and press RETURN, you'll see that no BASIC program is in memory. The computer is ready for you to type in a new BASIC program. Entering Programs
Entering Programs Once the Proofreader is activated, you can begin typing in a BASIC program as usual. Every time you finish typing a line and press RETURN, the Proofreader displays a two-digit checksum number in the upper-left corner of the screen. Compare this checksum with the checksum printed next to the corresponding line in the program listing. If the numbers match, you can be pretty certain the line was typed correctly. Otherwise, check for your mistake and type the line again. A common mistake when entering BASIC programs on the Apple occurs when you accidentally press a key while holding down the control (CTRL) key. This adds an invisible control character to the line you are typing. If you don't find it before you run the program, this stray character may cause a syntax error or other mysterious behavior. Fortunately, the Proofreader detects the presence of these invisible control characters, displaying a checksum that doesn't match the one in the listing. So it's always a good idea to retype a line if the checksums don't match, even though you might not see any difference in the lines themselves. The Proofreader ignores space characters, so you can omit spaces between keywords and still see a matching checksum. Spaces are important only between the quotation marks of PRINT statements or string assignments. If you accidentally type too many spaces or leave some out, this is the only mistake the Proofreader won't catch. For this reason, you should be extra careful when entering text within quotes. Before running another BASIC program, it's a good idea to tum off the Proofreader by holding down CTRL while pressing the RESET button. The machine language part of the Proofreader is kept in memo-
Ry starting at address 768 ($300 hexadecimal). This location is out of BASIC's way, but a lot of other programs use this same place for their machine language subroutines. Disable the Proofreader to avoid conflicts. Abbreviated instructions on using the Proofreader-and a listing of the Proofreader program itself-will appear each month in the section "COMPUTE!'s Guide to Typing In Programs."
How It Works
When t e Applesoft BASIC interpreter needs to get a line of input from the keyboard, it calls a machine language routine in the Apple's Read Only Memory (ROM) so celled in tum, calls the operating system to get a single keypress, which it stores in an input buffer. If the RETURN key was pressed, ends, leaving one new line for the BASIC interpreter in the input buffer. Otherwise, it repeats the process, asking for another keypress. The operating system normally gets individual keystrokes from a ROM routine called, but the Proofreader changes this. When the Proofreader is installed, the operating system calls the checksum rou- 21o Dar tine instead, and the checksum routine asks for a character. If any key other than RETURN was pressed, the checksum routine just passes it on to the operating system, which gives it to GETLN. But if RETURN was pressed, the checksum routine examines the contents of GETLN's input buffer, which now contains an entire line of input, to calculate the checksum that it displays at the top of the screen. One very common typing mistake is transposition: typing two successive characters in the wrong order, like PIRNT instead of PRINT. A checksum program that merely adds the codes of the characters in a line can detect only the presence or absence of a character, not transposition errors. The Commodore and Atari versions of the Automatic Proofreader-the first Proofreaders introduced-have this problem. Because the Apple Proofreader uses a more sophisticated formula to compute checksums, it alerts you to transposed keystrokes. Other versions of the Proofreader could be upgraded, but this would mean that checksums in previously published listings would be incompatible with the new Proofreader. The Apple Automatic Proofreader detects almost every possible typing mistake, including transpositions, missing or extra characters, accidental control characters, and incorrect line numbers. Typing COMPUTE! Programs into your Apple computer has never been easier."
10 C = 0: FOR I • 768 TO 768 + 68: READ A:C • C + A: POKE I,A: NEXT
20 IF C < > 7258 THEN PRINT "ERROR IN PROOFREADER DATA STATE ELEMENTS" : ENO
30 IF PEEK (190 * 256) < > 76 THEN POKE 56,0: POKE 57,3: CALL 1002: GOTO 50
40 PRINT CHRS (4);"IN#AS300"
50 POKE 34,0: HOME : POKE 34,1:VTAB 2: PRJNT "PROOFREADER INSTALLED"
60 NEW
100 DATA 216,32,27,253,201,141
110 DATA 208,60,138,72, 169,0
120 DATA 72,189,255,1,201,160
150 DATA 240,0,104,10,125, 255
140 DATA 1, 105,0,72,202,208
150 DATA 230, 104,170,41,15,9
160 DATA 48,201,58,144,2,233
170 DATA 57,141,1,4,138,74
180 DATA 74,74,74,41,15,9
190 DATA 48,201,58, 144,2,233
200 DATA 57,141,0,4,104,170
210 DATA 169,141,96
"Apple Automatic Correttore di bozze
Tim Vittore. Programmatore Editoriale
Ora è più facile che mai godere di COMPUTE! Programmi per computer della serie Apple II.
La nostra utility "Automatic Proofreader", precedentemente disponibile solo per i computer Commodore, Atari e IBM, è stata ora adattata e potenziata per Apple II+, IIe, ecc, e Ile con DOS 3.3 o ProDOS.
Il Correttore automatico di bozze ti avvisa della maggior parte degli errori di battitura che potresti commettere durante l'immissione di un CALCOLO! Programma.
A partire da questo mese, ci sarà un numero esadecimale extra di due cifre all'inizio di ogni riga di programma negli elenchi di programmi Applesoft BASIC. Questo numero aggiuntivo è un checksum da utilizzare con l'utilità "Apple Automatic Proofreader. Quando si digita un programma utilizzando il Correttore automatico di bozze, è possibile verificare la presenza di errori di battitura confrontando I checksum invece di leggere ogni riga e confrontandolo, carattere per carattere, con l'elenco. Il correttore di bozze e il tuo computer fanno la maggior parte del lavoro per te. Automatic Proofreader carica una breve routine di linguaggio macchina in memoria e la collega al sistema operativo Apple. Ogni volta che si preme INVIO per immettere una riga di programma, questa routine visualizza un checksum a due cifre nella parte superiore dello schermo. Se hai digitato correttamente la riga, il checksum sullo schermo corrisponde a quello nella scheda stampata, è così semplice. Non è necessario utilizzare il correttore di bozze per inserire le inserzioni, ma così facendo si riduce notevolmente la possibilità di effettuare un errore di battitura. Per iniziare, digita il programma Apple Automatic Proofreader seguendo questo articolo. Il correttore di bozze non può controllare itseU prima che sia fatto, quindi dovrai fare molta attenzione per evitare errori. Questo lavoro potrebbe andare un po 'più veloce se ti ricordi che questa è l'ultima volta che dovrai farlo. Il Proofreader controlla il sistema operativo in esecuzione prima di collegare la routine di checksum, in modo da poterlo digitare con DOS 3.3 o ProDOS. Se si desidera utilizzare il Proofreader con entrambi I sistemi operativi, non sarà necessario ridigitarlo. Tutto ciò che serve è un'utilità per copiare un file tra dischi con formati diversi, come quello fornito sul disco ProDOS System Utilities. Non appena hai finito di digitare il Correttore di bozze, salva almeno due copie. Questo è molto importante, perché il Proofreader cancella la parte BASIC di se stesso quando lo si esegue, lasciando solo la parte del linguaggio macchina in memoria.
Ora digita RUN e premi RETURN. Il correttore di bozze cancella lo schermo, carica la routine del linguaggio macchina, visualizza il messaggio PROOFREADER ACTIVATED, cancella la parte BASIC di se stesso e termina. Se si digita LIST e si preme RETURN, si vedrà che nessun programma BASIC è in memoria. Il computer è pronto per digitare un nuovo programma BASIC. Inserimento Programmi
Entrare nei Programmi Una volta attivato il Correttore di bozze, è possibile iniziare a digitare un programma BASIC come al solito. Ogni volta che finisci di digitare una riga e premi INVIO, il Correttore di bozze visualizza un numero di checksum a due cifre in alto a sinistra dello schermo. Confronta questo checksum con il checksum stampato accanto alla riga corrispondente nella lista del programma. Se I numeri corrispondono, si può essere abbastanza certi che la linea è stata digitata correttamente. Altrimenti, controlla il tuo errore e digita di nuovo la linea. Un errore comune quando si inseriscono programmi BASIC su Apple si verifica quando si preme accidentalmente un tasto mentre si tiene premuto il tasto di controllo (CTRL). Questo aggiunge un carattere di controllo invisibile alla riga che si sta digitando. Se non lo trovi prima di eseguire il programma, questo carattere randagio può causare un errore di sintassi o altri comportamenti misteriosi. Fortunatamente, il correttore di bozze rileva la presenza di questi caratteri di controllo invisibili, visualizzando un checksum che non corrisponde a quello nell'elenco. Quindi è sempre una buona idea riscrivere una riga se I checksum non corrispondono, anche se potresti non vedere alcuna differenza nelle linee stesse. Il correttore di bozze ignora I caratteri di spazio, in modo da poter omettere gli spazi tra le parole chiave e vedere comunque un checksum corrispondente. Gli spazi sono importanti solo tra le virgolette delle istruzioni PRINT o delle assegnazioni di stringhe. Se digiti accidentalmente troppi spazi o ne lasci fuori alcuni, questo è l'unico errore che il Correttore di bozze non prenderà. Per questo motivo, dovresti fare molta attenzione quando inserisci il testo tra virgolette. Prima di eseguire un altro programma BASIC, è una buona idea spegnere il correttore tenendo premuto CTRL mentre si preme il pulsante RESET. La parte del linguaggio macchina del correttore di bozze è conservata in memo-
Ry a partire da indirizzo 768 ($300 hexadecimal). Questa posizione è fuori dal BASIC, ma molti altri programmi usano questo stesso posto per le loro subroutine in linguaggio macchina. Disabilitare il Correttore di bozze per evitare conflitti. Istruzioni abbreviate su come utilizzare il Correttore di bozze e un elenco del programma Correttore di bozze stesso appariranno ogni mese nella sezione "COMPUTA!'s Guida alla Digitazione nei Programmi."
Come Funziona
Quando l'interprete Applesoft BASIC ha bisogno di ottenere una linea di input dalla tastiera, chiama una routine di linguaggio macchina nella Read Only Memory (ROM) di Apple, quindi inserita in tum, chiama il sistema operativo per ottenere un singolo tasto, che memorizza in un buffer di input. Se il tasto RETURN è stato premuto, termina, lasciando una nuova riga per l'interprete BASIC nel buffer di input. Altrimenti, ripete il processo, chiedendo un altro tasto. Il sistema operativo normalmente riceve singole sequenze di tasti da una routine ROM chiamata, ma il correttore di bozze cambia questo. Quando il Proofreader è installato, il sistema operativo chiama invece il checksum rou-21o Dar tine e la routine di checksum richiede un carattere. Se è stato premuto un tasto diverso da RETURN, la routine di checksum lo passa semplicemente al sistema operativo, che lo dà a GETLN. Ma se RETURN è stato premuto, il checksum di routine esamina il contenuto del buffer di input di GETLN, che ora contiene un'intera riga di input, per calcolare il checksum visualizzato nella parte superiore dello schermo. Un errore di battitura molto comune è la trasposizione: digitare due caratteri successivi nell'ordine sbagliato, come PIRNT invece di PRINT. Un programma di checksum che si limita ad aggiungere i codici dei caratteri in una riga può rilevare solo la presenza o l'assenza di un carattere, non errori di trasposizione. Le versioni Commodore e Atari dell'Automatic Proofreader, I primi Proofreader introdotti, hanno questo problema. Poiché Apple Proofreader utilizza una formula più sofisticata per calcolare I checksum, ti avvisa delle sequenze di tasti trasposte. Altre versioni del Correttore di bozze potrebbero essere aggiornate, ma ciò significherebbe che I checksum negli elenchi pubblicati in precedenza sarebbero incompatibili con il nuovo Correttore di bozze. Apple Automatic Proofreader rileva quasi tutti I possibili errori di battitura, tra cui trasposizioni, caratteri mancanti o aggiuntivi, caratteri di controllo accidentali e numeri di riga errati. Digitando COMPUTE! I programmi nel tuo computer Apple non sono mai stati così facili."