CK Type

Developer(s): Stan Lemke
Date: 1987
Type: Program
Platform(s): TS 2068
Tags: Utility

A type-in checker. CK TYPE goes through the BASIC program in memory and prints, for every line, the line number, the number of bytes in the line and a checksum of those bytes. If a listing is published with its CK TYPE output, you can run CK TYPE on your typed copy and see at once which lines differ. The checksum adds each byte of the line with weights that alternate 2, 1, 2, 1, so it also catches transposed characters, and upper and lower case give different sums. Output goes to the screen and, with LPRINT, to the TS2040 printer at the same time.

To use the BASIC version, MERGE CK TYPE with your program (which must not use lines 9991 to 9999) and RUN 9991. Lines 9987 to 9990 are REM directives for the TIMACHINE compiler and can be left out if you do not have it; RUN on its own prints CK TYPE’s own figures, which match the article’s Listing B. The machine code version (460 bytes at 64888, printed as a POKE table) does the same job: load your BASIC program, then LOAD “CK TYPE” CODE and RANDOMIZE USR 64888.

The tape has the BASIC program and the machine code as printed. The article’s text has two slips that are not in the program: it gives the SAVE length as 640 instead of 460 in one place and the LOAD address as 64999 instead of 64888 in another.

Published in Time Designs Magazine May/June 1987 (CK Type).

Related Articles

A new "standard" for "fool-proof" typing of TS2068 program listings in magazines.
Checksum program for the 1000.
Improved and condensed (to one line) version of Stan Lemke's program.
Shorter one-line version.

Related Content

Image Gallery

Source Code

9987 REM ! LIST
9988 REM ! LPRINT
9989 REM !INT +START,STOP,BYT,LINE,LENGTH,SUM,ODD,I
9990 REM ! OPEN #
9991 LET start=256*PEEK 23636+PEEK 23635: LET stop=256*PEEK 23628+PEEK 23627: LET byt=start
9992 LET line=0: LET length=0: LET sum=0
9993 LET line=256*PEEK byt+PEEK (byt+1): LET byt=byt+2
9994 LET length=256*PEEK (byt+1)+PEEK byt: LET byt=byt+2
9995 LET odd=1: FOR i=1 TO length: LET sum=sum+(odd+1)*PEEK byt: LET odd=NOT odd: LET byt=byt+1: NEXT i
9996 PRINT line;TAB 6;": ";length;TAB 13;": ";sum
9997 LPRINT line;TAB 6;": ";length;TAB 13;": ";sum
9998 IF byt<stop THEN GO TO 9992
9999 STOP

Listing D (POKE table: address, then the values for that address and the next four)
64888   205   58    255   33    68
64893   255   34    108   92    33
64898   0     1     229   33    84
64903   92    110   38    0     209
64908   205   3     255   229   33
64913   83    92    110   38    0
64918   209   25    34    68    255
64923   33    0     1     229   33
64928   76    92    110   38    0
64933   209   205   3     255   229
64938   33    75    92    110   38
64943   0     209   25    34    70
64948   255   42    68    255   34
64953   72    255   33    0     0
64958   34    74    255   33    0
64963   0     34    76    255   33
64968   0     0     34    78    255
64973   33    0     1     229   42
64978   72    255   110   38    0
64983   209   205   3     255   229
64988   42    72    255   35    110
64993   38    0     209   25    34
64998   74    255   42    72    255
65003   35    35    34    72    255
65008   33    0     1     229   42
65013   72    255   35    110   38
65018   0     209   205   3     255
65023   229   42    72    255   110
65028   38    0     209   25    34
65033   76    255   42    72    255
65038   35    35    34    72    255
65043   33    1     0     34    80
65048   255   33    1     0     34
65053   82    255   229   42    76
65058   255   34    84    255   225
65063   195   89    254   42    78
65068   255   229   42    80    255
65073   35    229   42    72    255
65078   110   38    0     209   205
65083   3     255   209   25    34
65088   78    255   42    80    255
65093   205   251   254   34    80
65098   255   42    72    255   35
65103   34    72    255   42    82
65108   255   35    34    82    255
65113   237   91    84    255   235
65118   167   237   82    210   42
65123   254   42    74    255   205
65128   233   254   33    6     0
65133   205   51    255   205   239
65138   254   2     0     58    32
65143   42    76    255   205   233
65148   254   33    13    0     205
65153   51    255   205   239   254
65158   2     0     58    32    42
65163   78    255   205   233   254
65168   62    13    215   205   63
65173   255   42    74    255   205
65178   233   254   33    6     0
65183   205   51    255   205   239
65188   254   2     0     58    32
65193   42    76    255   205   233
65198   254   33    13    0     205
65203   51    255   205   239   254
65208   2     0     58    32    42
65213   78    255   205   233   254
65218   62    13    215   205   58
65223   255   42    72    255   237
65228   91    70    255   205   225
65233   254   124   181   194   187
65238   253   33    22    43    217
65243   201   33    22    43    217
65248   201   175   237   82    103
65253   111   208   44    201   205
65258   43    255   195   161   49
65263   225   78    35    70    35
65268   84    93    9     229   195
65273   219   33    125   180   33
65278   0     0     192   44    201
65283   62    32    187   56    13
65288   122   167   32    9     67
65293   235   108   184   200   25
65298   16    253   201   77    68
65303   33    0     0     62    15
65308   203   35    203   18    48
65313   1     9     41    61    32
65318   245   178   240   9     201
65323   175   95    85    76    71
65328   195   116   46    62    23
65333   215   125   215   215   201
65338   62    2     195   48    18
65343   62    3     195   48    18

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.