Compiling a SIMON's BASIC program on the C64

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 46

  • @retrooldguy9880
    @retrooldguy9880  4 หลายเดือนก่อน +1

    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 4 หลายเดือนก่อน +10

    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 4 หลายเดือนก่อน +3

    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 4 หลายเดือนก่อน

      @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 4 หลายเดือนก่อน

      I have vision basic and one day will have the time to do more than read the (great) manual 😊

    • @endwigast5212
      @endwigast5212 4 หลายเดือนก่อน

      @@drphilxr Are you that same Dr. Phil who keeps sending Amigas to Chris Edwards for repair?

  • @JustWasted3HoursHere
    @JustWasted3HoursHere 2 หลายเดือนก่อน +1

    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 4 หลายเดือนก่อน +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  4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน

      If anyone needs an extra copy of the Vision BASIC spiral bound manual, there's a "mismatch" clearance sale for $20 + shipping right now.

  • @jamesg872
    @jamesg872 4 หลายเดือนก่อน +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  4 หลายเดือนก่อน

      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

  • @paulkocyla1343
    @paulkocyla1343 3 หลายเดือนก่อน +1

    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.

  • @networkg
    @networkg 3 หลายเดือนก่อน

    Please ! More Vision Basic . I am particularly interested in what add-ons you might come up with for that language.

  • @timlocke3159
    @timlocke3159 4 หลายเดือนก่อน +4

    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 4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน +1

      @@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?).

  • @visionbasic
    @visionbasic 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน +1

    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  4 หลายเดือนก่อน +1

      All 3 of the programs in the final run were the compiled versions.

    • @retrooldguy9880
      @retrooldguy9880  4 หลายเดือนก่อน +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 4 หลายเดือนก่อน

      @johnsmith1953x - Surprised you haven't heard of Vision BASIC. The creator Dennis Osborn has made numerous TH-cam videos about this hyper-fast version of BASIC, so do a search and enjoy!

    • @vcv6560
      @vcv6560 2 หลายเดือนก่อน +1

      @@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  2 หลายเดือนก่อน +1

      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.

  • @peachgrush
    @peachgrush 4 หลายเดือนก่อน

    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.

  • @clausjepsen3505
    @clausjepsen3505 2 หลายเดือนก่อน +1

    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 2 หลายเดือนก่อน

      I bought CBM's Super Expander cartridge because of the paltry (none) graphics support. I only learned of Simons' later.

  • @timlocke3159
    @timlocke3159 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน

      How? Was it a cartridge?

    • @timlocke3159
      @timlocke3159 4 หลายเดือนก่อน

      @@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 4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน +1

      @@8_Bit Could be. They definitely patch into the existing ROM to add the new commands.

  • @timlocke3159
    @timlocke3159 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน

      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 4 หลายเดือนก่อน

      @@endwigast5212 Of course. Duh.

    • @endwigast5212
      @endwigast5212 4 หลายเดือนก่อน

      @@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 4 หลายเดือนก่อน

      @@endwigast5212 I would.

  • @czayas
    @czayas 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน +1

      @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  4 หลายเดือนก่อน +1

      I added a link in the description.

  • @rimmersbryggeri
    @rimmersbryggeri 4 หลายเดือนก่อน

    Is it possible to put the extended basic rom inside the computer?

    • @retrooldguy9880
      @retrooldguy9880  4 หลายเดือนก่อน

      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.

  • @me4104
    @me4104 4 หลายเดือนก่อน

    Scan-lines PLEASE!

  • @timlocke3159
    @timlocke3159 4 หลายเดือนก่อน

    How long does it take to compile each version?

    • @retrooldguy9880
      @retrooldguy9880  4 หลายเดือนก่อน

      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 2 หลายเดือนก่อน

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