Primes by Trial Division - DRI CP/M Personal BASIC

15 August 2016

DRI Personal BASIC has a MODulus function, and forbids using GOTO to jump out of a FOR/NEXT loop. So the loops were rewritten for this version using WHILE/WEND.

   10   dim primes(99)
   20   index=0
   30   count=2
   40   found=0
   50   while found<100
   60   print count
   70   primes(index)=count
   80   found=found+1
   90   count=count+1
   100  index=0
   110  while index<found
   120  v=(count mod primes(index))
   130  if v=0 then index=found+1 else index=index+1
   140  wend
   150  if index>found then goto 90
   160  wend

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