August 6, 2025

Sun 3 bootrom souce - inline assembly

I am working on the file sun3/machdep.c

It has some inline assembly from the days of the sun C compiler, which will never work with gcc. Though I am tempted to just code it in assembly and be done with it, it would be a challenge to use the inline assembly feature of gcc to handle this.

GCC inline assembly has always been pretty esoteric. I have used it with success for ARM projects, but have never done anything serious with it for m68k. Apparently the day has come!

I have some notes on this (mostly for the ARM) from 2016. I am going to use this little project to add some notes specific to the m68k to the end of this document:

I will note here that I find experimentation to be essential I use objdump to see the result the compiler generates.

Here is an interesting article:

Note this:
#define barrier() __asm__ __volatile__("": : :"memory")

Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org