Here is the source for the BDOS of MP/M v1.1. This is disassembled code, but is commented pretty well.