Welcome, Guest. Please login or register.

Author Topic: How to get AmigaBASIC running on Kickstart 3.1?  (Read 10905 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline olsen

Re: How to get AmigaBASIC running on Kickstart 3.1?
« on: January 17, 2013, 06:23:47 PM »
Quote from: Piru;694678
IIRC amigabasic uses the upper 8-bit of addresses to store some information. That means it won't work with memory above 24-bit (0xffffff or 16MB). Assuming you apply the patch mentioned earlier and disable all memory above the limit, it could work.

The patch may work on the A1200, but it may not be sufficient for any other Amiga using a CPU with a 32 bit address bus.

The story I heard was that AmigaBASIC was a more or less straight port of MS BASIC for Macintosh. In 1985 the Macintosh exclusively used the 68000 CPU, and its operating system's memory management would use the upper 8 bits of memory pointers for tagging (this is documented in "Inside Macintosh Volume II", on page II-24). Because the 68000 had a 24 bit address bus it would ignore the tag bits in the pointer.

This neat trick would come back to haunt Apple, and for the Macintosh II they had to "cripple" the 68020 to preserve the 24 bit address space which the operating system was made for on the 68000 CPU. The A1200 already has a CPU with a 24 bit address bus, so this may be the only type of "modern" Amiga that might be able to run AmigaBASIC.

Anyway, the AmigaBASIC runtime is likely to use memory tagging itself, because of its roots. The BASIC interpreter itself may have actually been written in p-code, with a p-code interpreter written in 68k assembly language running it. At least for me that would explain why the whole damn thing was so slow: the p-code interpreter running the BASIC interpreter, running the BASIC program. What could possibly go wrong...

I found the Amiga-specific bits and pieces of AmigaBASIC during a spelunking expedition, and these were (curiously) written in 68k assembly language. This is why I suspect that the BASIC interpreter was written in p-code, since the Amiga portions would have to interface to the BASIC runtime. Given how slow that was, I think it's unlikely that it was written in 68k assembly language, too.
« Last Edit: January 18, 2013, 09:12:36 AM by olsen »