A ZX80 utility that shows how much memory each program line uses. Type your program in ahead of it (with lower line numbers and ending in STOP), then RUN 9200 and enter the starting address, 16426 for the first line. It lists each line with its start address, 15 to a screen; at the end it gives the number of lines, total bytes, average bytes per line and the next free address.
Press NEWLINE for each new screen, and E to exit. On its own it analyzes itself.
Published in Syntax January 1981 (How Many Bytes to the Line?).
Source Code
9200 REM DUMP INSTRUCTIONS
9205 PRINT "START AT?"
9210 INPUT S
9215 LET B=S
9220 LET C=0
9225 CLS
9230 FOR I=1 TO 15
9235 PRINT S,
9240 LET C=C+1
9245 IF PEEK(S)=118 THEN GO TO 9270
9250 PRINT CHR$(PEEK(S));
9255 IF PEEK(S)=248 THEN GO TO 9310
9260 LET S=S+1
9265 GO TO 9245
9270 PRINT
9275 LET S=S+3
9280 NEXT I
9290 INPUT Z$
9295 IF Z$="E" THEN GO TO 9390
9300 GO TO 9225
9310 PRINT
9315 PRINT
9320 PRINT C,"INSTRUCTIONS"
9325 LET A=S-B+1
9330 PRINT A,"BYTES"
9335 LET D=A/C
9340 PRINT D,"AVERAGE BYTES"
9345 LET S=S+4
9350 PRINT S,"NEXT PROGRAM"
9355 INPUT Z$
9360 IF Z$="E" THEN GO TO 9390
9370 IF Z$="" THEN GO TO 9215
9375 GO TO 9205
9390 PRINT "END DUMP"
9392 GO TO 9399
9395 RETURN
9399 STOPNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

