Saturday, November 18, 2023

xa (xa65) 2.4.0 - finally

xa (xa65) 2.4.0 is the newest release of André Fachat's fast and portable two-pass 6502/65816 crossassembler; yours truly is the current maintainer and I just punched "live" on it tonight. It runs on Un*xy things and Windows (with Cygwin or msys2 or similar), and probably other operating systems as well. xa 2.3 has had a good run, but it's served 17 years as the minor release (no joke: 2.3.0 came out in 2006) and time marches on. There are new features to add and old cruft to sweep away. But it's still compatible with all the systems 2.3 was compatible with and adds several new features, including:

  • Listing mode, allowing side-by-side byte output with the lines in your source. You can even emit it in HTML.
  • A ca65 compatibility mode that allows many of the same pseudo-ops and "cheap local labels" support. Although this obviously doesn't accept every feature in ca65, it can ease translating your assembly source considerably — because once you switch to xa, you won't want to go back. :) This feature is also used for other compatibility options such as MASM and allowing some C-like expressions.
  • Assertions at the preprocessor level (#error) and assembly level (.assert), allowing controlled errors when static assertions are violated.
  • Linker enhancements for .o65, including deferred linking of undefined symbols.
  • You can now get the assembler major and minor version in the preprocessor with XA_MAJOR and XA_MINOR. Other predefined macros may appear in future versions.

Because this is a new minor release, there are incompatibilities. The escape character in quoted strings is now the standard backslash (\) instead of the carat (^), and recursive multi-line /* */ comments are no longer allowed, unless you ask for them with -XXA23. Obviously these features are deprecated, and they will be removed in a future version. Our expanded testsuite is designed to look for regressions and we are very conservative about that, but it's possible we've introduced other changes that may interfere with edge cases or undefined behaviour in your source, and such changes are unlikely to be reversed.

This release also deprecates printcbm(1), since it's not been touched in a long time, was never really a core part of an assembler suite, and VICE petcat does everything it did and more (even I don't use it; I have my own Perl detokenizer). It will be removed in a future version also. Of things that were already deprecated in 2.3.x, the old 16-bit argument syntax for 65816 mvn/mvp is now not accepted and the old -S and -x options are finally removed. If you need those, you must use 2.3.14.

Between 2.4.x and the next version (2.5 or 3.0, depending on my mood and the scope), we will be slowly embarking on cleaning up the source code's readability which has been an admitted issue for years. One big reason for not doing this earlier was because of regression risk and as André and I are xa's most important users, we definitely didn't want cleanup to impair our ability to build our own projects. Now that we have an extensive and growing regression testsuite, this can be done slowly in stages so that we have something more maintainable without introducing new bugs in the process or incompatibilities with the C compilers we already test against (our oldest in the test rotation is egcs-1.1.2 and it probably works on even earlier ones). As these changes are expressly intended not to change code functionality, they will incrementally roll out with future 2.4.x releases.

You can download it and read documentation in man(1) format (converted to HTML) from the main xa65 home page.

Saturday, November 11, 2023

The Apple Network Server's all-too-secret weapon (featuring PPC Toolbox)

Most of my systems are microcomputers (and commensurately sized), though I do have some moderately larger beasts: you've met homer, my 1987 HP 9000/350 rack system, and Floodgap is powered by uppsala, a 2U-in-a-tower IBM POWER6 520 running AIX. But my first "large" machine, and indeed the first Unix server I ever personally owned, was this Apple Network Server 500. Its name is stockholm.
A mini-fridge-sized server with its famous translucent blinkenlight-friendly front sliding door and oodles of drive trays, this $11,000+ box (almost $22,000 in 2023 dollars) sat forlorn and unused at the University I was employed with as an IT working stiff in 1997. The bookstore had bought it at a substantial academic discount for their UniVerse-based (a Pick descendant, now Rocket U2) point-of-sale system, but the vendor wouldn't support the hardware anymore after then-CEO Gil Amelio cancelled the ANS line, so it got dumped off as surplus in the service bay where it lurked in a corner.
As it was just sitting around, I got to use it as my personal server, shown here circa 1998 in my old office on a bad scan from a bad Polaroid. In this picture it's acting as a terminal server for my Commodore SX-64 with a CMD SwiftLink 6551 ACIA serial cartridge (the SX-64 is sitting on a parallel port switchbox because its handle got busted).

About a year later the University said they'd throw it in with my consultant compensation because they wanted to get rid of it anyway, so it became officially mine, and I was delighted to have it. That machine, later upgraded to 200MHz and 512MB of parity FPM RAM, variously powered my E-mail and the Floodgap gopher and webservers from 2000 to 2012, and still does backup duty when the POWER6 has to be down for repairs.

That's because the POWER6 runs everything the ANS did — because the ANS also runs AIX. The ANS 500 and 700 were not Apple's first Unix-specific servers (that would be the Apple Workgroup Server 95, a Quadra 950 using a special PDS card that only worked with A/UX, Apple's own Unix with a bolted-on Mac compatibility layer), but they were Apple's first Mac derivatives that could not boot classic Mac OS at all and natively ran a non-Apple operating system. Indeed, most people treated it as exactly that, a big Unix server from Apple, and at the time I did too.

However, there was a secret weapon hidden in ANS AIX most of us at the time never knew about. Built-in to the operating system was a fully Unix-native AppleTalk stack and support for receiving and sending Apple Events, surfaced in the form of Apple's disk administration tools and AppleShare. But Apple had a much more expansive vision for this feature: full server-client "symbiotic" applications that could do their number-crunching on the ANS and present the results on a desktop Mac. Using the Program-to-Program Communication Toolbox ("PPCToolbox"), and because AIX's throughput far exceeded anything the classic Mac OS ever could ever handle, an ANS could augment a whole bunch of Macs at once that didn't have to stop to do the work themselves.

Well, today we're going to write one of those "symbiotic" applications doing something this little Mystic Color Classic could never efficiently do itself — accessing and processing a JSON API over TLS 1.3 — and demonstrate not only how such an client application looked on the Mac side, but also how the server component worked on the AIX side. If you're lucky enough to have an ANS running AIX too, you can even compile and run it yourself. But before we do that, it might be a little instructive to talk about how the Apple Network Server came to run AIX in the first place.

Saturday, October 28, 2023

What the KIM-1 really needs is an LCD screen

Giving the 1976 1K RAM, 1MHz 6502-based KIM-1 single-board computer bubble memory storage was all well and good, but the basic unit is still just six numeric LEDs for its display. Let's solve that problem.
Here's a sidecar screen for my KIM-1 that's large enough to be useful, small enough to be portable, and efficient enough to be powered by my unit's built-in power supply. Plus, it can be driven by the KIM-1's unallocated I/O lines so that its 20mA current loop terminal interface remains available, with bonus points for being self-lit so you can see it like the LEDs. And the output driver takes up just 64 bytes of RAM.

Saturday, October 14, 2023

Teaching Apple Cyberdog 1.0 new tricks (featuring OpenDoc)

In the distant nethermists of time, documents once briefly ruled the earth (or at least Mac OS), and to that end I managed to find a verrry interesting book recently, complete with an unopened CD-ROM. But seriously, though: what was Apple thinking with that name?
It's not this cyberdog (image credit).
Not that cyberdog, though this is one of my favourite weirdo pinball machines.
Definitely not that cyberdog.
But thanks to all those other cyberdogs, Apple's own Cyberdog — a seemingly ordinary web browser and Internet suite with some unusual capabilities — has since slid into search engine obscurity. Apple had some big plans for it, though, and even wanted to give developers a way to develop their own components they could run inside of it. Not just plugins, either: we're talking viewers, UI elements and even entire protocol handlers, implemented using Apple's version of OpenDoc embedding.

Cyberdog's initial release belied some wild changes afoot, for in the world it inhabited, the document told the system what it needed to display, and the parts within the document displayed it. The document ruled all. The document was king.

And all of this came together in a special Cyberdog software development kit, complete with example code and the very first 1.0 release of the browser. Now that we have our PowerBook Duo 2300 rehabilitated, guess what we're gonna look at?

Sunday, October 1, 2023

Finally, an MOS 7600/7601 Video Game Array data sheet

A quick one. Many of you are aware of my rather abnormal fascination with the MOS 7600/7601, MOS Technology's dedicated "Pong-on-a-chip" (from the company that brought you my favourite CPU, the MOS 6502) that's actually a rather sophisticated microcontroller for the era. I own several 7600 systems now, including the Coleco Telstar Arcade, Radofin SC8000 and Commodore TV Games series, the Coleco Telstar Gemini and the Allied Leisure Name of the Game II. Compared with the General Instruments AY-3-8500, which was entirely hard-coded logic circuits, the MOS part has a programmable mask ROM in multiple variants and even more transistors than the 6502 itself.

The 7600 is now fairly well understood thanks to Sean Riddle's die photo, which Ken Shirriff exhaustively explored, but no one had ever found a data sheet — until earlier this summer. This data sheet is dated "Preliminary April 1976/Revision 1 June 1976," consistent with the earliest 7600 I've seen from 42nd week 1976, and gives the 7600 an official name, the Video Game Array (an unfortunate acronym collision). It specifically covers the original 7600-001 variant, an NTSC TV-compatible part that plays Pong in tennis, hockey and handball/squash/racquetball variations as well as a target practice mode, and is the variation present in most Pong consoles that used the MOS VGA. The mask ROM is explicitly stated as 512 words in size, which is read and executed by the "frame processor," acting as a combination I/O chip and CPU. The FP reads the opcodes from ROM, acquires player input, maintains the score, and sets up the display and audio output for the chip's analogue output stages.

The part that's gratifying is that the pinout and circuitry Ken and Sean independently figured out is nicely confirmed by the documentation, including the external colour support circuitry generated independently for player 1's paddle ("bat"); player 2's; and the ball, background, walls and score numbers. For even lower-cost systems, it supports a rainbow sweep system that just generates a rainbow colour pattern instead and is generated internally on-chip, though I have yet to find one of these systems myself. Interestingly, this mode requires a 3.595314MHz crystal instead of the usual NTSC colourburst frequency 3.579545MHz oscillator, which is one "line frequency" greater than the standard subcarrier (and that may be why I haven't encountered one yet, since ~3.58MHz crystals are substantially more common). It doesn't appear that the 7600 supported any other clock rates.

This data sheet confirms virtually all of our informed conjecture and fills in a few more gaps, but it appears to be missing at least two pages (between figures 4.1B and 4.6), does not have a complete pinout (only block diagrams), and since it comes from the beginning of the line naturally completely lacks a production history. We also don't know if there were pinout differences between the -001 and the later -002 through -004 variants, though this particular data sheet warns that "[f]uture games of the VGA series (MPS 7600-XXX) may make use of an expanded switch matrix ... Designers may wish to take account of this fact when producing printed circuit board layouts incorporating the VGA." The best understanding presently remains that there were only ever four game versions and Commodore, MOS' new owners that same year, discontinued production around 1978.

Friday, September 22, 2023

The W65C265SXB gets a SXY case

Don't worry — my favourite single-board computer remains the 6502-based classic MOS/Commodore KIM-1, and I've got some future projects in the works. But these were recently on sale on Amazon and I couldn't resist getting a little sort-of RPi-sized SBC that runs the 16-bit 65816, the W65C265SXB. With 32K of RAM and a flash option, plus lots of UARTs and I/O, it seemed more practical for projects than the WDC MyMENSCH even if the Mensch is a little smaller. Serial and power are provided over a single on-board USB connection and it has a built-in ROM monitor. Handy!

The big question was finding it a case, since it was inconvenient to be slapping the bare board down all the time. Here's the current solution.

Having messed with it for a couple weeks, I've decided I like a lot of things about this little bright red board, but not everything: in particular the form factor needs to keep up. Today's SBC world is all RPis and clones, and if Western Design Center reworked this to fit in RPi cases, they'd probably sell a boatload even though the product enclosure explicitly disclaims it as a consumer product. Instead its dimensions (82mm x 63mm, or a hair under 3.25" x 2.5") are just different enough to not fit well in any purpose-built SBC case I could easily find.

My first attempt was a QILIPSU (does anyone know where they come up with these brand names? Do they drop acid and play Scrabble?) junction box I found on Amazon that measured 5.1"x3.1"x2.8". The internal mounting plate is always smaller than the box, so the real measurement you care about is the distance between the mounting screws inside. This one was inexpensive and nearly a perfect fit for the SXB.

At 89mm x 68mm, the board sat almost exactly square on the plastic mounting plate and the screws could be ... coerced to go through the holes (don't tighten all the way down, you'll bend it). But I found that access to the board was highly limited: after all, this is for things sitting outside you don't want exposed to the elements. I couldn't see the LEDs and I couldn't access the pin headers without unscrewing everything and taking the top off, and the box was too deep to be comfortable working in. I sent it back.

The second attempt, and the one I'm using now, is a more expensive TICONN junction box at 5.9"x3.9"x2.8".

It has a clear lid so I could see what's going on and snap closures that were easier to get into, so I bought it. The fit of this one is not so precise; the screw holes in the mounting plate cause the board to be slightly off-centre. Although it's even deeper, it's also a little bigger, which turned out to not be a bad thing.
After deciding just to go with it, I got out a borer and drilled a hole for the USB cable to exit (and big enough for my fingers to put the cable back in if needed). This hole is dead on in the middle and the board is slightly off, though it looks fine from outside. Ideally you'd use cable glands for this but I'm not putting this unit on sprinkler or weather station duty ... yet.
Now I can see the LED(s), and if I want to hook it up to something, I just open the lid and attach jumpers. Because it's a bit wider than the other box, it turns out it's easier to work in. When I'm done, I close the lid and loop up the cable (or remove it). I'll have more to say about this fun little device later, but for now there's a nice unofficial 265SXB Guide you can read.

Saturday, September 16, 2023

The Fossil Wrist PDA becomes a tiny Gopher client (with Overbite Palm 0.3)

I don't always often wear watches. But when I do, I prefer Palm PDAs. Wired to my wrist.
Announced at COMDEX in 2001 but infamously stalled, cancelled and revived prior to release in January 2005, it's still not much bigger than my wife's Apple watch:
The opinion of reviewers at the time was something like "nice try anyway." Battery estimates were overoptimistic, some buttons were missing, and the CPU and operating system were already outdated. Nevertheless, it was a real Palm OS PDA that could sync to your desktop and run real Palm OS applications, complete with a tiny screen and a ludicrously tiny stylus.

But little was said at the time about connectivity and networking. It could IR-beam (consuming the battery) and sync, but other than muted complaints about missing Bluetooth (which would have consumed even more battery), no one said anything one way or the other about getting it on the Internet. And I'm all about Palm devices on the Internet.

It turns out there's a reason for that, and we're going to patch the operating system so we can make the Fossil Wrist PDA into what may be the smallest (and first wrist-mounted) Gopher client. That also required an update to the Overbite Palm Gopher client (which you'll want for your 68K Palm anyway), and then there's the matter of the battery refusing to charge as well. And finally, we want to make all of this portable!

But let's start with the history first ...