Thanks to all who answered for the help! U. v. Bassewitz wrote:
The builtin inline assembler is not a full featured assembler, therefore control commands (like .align) aren't accepted. A second reason is that the inline assembler code is processed by the the optimizer, and handling control commands in this stage would be too complex.
Being processed by the optimizer pretty much rules out using inline assembly I fear, since the Apple disk controller wants to receive a byte exactly every 32 cycles; one more or less and it won't work. So any kind of optimization or reorganization would destroy the functionality.
So I guess I'll use a separate assembly file and .align my code that way. There's no need to call any functions from the write code, it's just a simple loop that dumps memory locations' contents to the write register. And now that I know how parameter passing works, it should be easy enough.
One more thing, on the Apple many hardware funktions are activated by accessing certain addresses. It's only the access that matters, the data read or written is irrelevant. But when I use peekpoke.h and say something like "PEEK(0xC030);" without using the result for anything, it gets optimized away. I've settled on "*((char *)0xC030) = __AX__;", which gives a "pure" store, storing whatever is currently in A; but this is problematic for some addresses, since the 6502 accesses an address twice during a write. Some of these "softswitches" are toggle switches, so you need to read them, which produces only one access; writing them toggles them back and forth instead.
Is there any way to get a "pure" load, i.e. make the compiler emit just an LDA (or a BIT, or whatever) but to ignore the result? I mean without resorting to inline assembly. I tried to do it with "volatile" but that doesn't seem to have any effect.
(No need to answer this rather peculiar request, unless you feel like answering. I know I can just store the result to some temporary variable and forget about it, it's more or less a question on whether it's possible.)
-- Linards Ticmanis