To anyone who programs for the Motorola 68000, what is your favorite cross-assembler that works well on a Linux host pc?

#retrocomputing #motorola68000

Update: I forgot to mention that I'm targeting TI-89/TI-92+. From my research, it seems this locks me into using (tigcc or gcc4ti)/A68k, specifically because of the linking step. The underlying calculator platform has a not-entirely-trivial binary loader that may perform relocations, so symbol information must be exposed in a way it can understand.

I spent the better part of an evening trying to build a toolchain old enough to bootstrap gcc 4.1.2, without success. Good thing TIGCC's binary packages from 2006 (!) still work on a modern x86-64 linux system.

Anyway, here is hello world. It's in C not assembly, but I think that's enough progress for one night.

#TiCalc #ti92

Hello world in assembly doesn't look much different, but you don't wanna know how many times I crashed my emulator trying (and failing) to shave a few bytes off the example program I found.

Against all judgment and taste, I am using gnu as, which is one of the two assemblers that comes tightly integrated into TIGCC. (The other is A68K, whose syntax is not meaningfully different). This means I'm saddled with AT&T syntax. and boy is that not how my brain works.

#TiCalc #ti92

As is becoming usual, when I don't understand what a new platform is doing, I reach for #ghidra first and ask questions later.

It has revealed the "save/restore screen" code emitted by TIGCC, as well as some hardware/OS version checks that I didn't know were there. That explains why my Hello World binary was larger than expected.

Further, it confirms that absolute addresses are stored as all-zeros, to be fixed up later (at program launch?) by the calculator OS's internal relocating-loader. (There is some mysterious binary junk at the end of the executable that looks like it might be a table involves somehow in these fixup's.)

#TiCalc #ti92

@psf The "relocate-on-load" thing has typically done to work-round the lack of an MMU. Idris (a portable contemporary workalike of 6th Edition UNIX) did things that way in 1978 so that it could run on smaller PDP-11 systems than Bell UNIX, such as the LSI-11 and PDP-11/23.