已解决! 转到解答。
It's usually possible to find ISR-friendly solutions that do not require interrupts to be disabled. For example, you don't have to use a variable for counter. Instead you can do this:
LDAB #$80
GET_DIP_LP ROLA
RORB
BCC GET_DIP_LP
COMB
ANDB #$3F
STAB INP1_TMPRegister B is initially loaded with Bit7 ($80) which, as it gets shifted to the right, it will eventually (after exactly 8 shifts) end up in the CCR[C]. You can check for this to control your loop.
That way you only write the final result into INP1_TMP (once, in one atomic operation).