And I found one issue with the code above. In the exit macro, you only need to use move.w #0x2700, SR rather then the STLDSR instruction, which pops the SR to the stack and confuses the compiler. There is no need to save the status register at this point (that I've though of, anyways...)