Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of abbreviations in PUTBASIC input #34

Open
ZornsLemma opened this issue May 31, 2018 · 1 comment
Open

Allow use of abbreviations in PUTBASIC input #34

ZornsLemma opened this issue May 31, 2018 · 1 comment

Comments

@ZornsLemma
Copy link
Collaborator

ZornsLemma commented May 31, 2018

There's some discussion and a link to a (hacky, experimental) implementation over at stardot: https://stardot.org.uk/forums/viewtopic.php?f=55&t=13638

While very cool, I'm not too keen on the idea of using the BASIC ROM's own tokeniser - jsbeeb naturally has a 6502 emulator and the BASIC ROM available at run time, neither of which is true for beebasm. The latter in particular creates awkward copyright issues around what is (to us) a binary blob, and it seems best to me just to steer clear.

@mungre
Copy link
Collaborator

mungre commented May 31, 2018

The trouble with the minimum abbreviations listed in the user guide is that "useless" abbreviations are omitted. For example, "AS." resolves to ASC rather than ASN but this isn't documented.

BASIC2 has a list of keywords and functions sorted on the first letter only, so it's roughly alphabetical. Abbreviations are resolved to the first match in the list. For example, PRINT is the first P so it gets the abbreviation "P.".

The implementation in beebasm would be more obviously correct if it simply used the list of keywords dumped from the BASIC ROM and searched through it in order.

On the other hand, there probably isn't a basic program in existence that is both non-tokenised and uses these useless abbreviations.

FWIW, here's some code to dump the keywords from the BASIC 2 ROM.

   10S%=&8071
   20FORI%=1TO126
   30A$=""
   40REPEAT
   50A$=A$+CHR$(?S%)
   60S%=S%+1
   70UNTIL?S%>=128
   80PRINT """"A$""",0x"STR$~(?S%)",0x"STR$~(S%?1)
   90S%=S%+2
  100NEXT

mungre added a commit to mungre/beebasm that referenced this issue Oct 16, 2022
mungre added a commit to mungre/beebasm that referenced this issue Oct 16, 2022
mungre added a commit to mungre/beebasm that referenced this issue Oct 17, 2022
mungre added a commit to mungre/beebasm that referenced this issue Oct 18, 2022
mungre added a commit that referenced this issue Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants