BASIC 2? Why not get BASIC 7?

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
paulscottrobson
Posts: 300
Joined: Tue Sep 22, 2020 6:43 pm

BASIC 2? Why not get BASIC 7?

Post 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.


 

Stefan
Posts: 448
Joined: Thu Aug 20, 2020 8:59 am

BASIC 2? Why not get BASIC 7?

Post 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.

paulscottrobson
Posts: 300
Joined: Tue Sep 22, 2020 6:43 pm

BASIC 2? Why not get BASIC 7?

Post 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.

 

paulscottrobson
Posts: 300
Joined: Tue Sep 22, 2020 6:43 pm

BASIC 2? Why not get BASIC 7?

Post 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 ?

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

BASIC 2? Why not get BASIC 7?

Post 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.

paulscottrobson
Posts: 300
Joined: Tue Sep 22, 2020 6:43 pm

BASIC 2? Why not get BASIC 7?

Post 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.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

BASIC 2? Why not get BASIC 7?

Post 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.

paulscottrobson
Posts: 300
Joined: Tue Sep 22, 2020 6:43 pm

BASIC 2? Why not get BASIC 7?

Post 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.

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

BASIC 2? Why not get BASIC 7?

Post 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.

 

 

Michael Parson
Posts: 51
Joined: Sun Jan 03, 2021 8:18 pm

BASIC 2? Why not get BASIC 7?

Post 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.

Post Reply