Vintage computer compatibility

Just starting out? Need help? Post your questions and find answers here.
craig7
User
User
Posts: 35
Joined: Thu Sep 23, 2021 2:49 pm

Vintage computer compatibility

Post by craig7 »

I have in mind to create code that would be written in such a way that, while it runs on Windows, could easily be ported to other basic systems - especially older systems, such as Commodore Pet, TRS 80, Amstrad etc.

My question. What parts of Purebasic would be compatible with older basic systems and what should one avoid using (e.g. GUI) to make it easier to port?
I am a beginner (with Basic - but I use modern languages: R, Python & VBA) and still in the early planning stages and wondering if Purebasic is suitable for making code that is 'robust' and not too dependent on one or the other OS and hardware.
Last edited by craig7 on Tue Feb 27, 2024 3:03 pm, edited 2 times in total.
zikitrake
Addict
Addict
Posts: 875
Joined: Thu Mar 25, 2004 2:15 pm
Location: Spain

Re: Vintage computer compatibility

Post by zikitrake »

Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
PB 6.21 beta, PureVision User
User avatar
matalog
Enthusiast
Enthusiast
Posts: 304
Joined: Tue Sep 05, 2017 10:07 am

Re: Vintage computer compatability

Post by matalog »

Start with the BASIC language of your old system of choice, as they will have far less commands that Purebasic.

Check that the use of each command will work in Purebasic.

For example on ZX Spectrum you have to use 10 LET X=1 ; that is , a line number and LET to define a variable.
Commodore 64 also needs a line number, but you can leave out the LET, which will work with Purebasic. 10 X=1

Purebasic doesn't allow line numbers, so that will be a big problem if you want code that can be exactly the same on both computers.
User avatar
matalog
Enthusiast
Enthusiast
Posts: 304
Joined: Tue Sep 05, 2017 10:07 am

Re: Vintage computer compatibility

Post by matalog »

One other way to look at it is if you ccan compile C with Purebasic, you will also be able to compile C for most of those computers.
craig7
User
User
Posts: 35
Joined: Thu Sep 23, 2021 2:49 pm

Re: Vintage computer compatibility

Post by craig7 »

matalog wrote: Tue Feb 27, 2024 2:02 pm Start with the BASIC language of your old system of choice, as they will have far less commands that Purebasic.

Check that the use of each command will work in Purebasic.

For example on ZX Spectrum you have to use 10 LET X=1 ; that is , a line number and LET to define a variable.
Commodore 64 also needs a line number, but you can leave out the LET, which will work with Purebasic. 10 X=1

Purebasic doesn't allow line numbers, so that will be a big problem if you want code that can be exactly the same on both computers.
Yes that sounds logical to start with the old language first.
The line numbers; I forgot about that. I'm most familiar with R, Python & VBA and only have vague memories of tinkering with Basic in the 80s. I suppose there is no way to get PureBasic to ignore them without an error.
craig7
User
User
Posts: 35
Joined: Thu Sep 23, 2021 2:49 pm

Re: Vintage computer compatibility

Post by craig7 »

zikitrake wrote: Tue Feb 27, 2024 1:13 pm Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
Interesting, never seen that before. I guess PureBasic is more of a VB6 replacement / continuation than early Basic. Perhaps if looking at other languages that would work well across time, Fortran is another to consider as that is well documented and has strict standards such as F77 and a lot of discussion around compatibility across time.
User avatar
CDXbow
Enthusiast
Enthusiast
Posts: 100
Joined: Mon Aug 12, 2019 5:32 am
Location: Oz

Re: Vintage computer compatibility

Post by CDXbow »

zikitrake wrote: Tue Feb 27, 2024 1:13 pm Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
Sinclair Basic was my first computer language I ever used, on the Speccy. Probably close to forty years ago and it makes me feel so very old. Glad to see it's still alive, but thank god the tape drive died. I still have the Spectrum stored away, I might give ZXBasic a try. It compiles BASIC to Z80 assembler code so potentially other Z80 platforms could be supported, not that I have any.
User avatar
matalog
Enthusiast
Enthusiast
Posts: 304
Joined: Tue Sep 05, 2017 10:07 am

Re: Vintage computer compatibility

Post by matalog »

CDXbow wrote: Sun Mar 03, 2024 1:05 pm
zikitrake wrote: Tue Feb 27, 2024 1:13 pm Although I have not used them, it is more likely that I would use one of these two languages:

https://zxbasic.readthedocs.io/en/docs/ or https://en.wikipedia.org/wiki/Z88DK
Sinclair Basic was my first computer language I ever used, on the Speccy. Probably close to forty years ago and it makes me feel so very old. Glad to see it's still alive, but thank god the tape drive died. I still have the Spectrum stored away, I might give ZXBasic a try. It compiles BASIC to Z80 assembler code so potentially other Z80 platforms could be supported, not that I have any.
SpecBAS https://github.com/ZXDunny/SpecBAS is an enhanced Sinclair BASIC interpreter for modern PCs - and BASINC https://arda.kisafilm.org/blog/?page_id=848&lang=en Is a great IDE with emulator for working with origingal ZX BASIC programs.
Rinzwind
Enthusiast
Enthusiast
Posts: 690
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Vintage computer compatibility

Post by Rinzwind »

matalog wrote: Tue Feb 27, 2024 2:04 pm One other way to look at it is if you ccan compile C with Purebasic, you will also be able to compile C for most of those computers.
Not really, just because it has a c layer, doesn't mean it runs everywhere. Especially not since PB's standard libs are "only" available for mac, linux and windows and not open sourced. And especially not for vintage hardware.

MSX basic is a good 80's basic and easy to start with at https://msxpen.com/
For classic lower level 8 bits dev this is a great start: http://8bitworkshop.com/v3.11.0/?

But no, there is no vintage computer compatibility found in PB. Unless you're into the Amiga. IMHO PB is more like a fully packaged easier c.

Btw FreePascal has a large number of target platforms incl z80.
craig7
User
User
Posts: 35
Joined: Thu Sep 23, 2021 2:49 pm

Re: Vintage computer compatibility

Post by craig7 »

Rinzwind wrote: Mon Mar 04, 2024 3:15 am
matalog wrote: Tue Feb 27, 2024 2:04 pm One other way to look at it is if you ccan compile C with Purebasic, you will also be able to compile C for most of those computers.
Not really, just because it has a c layer, doesn't mean it runs everywhere. Especially not since PB's standard libs are "only" available for mac, linux and windows and not open sourced. And especially not for vintage hardware.

MSX basic is a good 80's basic and easy to start with at https://msxpen.com/
For classic lower level 8 bits dev this is a great start: http://8bitworkshop.com/v3.11.0/?

But no, there is no vintage computer compatibility found in PB. Unless you're into the Amiga. IMHO PB is more like a fully packaged easier c.

Btw FreePascal has a large number of target platforms incl z80.
Thanks that is useful.
Post Reply