DOS and ProDOS: Changing I/O Vectors

To change your I/O hooks when programming under DOS, install your I/O routine addresses in the character-out vector ($36-$37) and/or key-in vector ($38-$39); then, notify DOS (JSR $3EA) to take your addresses and swap its intercept routine addresses in.
When programming under ProDOS, leave the ProDOS BASIC Command Interpreter's intercept addresses installed in $36-$39; install your I/O addresses in the global page at $BE30-$BE33. $BE30-$BE31 should contain the output address (normally $FDF0: the monitor COUT1 routine), whereas $BE32-$BE33 should contain the input address (normally $FD1B: the monitor KEYIN routine).

Keep those vectors in a global page so the special routine (JSR $3EA) for moving the vectors won't be needed; just install your addresses at their destination yourself.
Published Date: Feb 18, 2012