STOS BASIC V5.5 ALPHA — The First Rebuild of the 1989 Sources in Over 30 Years

Latest Atari related news.
User avatar
exxos
Site Admin
Site Admin
Posts: 28391
Joined: 16 Aug 2017 23:19
Location: UK

STOS BASIC V5.5 ALPHA — The First Rebuild of the 1989 Sources in Over 30 Years

Post by exxos »

STOS BASIC V5.5 ALPHA - The First Rebuild of the 1989 Sources in Over 30 Years

After more than three decades, STOS BASIC has been rebuilt from its original 1989 V2.06 assembly sources and dragged - kicking and screaming - onto modern Atari hardware. STOS BASIC V5.5 ALPHA is out now, and it's a free download.

» Why bother?
STOS was written for an 8MHz 520ST in 1989. Run the original on anything newer - a Falcon, EmuTOS, a 68030 accelerator, or a fast emulator - and it typically falls over or paints the screen with garbage. The goal of V5 was simple to state and painful to deliver: make the original language run correctly everywhere, make it faster, and don't break a single line of existing STOS source.

» The journey
This didn't happen in a weekend. The very first hurdle was just getting the original code to build at all. The surviving sources were incomplete, so the loader had to be decompiled and reconstructed by hand. What sources did exist weren't compatible with the assembler, and it took weeks just to work out why they wouldn't build - long before a single line could actually be improved.

After that came the real hunt - months of disassembly, emulator testing and some genuinely stubborn bugs. A few highlights:
  • Tracking down why compiled programs crashed on the first drawing call - the editor was never closing its VDI workstation on SYSTEM exit, leaving TOS in a dirty state.
  • A multi-round chase through the TOS 1.04 ROM to work out why the editor refused to boot on real 1.04 hardware while running fine on everything else.
  • A mouse that clipped to the left half of the screen, traced to a single wrong vector offset in the loader.
  • A startup resolution bug where a palette fix had quietly clobbered a CPU register mid-sequence, six rounds before it was cornered.
Every fix was proven on real and emulated hardware - EmuTOS, TOS 1.04, TOS 2.06 and Falcon TOS 4.04 - before it shipped.

» What's new in V5.5
  • Runs on modern Atari hardware - Falcon, EmuTOS, 68030 accelerators and fast emulators all work correctly, where V2.06 broke or corrupted graphics.
  • Faster across the board - every trap-based inter-library call replaced with direct dispatch (125 sprite traps and 20 music traps eliminated), and the compiler now emits tighter code for arithmetic and IF patterns. Roughly 14% average speedup across the 54-test benchmark suite, with FILL, COPY, SHOW/HIDE sprites, CLS BACK and IF gaining 30-50%.
  • Editor patches - LIST no longer scrolls illegibly on fast machines, the file-selector double-click bleed bug is fixed, and SYSTEM no longer bus-errors back to the desktop.
  • 100% source compatible - compiled programs are wire-compatible with V2.06 BASIC source. No language changes, no breaking API differences. Your old listings just work.
» Bugs squashed
Rebuilding a 35-year-old codebase and ripping out its entire trap system shakes a lot of bugs loose - some original to STOS, some introduced by the rework itself. Either way, they're fixed:
  • A compiler bug that corrupted random areas of memory - one of the nastiest to track down. Fixed.
  • Source corruption when running compiled programs inside the editor - a memory buffer was overflowing straight into your BASIC program text. Fixed.
  • CLS overwriting editor memory in compiled programs. Fixed.
  • CMP mode resetting the machine on exit, and graphics sometimes drawing invisibly. Both fixed.
  • CLS BACK (fast screen clear) - three separate bugs were stopping it working; cleaned up and re-enabled.
  • Falcon TOS graphics glitches - fixed by clearing a VDI field that Falcon TOS requires.
On top of the bug fixes, the V5.4/V5.5 performance pass restored roughly 1430 short branches across the codebase, unrolled 13 hot loops, and added a power-of-two multiply optimisation - all feeding into that 14% average gain.

» Quality-of-life
The compiler now reads a COMPPATH.INF file (written automatically when STOS loads) so it can always find its own files even after you've changed directories in the editor - no more "where did the compiler put it" confusion.

Known issues: none. More tweaks are still being added, so check back often.

» Download
STOS_5.5.zip - direct download
Release page (with the older STOS packs, V206 source, 3D, compiler, language disks and more): exxosforum.co.uk/atari/STOSFLOPPY/

» The STOS Time Tunnel
If you've not been before, the release lives inside the STOS Time Tunnel - the proper, actively maintained home of STOS (the old stos.atari.st has been untouched for 10+ years). It's a huge archive: Main index: exxosforum.co.uk/atari/STOS_index.htm

Enjoy, and let's keep STOS alive.
User avatar
sporniket
Site sponsor
Site sponsor
Posts: 1164
Joined: 26 Sep 2020 21:12
Location: France

Re: STOS BASIC V5.5 ALPHA — The First Rebuild of the 1989 Sources in Over 30 Years

Post by sporniket »

Wow, great work !

I never made something worthy at the time with the STOS, but I have fond memories of trying things.

Return to “NEWS & ANNOUNCEMENTS”

Who is online

Users browsing this forum: ClaudeBot and 5 guests