Primes by Trial Division - TRS-80 Level I BASIC

18 August 2016

Functionally, the TRS-80 Level I BASIC version is identical to the Applesoft reference version. Syntactically, it needed rewriting for the single-character variable names and single array A(). The abbreviation of PRINT as P. wasn't necessary, but was once common practice to save a few bytes of memory. With 4KB, a little here and a little there adds up.

1 GOTO 20
5 C=C+1
10 GOTO 50
20 A(0)=2
25 P. A(0)
30 C=3
40 FOR F=1 TO 99
50 FOR I=0 TO (F-1)
60 V=C/A(I)
65 IF V=INT(V) GOTO 5
70 NEXT I
80 P. C
90 A(F)=C
100 C=C+1
110 NEXT F
120 END

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026

Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Primes Benchmark Source

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

Primes Benchmark Results

Other BASICs

Applesoft BASIC

Atari 2600 BASIC

BBC BASIC

Commodore BASIC

DRI Personal BASIC

HP BASIC/V

IBM 5100 BASIC

IBM PC BASIC

PICK/BASIC

Rocky Mountain BASIC

Sinclair ZX80 BASIC

Spectravideo Compumate

TI 99/4 BASIC

TRS-80 Level 1 BASIC

V-Tech Laser 50

VAX BASIC

Structured BASIC

Amiga BASIC

Dartmouth True BASIC

Microsoft QuickBASIC

Microware Basic09

Topaz S-BASIC