My Rambling Thoughts

A brief history of GW-BASIC

BASIC stands for Beginners' All-purpose Symbolic Instruction Code. But what does GW stand for? Although it is probably someone's initials, the semi-authoritative answer from Microsoft is Gee-Whiz.

DateVerSizeMS-DOS
19832.0080,8962.00
19863.2078,8643.20
19873.2280,5923.30
19883.2380,6084.00

These are generic versions from Microsoft. (Unsure about 2.00.)

The first version is 2.00, released with MS-DOS 2.00. The predecessor of GW-BASIC is BASIC-86.

3.20 supports EGA graphics modes (screen 7 to 10). None supports VGA graphics mode.

It is easy to find 3.23, the last version. Earlier versions are rarer. It is not known what's the difference between them. Judging by the file size, there should not be much difference.

Microsoft open-sourced GW-BASIC in May 2020. It is the first version from 1983.

The open-sourced code is 8086 assembly code. It is generated from a master meta-assembly source (not open-sourced) that can be cross-assembled for several CPU architectures. This should be from earlier BASIC that is ported to 6502 and Z80 (among others). I'm not aware of GW-BASIC on anything other than the IBM PC.

os2museum managed to assemble the code (only works with MASM 1.06) and got a size of ~50 kB. He found two close matches, one older and one newer. The newer one was 55.5 kiB and was version 1.20. It had over 6,000 bytes of OEM code.

GW-BASIC 2.00 at 80 kB is pretty large, considering it is written in assembly language. Granted, it is not optimized assembly (since it is translated from a meta-assembly source), but 80 kB is still large.

To reduce run-time code footprint, GW-BASIC could have been modularized: graphics, high-level graphics (LINE, CIRCLE, PAINT, DRAW), floating point math (single, double precision), high-level math functions (SIN, COS, TAN) and even the interactive editor.

But it does not really matter because GW-BASIC programs are "tiny": the code, data and stack fit in one 64 kiB segment.

Soft limits

To run bigger programs, they can be split into parts and CHAIN'ed together. This is effectively the overlay technique.

GW-BASIC supports calling subroutines written in machine code. They can be outside of GW-BASIC 64 kiB memory — by running a TSR (Terminate-and-Stay-Resident) beforehand. They can add new functionality missing in GW-BASIC. They are also blazing fast — so don't complain GW-BASIC is slow! :lol:

Unfortunately, this technique is extremely unportable.

GW-BASIC supports only 16-bit integers. This is a big limitation. Single-precision floating point numbers has 23-bit significand (and 1 sign bit), so they can be used as 24-bit integers. This is usually sufficient.

Hard limits

GW-BASIC has some limitations that are difficult to work around:

  • Only near arrays (arrays can be very large)
  • Strings can only be up to 255 in length (not an issue usually)
  • Only near strings (another big memory user)

Old school Gundam model


RX-78-2 1/144 Best Mecha Collection Revival

Coming Oct 2024, 1,320 yen (S$11.50).

Bandai Spirits has announced a magnificent rebirth to mark the 45th anniversary of both the iconic Gundam series and the GunPla model kit. Fans of the franchise may be interested in the revival of the 1980s RX-78-2 Gundam model kit under the "Best Mecha Collection" GunPla lineup, which has been updated to meet the needs of modern builders. This time it requires no glue, paint, or tools to assemble, as opposed to the original version, which required all three.

Color me interested... until I realize the legs are not very articulated. Basically it can only be in a standing/walking pose.

Pilot Juice them Up!

I have used Pilot G-Tec-C4 pens for a long time. However, I switched to Pilot Juice Up 04 last year.

I originally bought this pen for my son. I decided that G-Tec-C4 was too fragile for him. But this pen worked so well that I ended up using it for myself. One downside is that the ink does not seem to last long. The pen casing is robust and can last 3 or more refills.

Prior to this, I let my son use Pilot Juice 5. I started with the 0.38mm version and it seemed to spoil easily. 0.5mm worked well.

Juice 5 was okay, but Juice Up 04 was better — and looked more classy. :lol:

FansToys Ultra Magnus is eye-catching

I said I was not going to buy FansToys Ultra Magnus and probably not their Optimus Prime either.

I'm going to take that back. They look so gorgeous!

I already have four Optimus Prime. Looks like I'll have a fifth. :lol:

FansToys Ultra Magnus (Margh), despite being a white Optimus Prime wearing armour, does not look blocky at all.

I almost got XTB Ultra Magnus (Commander Stack) previously — it was an impressive figure too — but its arms were rather long.

I sold my MP-22, but got THF-04 (KO of MP-22). I'm wondering to keep it or sell it.

But I have to be careful. FansToys is master at photography. Some of their products look fantastic in photos, but turn out to have some limitations in actual products.

Last upgrader to Ubuntu 22.04

Why do my HDDs like to fail in March? Ubuntu 24.04 is coming out next month. This means I got to install 22.04, then upgrade to 24.04.

It was the same case 12 years ago — I had to install 10.04 and then upgrade to 12.04 later.

My file server was "stuck" at 18.04 because I started with 12.04 and at that time, while 64-bit OS exist, I expected them to co-exist "forever" and I could just use 32-bit with PAE. I also didn't expect to use more than 4 GB of memory.

But the switch flipped around 2015. Every major OS started to obsolete their 32-bit version. Ubuntu 18.04 would be the last 32-bit version — with no upgrade path.

Since U18.04 would be supported for 5 years, I could put off upgrading until 23.04. That time had come and gone.

There is a tutorial to convert 32-bit Ubuntu to 64-bit. I thought of trying it on a cloned HDD, but never did.

I always put off installing from scratch because of the additional setup I needed to do. Now that my HDD died, I no longer have a choice. It turns out my worries were overblown.

As usual, I installed the server-only edition, then ubuntu-desktop. However, this time I forgot to use the --no-install-recommends parameter.

After that:

  • Installed VNC. vncserver no longer exists, I use TigerVNC instead.
  • Installed samba. The existing conf files can be used almost as-is.
  • Installed apache2. Enable ssl and rewrite. The existing conf files can be used as-is.
  • Installed PHP (now 8.1.2) and extensions (php-curl, php-gd, php-mbstring, php-sqlite3, php-xml).
  • Installed SVN. The existing conf files can be used as-is. The existing SVN repos appear to work as-is (after changing its user and group id).
  • Installed Deluge (bittorrent). Copied .config/deluge. The torrents don't show up. It turns out U18.04 is using Deluge 1.3.15, U22.04 is using 2.0.3. Deluge 1.3 torrent.state file must be converted to 2.0 format. Luckily someone provided a Python script online.
  • Thunderbird is working fine once I copied .thunderbird.
  • Fixed the Ethernet network name as eth0.
  • Enable crontab one by one after checking they still work.
  • And some minor touchups.

It's easier than I expected.

Versions of key packages:

PackageU18.04U22.04U24.04
Apache22.4.292.4.522.4.58
Curl7.58.07.81.08.5.0
Deluge1.3.152.0.32.1.2
Firefox59.0.2snapsnap
PHP7.2.108.1.28.3
Samba2:4.7.62:4.15.132:4.19.5
SSH1:7.61:8.91:9.6
SVN1.9.71.14.11.14.3
Thunderbird1:52.7.01:91.8.0snap
Tiger VNC1.10.11.12.01.13.1

Using snapped version is Ubuntu's new strategy to keep frequently updated apps (with large dependencies) up-to-date.