ChibiAkumas’ Many Assembly Tutorials

You wanna know something? I think everyone should learn to program. I don’t mean using some, the word I usually use is cockamamie, “AI,” that will produce brittle, inefficient, unmaintainable code if it doesn’t mess it up, but actually code. I think most of the difficulty with coding is actually in the languages. Woe betide the person trying to learn to program in C++ from scratch these days. C is much better, but still obtuse. Python is better, but also not great for systems or performance work.

The solution? Why, learn to code in assembly of course!

Aaaaand 90% of readers just clicked away. Hah.

Image

But the funny thing is, for many languages, assembly is actually a little easier than them I’d say. When you’re working directly with the hardware, all the weird abstractions you have to learn fall away. It does mean you have to do everything, and I mean everything, yourself. But on the other hand, programming is largely the process of connecting building blocks together, tiny routines comprising larger ones. It takes longer to do it in assembly, and working with a lot of current-day hardware is trickier because you have to jump through more hoops to use it. But its difficulty, I think anyway, is a little overblown.

Have my farcical words somehow swayed you? Does it sound like something you might like to try? Would you at least like to see what you’d be in for? Then I have a website for you: ChibiAkuma’s Assembly Tutorials. They also have Youtube channel.

There’s a wealth of material to peruse, including videos walking you through coding a bunch of different architectures, including 6502, 8086, Z80, 6809, 68000, and even ARM, among others. Even if you have no interest in actually coding for these multifarious* chips, just knowing out they work may be very interesting to you, if not be actually useful someday.

Here, to get some idea of how understandable this will be to you, take a look at his series on assembly coding for the C64 (Youtube playlist, 13 videos, about 170 minutes in all), beginning here:

* That’s 17 points with no bonuses, but 67 if a bingo

ChibiAkuma’s Assembly Tutorials (chibiakumas.com)

Chipwits Remake Released

Some time ago on Game Developer I did an interview with the creator of the classic Mac, Apple II and C64 programming game Chipwits, who were working on a modernized version. Well their efforts have been released to the public now: Chipwits 1.0 is now out on Steam!

Image

You devise programs using a graphic interface to get a robot character through a maze-like grid world to do various things. The original Chipwits was written for the original Mac, in Forth, with ports for different machines of the time. The new game has a nice tutorial as well as new scenarios, in addition to the scenarios that came with the original game.

Image

The thing I like about Chipwits is, it isn’t always about solving specific puzzles. Many of the maps are open-ended. The robots have a limited amount of fuel, which translates into machine cycles to run your programs. Additional fuel can be replenished by objects found in their exploration, as well as objects worth score, but the objects are frequently randomly placed. These scenarios aren’t about tailoring a program to a specific placement objects, but devising a more generalized exploration routine that can adapt to a variety of placements. There are online leaderboards so you can see how your coding skill compares with that of other players.

Chipwits usually goes for $15, but for launch is currently 10% off on Steam. (Disclaimer: I interviewed the Chipwits people for Game Developer previously, and did a little beta testing, but I bought my own copy of the game for these screenshots. They deserve the money!)

Famicom Family BASIC

I love BASIC! I don’t make a secret of it. It was the product, even before DOS, that launched Microsoft. It was invented to be the language to bring programming to the masses, and, for a short time, it fulfilled that function. (These days, if you want to learn coding, I suggest Python. Not only is it a lot more capable and modern, but you can actually get a job writing it.)

Used to be if you had a new computer you wanted families to buy, you had to have a version of BASIC to ship with it. The Apple II had two, one written by Steve Wozniak himself. Right off the top of my head, computer systems with BASIC, go! Altair, Apple II, Commodore Pet, Vic-20, 64, 128, Plus-4, 16, Atari 8-bit, TRS-80, MS-DOS, Windows (Visual BASIC carried the torch for many years), and, most improbably, the Atari VCS/2600, in its BASIC Programming cartridge, an effectively useless cart for its stated purpose that’s nonetheless an excellent hack. The machine has 128 bytes of RAM, but it can still run BASIC, by jove.

The Famicom has a version of BASIC too, coming in at the end of the language’s heyday. Over on the Peertube instance diode.zone, user RE:Enthused did a two-part introduction to it that may be of interested to people who still think in terms of FOR/NEXT loops.

Let’s look at Family Basic on the Famicom, Part 1 (8 minutes) and Part 2 (17 minutes).

Commodore Basic 2.0 for Other Systems

Say what you will about Commodore BASIC 2.0, the built-in programming language and makeshift shell for the Commodore 64, written by Microsoft employees and descending from code written by Bill Gates himself, it’s certainly, um, basic. Nearly everything that takes advantage of that machine’s graphics or sound features involves POKEing values into memory at various locations, requiring a programmer to memorize a long list of important numbers.

Because it doesn’t interface with the system’s unique features to any great extent, it’s a very generic version of BASIC. But this means it can be ported to other systems without tremendous effort. Fancy-pants commands don’t have to be converted to another architecture’s norms, because there aren’t any! And lots of systems used the instruction set and general capabilities of the MOS 6502, upon which the Commodore 64 is based, so now we have versions of its BASIC that work on the Nintendo Entertainment System and the Atari 800. They’re both based off of Project 64, an annotated disassembly of the C64’s BASIC and Kernal ROM code.

The NES port should be able to run on actual hardware, but you’ll need the Family Keyboard that was made to work with the Famicom’s own official BASIC to use it, which was only released in Japan.

By the way, the reason that I write BASIC in all-caps is, it’s an acronym! It stands for Beginners’ All-purpose Symbolic Instruction Code.