Compiling a SIMON's BASIC program on the C64

  Рет қаралды 2,979

Retro Old Guy

Retro Old Guy

Күн бұрын

In this video I use the Abacus BASIC-64 compiler to compile a BASIC program created with SIMONS BASIC. Then run a side-by-side comparison of the quick sort algorithm with the C128 and Vision BASIC versions.
D64 image with code: sites.google.com/view/retroke...
Vision BASIC: visionbasic.net
00:00 Title
00:08 Introduction
00:27 Discussion
01:22 QuickSort Program
02:10 Running the sorts
04:02 Abacus BASIC-64 compiler
04:19 Advanced compiler options
05:05 Compiling the program
05:39 Run the compiled program in BASIC
06:08 Sort race!
07:34 Opinions
08:14 Exit. Thank you!

Пікірлер: 46
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
ALERT: If you are using this quicksort routine in Vision BASIC or any other compiler that defaults to positive (unsigned) integers. Under some data conditions the J variable will decrement to -1 and wrap around to 65535, causing the sort to fail. So if your compiler (or compiler options) use only unsigned integers, you must test J at line 135, for example. 135 if j>32767 then j=0:goto 150 140 if a(j)>d then dec j:goto 135 The Abacus compiler used in the video defines integers as signed integers, so the extra IF-THEN was not necessary.
@csbruce
@csbruce 2 ай бұрын
The main thing that's being compared here is the speed of the line-drawing routines. You can actually see the individual lines being drawn in the Simons' and C128 versions, so those routines are very slow, despite being written in machine language. They probably use floating-point calculations, while Vision BASIC must use an integer method, like Bresenham's Algorithm.
@GRayDefender
@GRayDefender 2 ай бұрын
Nice video! Been loving these comparison videos. It's amazing just how fast Vision Basic is. I hope more people check it out eventually.
@endwigast5212
@endwigast5212 2 ай бұрын
@GRayDefender - If you've got any buddies in the C64 community who'd want their own copy of Vision BASIC, the online store is having a "mismatch" clearance sale right now - the spiral bound manual edition is going for $20 + shipping!
@drphilxr
@drphilxr 2 ай бұрын
I have vision basic and one day will have the time to do more than read the (great) manual 😊
@endwigast5212
@endwigast5212 2 ай бұрын
@@drphilxr Are you that same Dr. Phil who keeps sending Amigas to Chris Edwards for repair?
@JustWasted3HoursHere
@JustWasted3HoursHere 26 күн бұрын
It's a shame that there was never a SIMONS BASIC compiler available from the author of SIMONS BASIC, David Simons.* I had SB and played with it relentlessly as a teenager. * This points out a revelation I had years ago, that it is not named after a guy named Simon as a first name, but after a guy whose LAST name is Simons, therefore the apostrophe is not to be used.
@BustaHymen
@BustaHymen 2 ай бұрын
Great video! These benchmaks are fun to watch and tell a lot. PS: Compiled Vision Basic programs can be run from Basic 2.0 :)
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
The Vision Basic program was a compiled program, not within Vision Basic. One of my previous videos showed the creation of the VB sort program.
@endwigast5212
@endwigast5212 2 ай бұрын
If anyone needs an extra copy of the Vision BASIC spiral bound manual, there's a "mismatch" clearance sale for $20 + shipping right now.
@paulkocyla1343
@paulkocyla1343 Ай бұрын
I guess the Simon' s Basic cartridge ROM is mapped over the original Basic ROM. The compiler might work if you dump the Simon' s ROM and load it to memory as well together with your compiled program. There are packers that allow you to compress and load the whole 64k memory at once, decompress it and jump to a specified address. Dunno if Simon' s Basic used any form of copy protection to avoid the Basic beeing ran standalone.
@jamesg872
@jamesg872 2 ай бұрын
It was my understanding that those rudimentary compilers were simply removing extra "fluff" from the basic code so it isn't really converting it to machine language. That would be why the extension cartridge is still needed. And one of the claims of Vision Basic is that you *can* use the compiled programs on a stock 64, assuming it had enough memory as Vision Basic needs an REU to work.
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
True Vision BASIC does need an REU when developing/writing the code, but once compiled, the program will run on a stock 64 (without REU). The sort in the video was the compiled program
@networkg
@networkg Ай бұрын
Please ! More Vision Basic . I am particularly interested in what add-ons you might come up with for that language.
@visionbasic
@visionbasic 2 ай бұрын
I was always trying to make better and faster games, so I made a few with Simon's BASIC (since the regular C-64 BASIC was so lacking). But Simon's BASIC is still slow. So I compiled what games I could, and it certainly helped. But I used Blitz!. There is at least one Simon's BASIC command that won't compile, but I don't remember what it was (and there could be other commands). But yes, you still needed the Simon's BASIC cartridge to run the compiled programs with. It was nice that you could at least compile the programs with Blitz!. I compiled pretty much everything with Blitz!, LOL. Simon's BASIC was certainly an inspiration for my work.
@johnsmith1953x
@johnsmith1953x 2 ай бұрын
I never knew you could compile Simon's Basic with Abacus! Does it work with CBM's Basic Extender? Is that basic 4.0? Abacus compiler made my old C64 games playable by speeding them up 2x! If I only had that back in the 1980s !! You final comparison is a little confusing. 42 seconds compiled C64 Simon basic runs at 42 sec versus C64 interpeted at 74 seconds. Its still an improvement. Generally, I've seen 2-3x speed ups with Abacus. BUT, what the eff is VISION BASIC? Geez is that crazy fast!!
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
All 3 of the programs in the final run were the compiled versions.
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
I showed the all the options for supported BASIC extender utilities. CBM BASIC Extender was not one of them. However the manual does hint that others MAY work if they meet certain criteria and says to just experiment. I'm surprised that SuperExpander was not included, as it was marketed by Commodore
@endwigast5212
@endwigast5212 2 ай бұрын
@johnsmith1953x - Surprised you haven't heard of Vision BASIC. The creator Dennis Osborn has made numerous KZfaq videos about this hyper-fast version of BASIC, so do a search and enjoy!
@vcv6560
@vcv6560 24 күн бұрын
@@retrooldguy9880 my guess is the CBM Basic Extender is the 'Super Expander' cartridge, an 8K ROM extension that added 21 commands much in the way of Simons'. I had it in the mid 80s. So please try loading that ROM image and trying the comparison again. (I assume you're doing all this on VICE or the like). Thanks.
@retrooldguy9880
@retrooldguy9880 24 күн бұрын
The BASIC 4.0 option didn't work with the Super Expander sort program. However, I was able to compile it using the "Other" option by tweaking the memory and token byte settings. So maybe another 5 minute sort video with all of the versions in a drag race.
@timlocke3159
@timlocke3159 2 ай бұрын
I'm not at all surprised BASIC 7 on the C128 is a lot slower than BASIC 2 on the C64. Based on my own benchmarking, BASIC 2 on the C64 is quite a bit faster than BASIC 7 on the C128 @ 1 MHz. One reason is because BASIC 7 has to parse a lot more keyword tokens. Even when the C128 is in C64 mode running BASIC 2, it is about 7% slower than BASIC 2 running on the C64, so there is something using up CPU cycles on the C128. If you want BASIC 7 to be faster than the C64, you have to run it at 2 MHz.
@8_Bit
@8_Bit 2 ай бұрын
Yes, and the other significant factor I'm aware of is all the bank switching overhead; a lot of juggling happens to allow two banks of 64K RAM and another 64K of ROM or so to all co-exist in a 64K address space.
@timlocke3159
@timlocke3159 2 ай бұрын
@@8_Bit Yes, the TED systems also have that issue. There is also RadarSoft's Radar BASIC for the C64 which gives 50K free for BASIC by toggling the BASIC ROM and adds some new commands (under the KERNAL?).
@timlocke3159
@timlocke3159 2 ай бұрын
BASIC 4.0 is the version of Commodore BASIC used on the later PETs and on the CBM-II computers. It was available for the VIC-20 and C64.
@FadkinsDiet
@FadkinsDiet 2 ай бұрын
How? Was it a cartridge?
@timlocke3159
@timlocke3159 2 ай бұрын
@@FadkinsDiet I believe so. I have 4K ROM images of it for the VIC-20 that load into $A000 and adds BASIC 4 commands to BASIC 2. The C64 version I've seen is also 4K but on disk and loads to $9000 or $C000. Perhaps it was originally a cartridge as well.
@8_Bit
@8_Bit 2 ай бұрын
I've been under the impression that BASIC 4.0 for the C64 and VIC-20 are unofficial "hacks" done by hobbyists rather than an official Commodore release. I could be wrong, but I've never seen a real cartridge for either system, or even a product code or listing or anything about it.
@timlocke3159
@timlocke3159 2 ай бұрын
@@8_Bit Could be. They definitely patch into the existing ROM to add the new commands.
@peachgrush
@peachgrush 2 ай бұрын
It looks like the compiler only bothers with the BASIC code part, and just uses the ROM- or extension-provided routines to call to when executing the compiled statements. It still makes you wonder why the compiled version is so much larger on disk. When compiled to true machine code with no additional runtime, it should be even smaller than the original BASIC source.
@czayas
@czayas 2 ай бұрын
Impressive! I had Simons' BASIC back then and I loved it. Now I have Vision BASIC, I didn't know it was wickedly fast! Can you share the files that you used in the video?
@endwigast5212
@endwigast5212 2 ай бұрын
@czayas - If you have any friends who might want their own copy of Vision BASIC, their online store is having a mismatch clearance sale right now. A spiral bound manual edition is going for as little as $20 + shipping!
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
I added a link in the description.
@rimmersbryggeri
@rimmersbryggeri 2 ай бұрын
Is it possible to put the extended basic rom inside the computer?
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
Maybe. But I'm not qualified to answer that. I'm a software guy, and that seems like a hardware problem . 😉 Hopefully someone else will respond.
@clausjepsen3505
@clausjepsen3505 27 күн бұрын
I had "Simons Basic" and felt very alone. It is such a pity that C64 basic was so lame, having no dedicated commands for graphics (e.g. SETDOT and GETDOT), sprites or sound. Commodore should have offered Simons Basic as a free option with the Disk Drive and a cheap upgrade. That way, much more would actually program instead of just waste their time gaming.
@vcv6560
@vcv6560 24 күн бұрын
I bought CBM's Super Expander cartridge because of the paltry (none) graphics support. I only learned of Simons' later.
@timlocke3159
@timlocke3159 2 ай бұрын
Technically you can sell a program to anyone who doesn't have that utility. You don't even have to lie to them to do so.
@endwigast5212
@endwigast5212 2 ай бұрын
Will you provide a refund when the buyer without a Simons' BASIC cartridge complains to you that they can't run the program?
@timlocke3159
@timlocke3159 2 ай бұрын
@@endwigast5212 Of course. Duh.
@endwigast5212
@endwigast5212 2 ай бұрын
@@timlocke3159 Why wouldn't you let the buyer know upfront that they'd need to have a Simons' BASIC cartridge to run your program? Would save them from experiencing a nasty surprise. Duh.
@timlocke3159
@timlocke3159 2 ай бұрын
@@endwigast5212 I would.
@me4104
@me4104 2 ай бұрын
Scan-lines PLEASE!
@timlocke3159
@timlocke3159 2 ай бұрын
How long does it take to compile each version?
@retrooldguy9880
@retrooldguy9880 2 ай бұрын
Depends on the size of the BASIC program of course, but these small sort demos took about 5-7 minutes to compile. The C128 version of the Abacus compiler can run in FAST mode in 80 columns, so 3-4 minutes on a 128.
@vcv6560
@vcv6560 24 күн бұрын
@@retrooldguy9880 I may have asked before (your earlier video) did you create these using VICE and the .d64 images of the compiler. Yes I too remember how leisurely the Abacus products ran on the venerable 1541. Good times.
C64 Exploring Vision Basic | First Look
38:50
GRay Defender
Рет қаралды 4,1 М.
C64 BASIC Compilers Speed Test using the Quicksort algorithm
14:40
Retro Old Guy
Рет қаралды 6 М.
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
C64 - Hiding machine language in a REM statement
10:07
Retro Old Guy
Рет қаралды 15 М.
C64 Demo: 13:37 by Fairlight ! 11 May 2024!
15:01
C64!
Рет қаралды 46 М.
Risc-V Bare Metal C Hello World!
21:37
Chuck's Tech Talk
Рет қаралды 2,2 М.
The Story of VisiCalc
20:47
Another Boring Topic
Рет қаралды 157 М.
Optimising Code - Computerphile
19:43
Computerphile
Рет қаралды 143 М.
Best POKE Ever? For Commodore 64
22:21
8-Bit Show And Tell
Рет қаралды 42 М.
ARRAYLIST VS LINKEDLIST
21:20
Core Dumped
Рет қаралды 55 М.
10x Faster Than C64 BASIC? Hare Basic
48:01
8-Bit Show And Tell
Рет қаралды 31 М.
38911 Bytes Free? Commodore 64's BASIC RAM
29:57
8-Bit Show And Tell
Рет қаралды 37 М.
Turns out REST APIs weren't the answer (and that's OK!)
10:38
Dylan Beattie
Рет қаралды 113 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 3,4 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 27 МЛН
BEKMOBILDA Tecno Camon 30 smartfoni🔥🤩 #bekmobil
1:01
Bekmobil shorts
Рет қаралды 2,3 МЛН
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 6 МЛН
ВАЖНО! Не проверяйте на своем iPhone после установки на экран!
0:19
ГЛАЗУРЬ СТЕКЛО для iPhone и аксессуары OTU
Рет қаралды 6 МЛН