I didn't know! investigation about to lunch.
I'm not sure this is what you want, but with defines/macros you can do something like this:
speedX = d7
speedY = d3
accX = a0
accY = d5
addq.w #1, speedX
movem.w speedX/speedY/accX/accY, -(sp)
With macros you can do something like this:
.macro SetSpeed direction, speedX
addq.w #1, \speedX
addq.w #-1, \speedX
where the symbol "\@" is a value unique for every instance of any macro.
Also labels with only numbers are special since can be reused unlimited times. Then when there is a jump it references to the closest one, which can be very dangerous if there are macros in between.
In the next example:
the second "1:" is the one referenced. While in this one:
is the 3rd one.
You can use macros to simplify and create structures in a C fashion too. Or even a C++ parental structure, do is more complex.Chilly Willy wrote: ↑Fri Apr 24, 2020 12:02 pmIt doesn't require using .S, but if you don't, you'll have to invoke the preprocessor manually from the makefile. It's easier to just use the .S extension and then go to town with #define and whatnot. That's what the .S does - signal gcc that it should automatically invoke the preprocessor before invoking the assembler.
Perhaps the handiest thing about being able to use the preprocessor is defining structures in the regular C manner. Defining structs in assembly is always more of a hassle.