Much like its predecessors, IBM DOS 5.0 has no trouble running on clone systems, as long as they’re sufficiently compatible. That includes virtual machines. However, the QBASIC.EXE (and consequently EDIT.COM) program dated May 9, 1991 consistently hangs on any non-IBM system. Why is that?
Analysis shows that the key is the presence (or absence) of ROM BASIC, which was built into the ROM of all IBM PC systems (including PS/2) from the very first PCs until approximately 1991, sometime after IBM DOS 5.0 was released. But why does QBASIC care when it’s supposed to replace the ROM BASIC anyway?
Disassembly shows that during startup, the IBM version of QBASIC.EXE calls INT 15h, sub-function 22h to query the ROM BASIC location. If the call fails, as it will on older IBM systems, the traditional ROM BASIC location of F600:0000 is assumed. That will also happen on clone systems which do not support the INT 15h, sub-function 22h call.
What IBM’s QBASIC.EXE does next is rather unusual. It runs through a few hundred bytes (780 bytes to be exact) at the beginning of the ROM BASIC and uses the data to XOR code within the QBASIC.EXE executable itself. There appears to be no other use for the ROM BASIC.
In other words, the ROM BASIC simply acts as a key to unlock QBASIC.EXE. IBM’s QBASIC does not need it, but requires it and will deliberately crash without it.
This may have been a form of copy protection, to prevent running on non-IBM systems (which IBM DOS 5.0 did not officially support). Or it may have been a licensing requirement from Microsoft’s side; since IBM was already licensing the ROM BASIC from Microsoft, it is possible that the license fee for QBASIC was less than what other OEMs had to pay.
IBM DOS 5.00.1 changed the situation. Since that version, IBM officially supported selected non-IBM systems, and requiring the ROM BASIC even as a licensing check no longer made any sense. The “decryption” code was removed from QBASIC.EXE and IBM’s QBASIC happily ran on non-IBM computers. Around the same time, IBM also removed ROM BASIC from its own systems.
It should be possible to “unlock” the original IBM version of QBASIC, or write a simple TSR which intercepts INT 15h, sub-function 22h and points to the first 800 or so bytes of the IBM ROM BASIC image. However, it’s much easier to simply use a newer QBASIC executable.