Jump to content

Photo

Basic++, Os++ and a couple of updates

Basic Atari++ EmulationBasic Os Emulation

2 replies to this topic

#1 thorfdbg OFFLINE  

thorfdbg

    Dragonstomper

  • 717 posts

Posted Sat Mar 18, 2017 7:36 AM

Hi folks,

 

here's a small update to the Atari++ emulator in the form of a new operating system and (two) new basic interpreters. A new compiled version of the emulator itself with the new versions build in will follow:

 

Attached File  basic++.zip   53.41KB   26 downloads

 

I'm providing it here so you can play with it until I find the time to rebild the emulator itself.

 

The operating system fixes one rather nasty bug in the editor handler that would have overwritten some memory when disabling the cursor (ough). That's the Os++ ROM dump in the ZIP file above. It's a 16K ROM for the XL machine.

 

Basic++ is present in two versions, each of which assembled in three variants. The variant without a file extension is a ROM dump, to be used for the emulator. Then there are two self-loading binaries per version. The versions without "a0" in the file name load into the lower memory region and keep the traditional cart space starting at $a000 free. This minimizes the RAM footprint, but causes some compatibility issues with Basic files that expect the ROM at $a000. This is what the "_a0" versions are for. They require about 1K additional memory, but run in the traditional cartridge area. Clearly, the ROM-dump is also for this area, but does not require additional RAM.

 

So what's new?

 

In release 1.07, I streamlined the interpreter a little bit further, especially "READ" got a little bit faster and shorter, providing a small advantage over the previous revision.

 

Release 1.08 is quite experimental, and I'm not sure whether I will keep the changes - so I let you try. The advantage is that it eliminiates one of the "hot spots" of Atari basic, namely the line number lookup. This was a linear search through a list, with a minor optimization to start from the current line if the target line number is larger than the current line. In 1.08, I'm trying the same trick as in Turbo Basic where I keep a "hash list" of lines of 128 entries, one entry per 256 possible line numbers. This makes GOTO and GOSUB quite noticably faster. Whether this is a substantial improvement depends on the program. Programs with many GOSUBs or GOTOs like the ABC basic compiler profit a lot. Linear programs or programs with FOR-NEXT loops do not profit (FOR-NEXT is already optimized).

 

Unfortunately, the hash list requires 256 bytes additional RAM, and more ROM space, so the title had to go.

 

Hence, please try and let me know how it goes.

 

Greetings, Thomas



#2 777ismyname OFFLINE  

777ismyname

    Space Invader

  • 41 posts

Posted Sat Mar 18, 2017 9:39 AM

Thank you, thorfdbg!



#3 JamesD OFFLINE  

JamesD

    Quadrunner

  • 7,002 posts

Posted Sat Mar 18, 2017 9:47 AM

Hi folks,

...

Release 1.08 is quite experimental, and I'm not sure whether I will keep the changes - so I let you try. The advantage is that it eliminiates one of the "hot spots" of Atari basic, namely the line number lookup. This was a linear search through a list, with a minor optimization to start from the current line if the target line number is larger than the current line. In 1.08, I'm trying the same trick as in Turbo Basic where I keep a "hash list" of lines of 128 entries, one entry per 256 possible line numbers. This makes GOTO and GOSUB quite noticably faster. Whether this is a substantial improvement depends on the program. Programs with many GOSUBs or GOTOs like the ABC basic compiler profit a lot. Linear programs or programs with FOR-NEXT loops do not profit (FOR-NEXT is already optimized).

 

Unfortunately, the hash list requires 256 bytes additional RAM, and more ROM space, so the title had to go.

 

Hence, please try and let me know how it goes.

 

Greetings, Thomas

I thought about using an LFU line number cache to speed up another interpreter.
I'm not sure it would be as fast as a hash but it doesn't require as much RAM to work.
 







Also tagged with one or more of these keywords: Basic, Atari++, EmulationBasic, Os, Emulation

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users