Page 6 of 18
BASIC 2? Why not get BASIC 7?
Posted: Thu Mar 04, 2021 4:51 pm
by paulscottrobson
On 3/4/2021 at 1:21 PM, kktos said:
Nice job, Mr R ?
I like the way you're thinking ?
And I like it also because if we manage to write our own basic, we won't have any licence troubles. And we will have something well suited for the X16.
Would you mind starting a thread on your BASIC with some examples, docs... and so on.
We may be of assistance ?
Cheers to you, mate !
It's too eccentric. I've cannibalised some of the bits into something closer to a normal BASIC.
https://github.com/paulscottrobson/6502-basic . It's modular so you can basically add and remove whole chunks as you like, and it's also designed to run in paged memory.
So far
:
32 bit integer and string types (hooks for floating point)
long variable names.
Integer and string functions and operators, BBC Basic style indirection.
While/Repeat/For/Multilevel Ifs
Procedures
Locals/Parameters
VPEEK/VPOKE and VDEEK/VDOKE because there are so many 16 bit values.
Outstanding:
Inline assembler (can probably pinch most of this from atomic basic)
Arrays
Tokenising / Detokenising stuff (at the moment the tokeniser is in Python)
(More and fancier) X16 specific stuff.
BASIC 2? Why not get BASIC 7?
Posted: Thu Mar 04, 2021 7:55 pm
by Stefan
Ambitious project
@paulscottrobson!
Do you intend to store programs as plain text or as tokenized files?
If plain text, I guess you could use the text editor I've been working on to write BASIC code. Please let me know if you require anything special to make that work.
EDIT: And I almost forgot. If you feel old school, there is also the LED in the downloads section. I like that a lot. It's surprisingly efficient to use.
BASIC 2? Why not get BASIC 7?
Posted: Fri Mar 05, 2021 10:01 am
by paulscottrobson
14 hours ago, Stefan said:
Ambitious project
@paulscottrobson!
Do you intend to store programs as plain text or as tokenized files?
If plain text, I guess you could use the text editor I've been working on to write BASIC code. Please let me know if you require anything special to make that work.
EDIT: And I almost forgot. If you feel old school, there is also the LED in the downloads section. I like that a lot. It's surprisingly efficient to use.
Well both
? At present it's text editor -> Python script -> tokenised file -> BASIC, so it's acting like a runtime more than anything. I will write tokeniser/detokeniser/editor code, and it's fairly simple though slightly different to MSBasic, in that an identifier is always a single element, it doesn't tokenise TOTAL as <TO> TAL. Extending the standard load / save so it could load a text file or take it from another point in memory would be easy enough. It does still use line numbers but doesn't actually need them (except for backwards compatibility - GOTO GOSUB and RETURN are still there) but they could be just generated on the fly.
BASIC 2? Why not get BASIC 7?
Posted: Fri Mar 05, 2021 6:00 pm
by paulscottrobson
There is now a reference for what currently works (as a runtime) at
https://github.com/paulscottrobson/6502-basic/blob/main/documents/Reference.pdf It is probably very fragile, though actually so far so good
?
BASIC 2? Why not get BASIC 7?
Posted: Sat Mar 06, 2021 12:26 pm
by BruceMcF
On 3/3/2021 at 5:59 PM, Wertzui said:
As we are today in the lockdowns and we have to live our lives on our main PC, it would be a refreshing change to sit in front of something different and type away, no urge to open the Internet, no dayjob stuff, no stupid news and social media in reach.
Precisely. I expect the higher productivity will be those that program it on the emulator and run it on the real iron just as a final test ... but the greater satisfaction may be those who turn off the modern world and program it old school.
Mind, I wouldn't do it in Basic.
BASIC 2? Why not get BASIC 7?
Posted: Sat Mar 06, 2021 5:57 pm
by paulscottrobson
5 hours ago, BruceMcF said:
Precisely. I expect the higher productivity will be those that program it on the emulator and run it on the real iron just as a final test ... but the greater satisfaction may be those who turn off the modern world and program it old school.
Mind, I wouldn't do it in Basic.
Depends what BASIC
? People conflate the Microsoft/Dartmouth BASICs with more advanced ones.
BASIC 2? Why not get BASIC 7?
Posted: Mon Mar 08, 2021 5:52 am
by BruceMcF
On 3/7/2021 at 1:57 AM, paulscottrobson said:
Depends what BASIC ? People conflate the Microsoft/Dartmouth BASICs with more advanced ones.
For some it may depend, I wouldn't do it in one of the more advanced Basics either.
BASIC 2? Why not get BASIC 7?
Posted: Mon Mar 08, 2021 11:44 am
by paulscottrobson
5 hours ago, BruceMcF said:
For some it may depend, I wouldn't do it in one of the more advanced Basics either.
I do miss data structures, though some BASICs do have them.
BASIC 2? Why not get BASIC 7?
Posted: Mon Mar 08, 2021 10:49 pm
by rje
16 hours ago, BruceMcF said:
For some it may depend, I wouldn't do it in one of the more advanced Basics either.
I'm not minding using an incremented BASIC.
Although ... well I *should* be doing my coding in C, shouldn't I? I mean that's closer to my natural medium.
I guess all the PETSCII and cursor and color codes are still available... it's quite a paradigm shift, writing Commodore stuff with C.
BASIC 2? Why not get BASIC 7?
Posted: Mon Mar 08, 2021 11:13 pm
by Michael Parson
19 minutes ago, rje said:
I'm not minding using an incremented BASIC.
Although ... well I *should* be doing my coding in C, shouldn't I? I mean that's closer to my natural medium.
I guess all the PETSCII and cursor and color codes are still available... it's quite a paradigm shift, writing Commodore stuff with C.
I used the X-16 as an excuse to take another run at C.
The results so far? A PETSCII game: https://github.com/mparson/gridgame (slightly older version available in the X-16 downloads section).
I started with the X-16 as the target, but now it compiles and runs on the C-64 and 128 as well.