I was thinking, sinces BenRyyves, as far as I understand it, basically took a z80 program and added a wrap to it to make it run on the 83+ and 84+, would it be possible to port BBC Basic to other models, such as the 86 or the 82? It would be awesome if we could have cross-compatible games, and since they'd have the same core the only difference should be speed.
In theory, yes, it would be possible and I'd be happy to share the code for the host interface (the bit that sits between the BBC BASIC interpreter and the calculator - the bit that handles key input, file manipulation, graphics commands etc).

One potential issue, though, is size; the TI-83+ version is currently a 48KB Flash application.

I don't think people really like the 1980s-style line-based style of editing programs in BBC BASIC; you'd probably be better off asking for Axe to support cross-compilation to the TI-82/TI-86 or similar.
But I would prefer BBC Basic Razz The line editing is pretty much the only issue. As far as I can tell, BBC Basic is about as uncrashable as TI-Basic, which is really sweet. It's a pity there isn't an ARM port, or I'd try to get it on the nspire.

One question: do you know how the data is stored for BBC Basic Programs, or is that something done by the "big binary blob"? If so, it might still be possible to have a "better" Razz Editor for the code, especially if it was in pure ASCII, except you mentioned it tokenizes as it is entered by Line, correct?

Oh, also, the 86 has 100 KB of space, so.... Good Idea for it Very Happy
willrandship wrote:
It's a pity there isn't an ARM port, or I'd try to get it on the nspire.

BBC BASIC was developed by Acorn, and the ARM (Acorn RISC Machine) was invented by Acorn - Needless to say, RISC OS came with a BBC BASIC interpreter. In fact, the instruction set of the ARM was prototyped in BBC BASIC. Smile

Unfortunately this is rather academic as I don't know where you'd be able to get a portable version of BBC BASIC for ARM. You could write your own implementation but would have to drop the "BBC" from the name (see Brandy BASIC as an example).

Quote:
One question: do you know how the data is stored for BBC Basic Programs, or is that something done by the "big binary blob"? If so, it might still be possible to have a "better" Razz Editor for the code, especially if it was in pure ASCII, except you mentioned it tokenizes as it is entered by Line, correct?

Yes, it is tokenised as you enter it by line but the interpreter does not expose tokenising or detokenising routines. Two pages from the manual's appendices may be of interest: Format of Program and Variables in Memory and Tokeniser. C# source code for the file editor tools is also available if you'd like an working high-level example of how to tokenise/detokenise BBC BASIC programs.
Ben, does this man that I could trivially add tokenization / detokenization of BBC BASIC programs to SourceCoder if it had the proper token tables, or is it more complicated than that? I vaguely feel like we've had this discussion before...
I've got a PHP detokeniser if you'd be interested in it - if you take a file with a .bbc extension on my site (e.g. MINES.bbc) and change the extension to .bbcs it'll show a detokenised view: MINES.bbcs.

It's not entirely trivial to tokenise/detokenise due to the way that line numbers are encoded, for example, though it's not especially difficult either.

I have a hunch that you think we discussed this as I chatted about it with merthsoft in #cemetech as a possible feature for his Tokens project.
benryves wrote:
Unfortunately this is rather academic as I don't know where you'd be able to get a portable version of BBC BASIC for ARM.

It rather depends what you mean by "portable". Acorn's ARM BBC BASIC has been released as part of the 'RISC OS Open' project, so its source code is readily available and I don't think licensing conditions are likely to be too onerous. As I would expect ARM BASIC to have a well-defined interface to the OS (as all Acorn's languages do) porting it to another platform ought to be relatively straightforward, in principle.

Quote:
Yes, it is tokenised as you enter it by line but the interpreter does not expose tokenising or detokenising routines.

Not 'officially', perhaps, but the tokeniser is exposed as a side effect of the EVAL function, as documented here:

http://beebwiki.jonripley.com/Tokeniser

You would need the address of the string buffer, but I'm sure you know that!

Detokenising can be done using BASIC code (would need to be adapted to not use BASIC 5 features):

http://bb4w.wikispaces.com/Detokeniser

So I would say your response was unduly pessimistic!

Richard.
benryves wrote:
I have a hunch that you think we discussed this as I chatted about it with merthsoft in #cemetech as a possible feature for his Tokens project.
That's probably what I'm remembering.

@Richard, welcome to Cemetech, good to have you with us. If you get a chance, I would encourage you to Introduce Yourself.
willrandship wrote:
It might still be possible to have a "better" Razz Editor for the code

The MS-DOS (x86) version of BBC BASIC does have a 'screen editor', which works on the tokenised program. It was originally written in BASIC, before being recoded in assembler, but I fear the BASIC version has long since been deleted. Nevertheless it demonstrates that something more sophisticated than line editing is certainly practical, even on a Z80 platform.

Richard.
Richard Russell wrote:
willrandship wrote:
It might still be possible to have a "better" Razz Editor for the code

The MS-DOS (x86) version of BBC BASIC does have a 'screen editor', which works on the tokenised program. It was originally written in BASIC, before being recoded in assembler, but I fear the BASIC version has long since been deleted. Nevertheless it demonstrates that something more sophisticated than line editing is certainly practical, even on a Z80 platform.

Richard.
We have quite a few editor implementations (for example, take a look at Document DE 7, built using the libraries of my shell, Doors CS 7), but the trick would be efficient and non-molasses-like tokenization and detokenization on-calc. I'm sure that it could be done, and even done well, but I don't know how straightforward it would be.
Thank you very much for your valuable input, Richard!

Richard Russell wrote:
It rather depends what you mean by "portable". Acorn's ARM BBC BASIC has been released as part of the 'RISC OS Open' project, so its source code is readily available and I don't think licensing conditions are likely to be too onerous. As I would expect ARM BASIC to have a well-defined interface to the OS (as all Acorn's languages do) porting it to another platform ought to be relatively straightforward, in principle.

I'm afraid I don't know the first thing about Nspire development, but by "portable" was thinking of a version of ARM BBC BASIC that could be relatively easily adapted to run on the Nspire (or other ARM-based platforms). I think this is one for an Nspire programmer to look into.

Richard Russell wrote:
Quote:
Yes, it is tokenised as you enter it by line but the interpreter does not expose tokenising or detokenising routines.

Not 'officially', perhaps, but the tokeniser is exposed as a side effect of the EVAL function, as documented here:

http://beebwiki.jonripley.com/Tokeniser

You would need the address of the string buffer, but I'm sure you know that!

Detokenising can be done using BASIC code (would need to be adapted to not use BASIC 5 features):

http://bb4w.wikispaces.com/Detokeniser

So I would say your response was unduly pessimistic!

Thank you for those links, especially the EVAL tokeniser trick. *EXEC can currently be used as a way to convert ASCII files into programs, though I don't know of any good plain ASCII editors for the TI-83+ series calculators. Writing one in BBC BASIC would probably be a good step forwards.
*Ahem* what about DoorsCS's DocDE? Razz that edits straight ASCII.
willrandship wrote:
*Ahem* what about DoorsCS's DocDE? Razz that edits straight ASCII.
Close, but not quite. It edits straight (TI-style) ASCII, which is not true ASCII, and has custom newline characters. It would take extremely minimal conversion to adapt its output, though. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement