Primes by Trial Division - VAX BASIC

25 July 2017

In VAX BASIC, COUNT is a keyword, and MOD is a function.

It also prints the diagnostic warning,

  %BASIC-I-JMPBADLIN, jump to line number 50 is into a block
  %BASIC-I-ATLINE, referenced at listing line 3

but continues to execute regardless.

1   GOTO 10
5   c = c + 1
6   GOTO 50
10  DIM primes(999)
20  primes(0) = 2
25  PRINT primes(0)
30  c = 3
40  FOR found = 1 TO 999
50  FOR index = 0 TO (found - 1)
60  IF MOD(c,primes(index)) = 0 THEN GOTO 5
70  NEXT index
80  PRINT c
90  PRIMES(found) = c
100 c = c + 1
110 NEXT found
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