6502 BBC BASIC 4

Is there an online reference listing the differences between 6502 BASIC 4 (for example as resident in the BBC Master) and the earlier versions, particularly BASIC 2?

Comments

  • Soruk wrote: »
    Yes, that's just what I wanted. *BASIC @ is a new one on me, is that implemented in BASIC 5 too?

    And why, pray, can't I make *BASIC @ bold in this forum?!
  • Soruk
    edited September 2023
    The *BASIC @ was added to support moving code between BASIC (tokenised) and the Master 128 Edit which used plaintext. The text is expected to be found at the default PAGE value, so, on a standard Master you could do
    *LOAD plaintext E00
    *BASIC @
    
    ...and BASIC would tokenise it for you.
    It's new to me too - but it's definitely quicker than *EXECing the plaintext in - indeed, I've amended my workflow for preparing the BBC version of Note Quiz to using this as it's far quicker, when I'm doing lots of optimisation to try to squeeze the program to fit on a Model B!

    BASIC 5 uses it differently, it expects two 8-digit hex addresses (start and end) to be supplied, and can accept either tokenised or plaintext code. Not sure the use case for this, as it also supplies the TEXTLOAD keyword to directly read and tokenise a file in plaintext. Additionally, *BASIC -load <filename> will load either tokenised or plaintext, tokenising as necessary. (In Matrix Brandy, as plaintext is its standard saving format, TEXTLOAD and LOAD are equivalent.)

    As for how I boldfaced the *BASIC @ above, I included the spaces inside the block: (round brackets used to show the code rather than have the forum interpret them!)

    (b) *BASIC @ (/b)
  • Soruk wrote: »
    Not sure the use case for this, as it also supplies the TEXTLOAD keyword to directly read and tokenise a file in plaintext. Additionally, *BASIC -load <filename> will load either tokenised or plaintext, tokenising as necessary.
    None of this stuff is necessary if you have an IDE: just do File... Load. :smile:
    Do you really expect people to use BBC BASIC at the command prompt in 2023? :wink:
  • An IDE running outside of BASIC would most likely use this under the lid to pass the code in to BASIC. After all, a C IDE doesn't run inside the C compiler. Similarly that *BASIC @ allows BASIC and Edit to be near enough seamless between themselves, making for a primitive IDE built in to the Master.

    Though, it's got me thinking, I wonder how hard (or otherwise) it would be to connect Geany? Although I use it as an editor (and it is very C-centric) for Matrix Brandy, I do my building at the command line!
  • Soruk wrote: »
    An IDE running outside of BASIC would most likely use this under the lid to pass the code in to BASIC.
    I guess you could do that, but the chances are that the IDE needs to tokenise the code for other reasons (mine certainly does, for example the Syntax Colouring relies on tokenising) so in that case it's probably just as easy to pass tokenised code into BASIC.

    Which is a good thing given that my interpreters only have *exec as a way of loading plain text code into memory!
    Though, it's got me thinking, I wonder how hard (or otherwise) it would be to connect Geany?
    I expect Matrix Brandy would run my IDE (SDLIDE.bbc) with only minor modifications - if it supported structures (which are the only major language feature my IDE relies on that isn't already implemented)!

    As you know my IDE runs in both BBC BASIC for SDL 2.0 and BBC BASIC for Windows so there is already very little platform dependence, nearly everything is done with regular BASIC statements which Matrix Brandy already supports.

    Of course the absence of proportional-spaced fonts would affect the appearance, but that's just cosmetic. I'd probably have a go at porting my IDE to Matrix Brandy myself, if it wasn't for the absence of structures which it uses extensively.
  • Maybe I am exploiting a bug - to tokenise Note Quiz for your WASM implementation, I copy the file to NoteQuiz.bbc, then in your BB4C version I just do:
    LOAD "NoteQuiz"
    SAVE "NoteQuiz"
    
    ...and this works perfectly. And much faster than *EXEC'ing it.
  • Soruk wrote: »
    Maybe I am exploiting a bug
    Not a bug, but a feature that most of my versions of BASIC don't have. It's not in BBC BASIC (Z80), nor in BBC BASIC (x86), nor BBC BASIC for Windows, nor BBC BASIC for SDL 2.0 (32-bit editions). Probably you happened to be using the 64-bit Linux edition, which does have it, but in general my interpreters don't have any way of loading a plain-text program other than *exec.
  • Yes, BBC BASIC for Console, compiled from Git on 64-bit Linux.
Sign In or Register to comment.