!lm12
!rm76
Serious Problem in Apple DOS..............Bob Sander-Cederlof

If you are trying to use the IRQ interrupt line for any purpose, and also DOS, you may have run across this problem before.  Apparently at random, for no good reason, you may get the NO BUFFERS AVAILABLE message.

The reason is that both DOS and the IRQ interrupt code are trying to use the same page zero location: $0045.  DOS uses this location as part of a pointer address when looking for the next available buffer.  (See the code at $A2CB-A2CF and $A764-A780.)  DOS also uses $0045 when printing the catalog (see $ADB9, $AE09, and $AE53).

The IRQ interrupt code in the Apple Monitor ROM (at $FA86) uses $0045 to save the contents of the A-register.  If an interrupt occurs while DOS is in the process of looking for a buffer, POW!

One solution is to turn off interrupts whenever DOS may be active, using the SEI opcode.  A better solution would be quite difficult:  look through all of DOS and modify every reference to $0045 (or to $0044 and $0045 as a pair) to use some other location in page zero.  A third possible solution for those who can do it is to modify the Apple Monitor ROM to use some other location to save the A-register.

In case you ARE using interrupts and DOS together, you should also know that RWTS does inhibit interrupts while it is active.  After a call to RWTS is complete, the interrupt-inhibit status is restored to whatever it was before the call.  Interrupts cannot be allowed during RWTS, because of the critical software timing code involved in reading and writing the disk.
