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: 2162
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 » Sun Nov 18, 2018 8:26 pm

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

Shaun_B
Posts: 440
Joined: Wed Apr 22, 2009 10:22 am

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

Post by Shaun_B » Sun Nov 18, 2018 10:01 pm

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

Regards,

Shaun.

Crayon21
Posts: 31
Joined: Sun Nov 04, 2018 2:33 am

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

Post by Crayon21 » 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?

User avatar
mrtinb
Posts: 796
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

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

Post by mrtinb » Thu Nov 22, 2018 5:47 am

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

PRINT AT
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Shaun_B
Posts: 440
Joined: Wed Apr 22, 2009 10:22 am

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

Post by Shaun_B » Thu Nov 22, 2018 10:00 pm

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: 543
Joined: Sun Apr 17, 2016 2:44 am
Location: Texas

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

Post by gammaray » Sat Nov 24, 2018 6:11 pm

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: 31
Joined: Sun Nov 04, 2018 2:33 am

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

Post by Crayon21 » Sun Dec 02, 2018 3:50 am

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?

User avatar
mrtinb
Posts: 796
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

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

Post by mrtinb » Sun Dec 02, 2018 10:37 am

Explaining error messages.

But the Commodore Basic also saved commands as tokens.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Shaun_B
Posts: 440
Joined: Wed Apr 22, 2009 10:22 am

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

Post by Shaun_B » Mon Dec 10, 2018 9:30 am

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: 1704
Joined: Wed Jun 18, 2008 2:00 pm

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

Post by Moggy » Mon Dec 10, 2018 4:09 pm

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