aboutsummaryrefslogtreecommitdiff
path: root/ossintbas_content.rst
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-03-26 03:00:48 -0400
committerB. Watson <urchlay@slackware.uk>2025-03-26 03:00:48 -0400
commit67b67eebb77512ffac50e8650cfc9f30913869fd (patch)
tree3c8093d75b45fdcdb734d59042e82014c1a7a2e5 /ossintbas_content.rst
parente45e1eefc9d7abc526d28710e6a0298c525c80fb (diff)
downloadbw-atari8-tools-67b67eebb77512ffac50e8650cfc9f30913869fd.tar.gz
whichbas and listbas: distinguish between Integer BASIC disk and cart versions.
Diffstat (limited to 'ossintbas_content.rst')
-rw-r--r--ossintbas_content.rst80
1 files changed, 77 insertions, 3 deletions
diff --git a/ossintbas_content.rst b/ossintbas_content.rst
index acdd9b0..2289a84 100644
--- a/ossintbas_content.rst
+++ b/ossintbas_content.rst
@@ -9,7 +9,7 @@ It appears to be complete and free of major bugs. There is no manual
for it, so I'm documenting the differences between Integer BASIC and
BASIC XL/XE here, as I discover them.
-For more info on the release::
+For more info on the release:
https://forums.atariage.com/topic/257029-oss-d-day-part-3-integer-basic-source-code-now-in-pd/
@@ -52,13 +52,13 @@ COMMANDS
**VINC** *<var>*
Increment (add 1 to) a variable. This is about 30% faster than
- **A=A+1**. Abbreviate as **VD.**.
+ **A=A+1**.
Abbreviation: **VI.**
**VDEC** *<var>*
- Decrement (subtract 1 from) a variable. Abbreviate as **VD.**.
+ Decrement (subtract 1 from) a variable. Faster than **A=A-1**.
Abbreviation: **VD.**
@@ -198,6 +198,80 @@ Missing Operators/Functions
**USING**
BASIC XL and XE's "PRINT USING" doesn't exist in Integer BASIC.
+PERFORMANCE
+===========
+
+OSS Integer BASIC is *fast*, compared to other interpreted BASICs on
+the Atari. It even outperforms Turbo BASIC XL (though, not *compiled*
+Turbo).
+
+For testing, I used a modified version of the Sieve of Eratosthenes
+program, found in the source for **bas55**. The program finds and
+prints all the prime numbers between 2 and 1000. The code::
+
+ 10 POKE 18,0:POKE 19,0:POKE 20,0
+ 20 DIM A(1000)
+ 30 N=1000
+ 100 S=SQR(N)
+ 110 FOR I=2 TO S
+ 120 IF A(I)=1 THEN 170
+ 130 D=N/I
+ 140 FOR J=I TO D
+ 150 A(I*J)=1
+ 160 NEXT J
+ 170 NEXT I
+ 180 FOR I=2 TO N
+ 190 IF A(I)=1 THEN 210
+ 200 PRINT I
+ 210 NEXT I
+ 1000 PRINT PEEK(18)*256*256+PEEK(19)*256+PEEK(20)
+
+Line 1000 prints how many jiffies the program took to run. I used
+Atari800 5.2.0 emulating an NTSC Atari 800XL, so one jiffy is 1/60 of
+a second. The "Fastchip" results use Charles Marslet's OS floating
+point replacement ROM. For Integer BASIC, BASIC XL and BASIC XE,
+separate runs were done with the line **5 FAST** at the start of the
+program. Results:
+
+.. csv-table::
+
+ "BASIC", "Jiffies", "Speedup"
+ "Atari 8K", "1867", "--"
+ "A+", "1671", "1.12"
+ "Atari 8K (Fastchip)", "1587", "1.18"
+ "A+ (Fastchip)", "1569", "1.19"
+ "XE", "1440", "1.3"
+ "AMSB2", "1518", "1.23"
+ "XL", "1270", "1.47"
+ "Altirra", "1166", "1.67"
+ "XL (FAST)", "1110", "1.68"
+ "XL (Fastchip)", "1049", "1.78"
+ "XL (Fastchip, FAST)", "887", "2.1"
+ "Turbo", "825", "2.3"
+ "XE (FAST)", "777", "2.4"
+ "XE (Fastchip, FAST)", "777", "2.4"
+ "Altirra (Fastchip)", "769", "2.43"
+ "Integer", "719", "2.6"
+ "Integer (FAST)", "575", "3.25"
+
+Turbo BASIC XL, Atari Microsoft BASIC, and OSS Integer BASIC run at
+the same speed with or without the Fastchip ROM, since they don't use
+the OS floating point routines.
+
+For reference, I rewrote the program in C and compiled it with
+cc65. It runs in 349 jiffies, 5.35x as fast as BASIC, with or without
+the Fastchip ROM. Since cc65 only supports integer arithmetic, this
+probably represents the theoretical maximum speed the algorithm could
+run in on the Atari, without rewriting it in assembly. By comparison,
+Integer BASIC looks pretty good.
+
+If you get rid of lines 180 to 210 (don't print the results), Integer
+BASIC with FAST runs it in 245 jiffies, and the equivalent C program
+runs in 61 jiffies. This shows that CIO and the E: device are the
+"bottleneck" for this program (and that compiled C is still faster
+than anything interpreted).
+
+
BUGS
====