ZX Basic vs Commodore V2.00 (Vic 20)

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by 1024MAK »

Shaun_B wrote: Sun Nov 18, 2018 7:43 pm
1024MAK wrote: Sun Nov 18, 2018 3:08 pm For me, the most annoying limitation of the ZX80 and ZX81 BASICs is no multi-statement lines :(
This is the apparent annoyance with ZX Spectrum BASIC (and all other variants except for ZX80/81 BASIC) because multi-statemented BASIC lines might make it more difficult to debug.
Maybe, but this is how I did things:

Code: Select all

10 REM Hardware port test program
20 CLS : LET exit=0
30 LET port=255: LET data=0
40 PRINT “Hardware port test program”
50 PRINT “Enter a port address, then data to output to port.”
100 FOR M=1 TO 1 STEP 0: REM Main loop
110 GO SUB 1000: REM Get User input
120 GO SUB 2000: REM Output to external hardware
130 GO SUB 3000: REM Update screen
140 IF exit THEN LET M=2: REM ‘exit’ set if user wants to end
150 NEXT M
160 CLS
170 GO TO 9999: REM jump to last line, then end.
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by Shaun_B »

Also something else considered bad practise - same line comments ;-)

Regards,

Shaun.
Crayon21
Posts: 348
Joined: Sun Nov 04, 2018 2:33 am

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by Crayon21 »

Shaun_B wrote: Sun Nov 18, 2018 10:01 pm Also something else considered bad practise - same line comments ;-)

Regards,

Shaun.


same line comments?
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by mrtinb »

I might add that ZX Basic has a feature that Commodore Basic is missing:

PRINT AT
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by Shaun_B »

Crayon21 wrote: Wed Nov 21, 2018 12:14 am
Shaun_B wrote: Sun Nov 18, 2018 10:01 pm Also something else considered bad practise - same line comments ;-)

Regards,

Shaun.


same line comments?
Yes, like this:

Code: Select all

10 PRINT "Hello ";: GO TO 10: REM This is an inline comment
It's kind of considered common practise in assembly, but not so in high-level languages. But then who cares about coding standards and such?

Regards,

Shaun.
User avatar
gammaray
Posts: 590
Joined: Sun Apr 17, 2016 2:44 am
Location: Texas

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by gammaray »

Of course! Do what works for you... I, for what it counts, like this method.

I have seen this in U.S. (SOME) coding if I am not mistaken. Also with Linux bash scripts.

If your working on a team though, they might squeal!!
Last edited by gammaray on Tue Dec 04, 2018 10:51 pm, edited 1 time in total.
5-TS1000,UK ZX81<-Sheelagh, US ZX81, 2-TS1500/KDLX , 3-TS2040 printer, 2-TS2020 cassette decks, ZXPAND+AY, ZeddyNET, ZXBlast, UDG, ZX8CCB, AERCO, BUILDS/REPAIRS ZX Spectrum, ZX80 Minstrel, ZXMAX48 v1 v2, 2-TS-2068, ROM, 16kRAM
Crayon21
Posts: 348
Joined: Sun Nov 04, 2018 2:33 am

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by Crayon21 »

Shaun_B wrote: Sun Nov 18, 2018 11:16 am The biggest difference, of course, is that the ZX81 ROM is 8K whereas the BASIC Kernal on the Commodore VIC-20 is 16k, therefore Commodore BASIC was more verbose.

Regards,

Shaun.
verbose how?
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by mrtinb »

Explaining error messages.

But the Commodore Basic also saved commands as tokens.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Shaun_B
Posts: 474
Joined: Wed Apr 22, 2009 10:22 am

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by Shaun_B »

Crayon21 wrote: Sun Dec 02, 2018 3:50 am verbose how?
More commands, may use GOTO and GO TO and data handling can handle strings without quotation marks in some cases. There are 71 commands.

Also allows to define simple mathematical functions to be defined and called anywhere.

I am of course comparing ZX80/81 BASIC to BASIC V2 as described by this sub-forums description.

Regards,

Shaun.
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: ZX Basic vs Commodore V2.00 (Vic 20)

Post by Moggy »

Mathematical functions simple and complex can be defined within a string in zx81 basic and the evaluation of said function, after whatever values needed are entered, can be called by simply asking the strings value.
Post Reply