To anyone who programs for the Motorola 68000, what is your favorite cross-assembler that works well on a Linux host pc?
To anyone who programs for the Motorola 68000, what is your favorite cross-assembler that works well on a Linux host pc?
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.
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.
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.)