Jump to content




Photo

BBC BASIC running as an application

Posted by benryves, 03 June 2008 · 41 views

Richard Russell has kindly supplied the project with the BBC BASIC relocatable modules — compiled object files which can be relocated to any memory address by a linker — which means that BBC BASIC can now be configured to run on the TI's hardware.

The tools to relocate the modules run under CP/M, which means that rather trying to integrate the relocation into the build process (which would be a little awkward) I'm going to relocate the modules to a fixed base address and inject the resulting binary file directly into the application.

BBC BASIC will reside from &4100. From &4000..&40FF is a jump table, which BASIC uses to interact with the host. As the addresses of the host interface entry points will change as the code changes, and I don't wish to keep on relinking BASIC in CP/M, a fixed jump table makes life a lot easier. BASIC jumps to a predetermined fixed address in the jump table, which redirects - via a second jump - to the real entry point.


I think I've implemented all of the main host interface entry points, though some — notably those involved in file I/O — need making more robust. I don't currently reserve any memory for BASIC's scratch area, which means that the TI-OS can (and does) decide to overwrite it at inconvenient moments. Even though TI provided us with at least three different 768-byte buffers (the exact size of BBC BASIC's scratch area), none of them are aligned to a 256 byte boundary. [sad]





paulecoyote
Jun 09 2008 11:15 PM
Still hacking away on cool stuff. *subscribed*
Saw this and thought of you: http://www.hackszine.com/blog/archive/2008/06/time_lapse_movies_using_a_grap.html?CMP=OTC-7G2N43923558
Cheers. A nice hack, that!
Calculators aren't especially cool hardware, but if you've got a programmable device you might as well put it to use. [smile]
PARTNERS