HansO posted while I was writing, but I'll post this anyway, along those lines.
I don't call it compiling, but it bears some resemblance when you have things like this piece from my
article on simple methods to do multitasking without a multitasking OS:
Code:
WATCH_ACIA:
LDA RX_STATE
CASE ACCUM
CASE_OF 0 ; In the case of RX_STATE being 0, an $FF is required to increment it to 1.
IF_BIT ACIA_STAT_REG, 3, IS_SET ; If a byte came in (indicated by bit 3 of the status register),
LDA ACIA_DATA_REG ; get it (this clears the flag in the status register too),
CMP #$FF ; and see if it's $FF.
IF_EQ ; If it is,
INC RX_STATE ; move on to watch for a valid (non-$FF) first byte.
END_IF ; The $FF gets discarded.
END_IF ; If no byte came in, just exit.
END_OF
CASE_OF 1 ; To get here, we've received the $FF marker and we're looking for a valid 1st byte.
IF_BIT ACIA_STAT_REG, 3, IS_SET ; If a byte came in,
LDA ACIA_DATA_REG ; get it,
IF_PLUS ; see if it's valid as a high byte, ie, that the high bit is clear, and if so,
STA READING_BUF ; store it as valid in the buffer area meant to prevent wrong readings between bytes,
INC RX_STATE ; and move on to watch for the 2nd byte which could be anything.
END_IF ; If it's not a valid high byte, just discard it, and leave RX_STATE as is.
END_IF ; If no byte came in, just exit.
END_OF
; In the case of RX_STATE being 2, we've gotten the high byte of READING,
CASE_OF 2 ; and we're waiting for the second byte which could be anything.
IF_BIT ACIA_STAT_REG, 3, IS_SET ; See if a byte came in. If one did,
COPY VIA_SR, TO, READING ; just transfer it
COPY READING_BUF, TO, READING+1 ; (including the high byte now, which we had saved to prevent glitches
STZ RX_STATE ; in the two-byte READING value), and go back to state 0.
END_IF ; If no byte came in, just exit.
END_OF
STZ RX_STATE ; If there's any chance for state to go invalid, just reset it and start over.
END_CASE
RTS
;---------------------------------------
because there's stuff going on in the assembler that makes for interaction between the macros to make the program structures. Lines are not autonomous like they are in normal assembly language.
Although I've never called assembling compiling, the subject becomes interesting now that you've brought it up.