Search code examples
assemblysystem-callsdos

Call 5 interface on MS-DOS


I have a Hello, World program for MS-DOS that uses int 21h to make system calls.

mov dx,hello
mov ah,9
int 0x21
mov ah,0
int 0x21

"hello" is the address of the string 'hello, world',13,10,'$'.

The program works.

However, when I replace (the first) "int 0x21" with "call 5", the program crashes the computer (i.e. the VirtualBox virtual machine running PTS-DOS). On DOSbox it simply terminates and returns to the command prompt.

I tried using different registers for the address and the call number but always got the same result.

Now I am wondering...

  1. Do later versions of DOS not support the CP/M compatibility call 5 interface any more?
  2. Do PTS-DOS and the DOS in DOSbox not support call 5?
  3. Am I using the interface wrong?
  4. Do I have to configure the segment registers first? (I tried setting all segment registers to zero.)

Any ideas?

Update: I accepted the answer because it is correct as per documentation. It still doesn't work but that might be due to my version of DOS or some other problem.


Solution

  • Is there a version of DOS where you've actually seen a CP/M "call 5" work? I started with DOS 2.1, but did write some code for 1.1 and the only CP/M compatibility that I saw was in the FCBs. Of course, I wasn't explicitly looking for it, but I don't recall "call 5" being reported as supported by anybody...

    Followup:

    The latest PSP definition (as listed on the web, so YMMV) does indeed have the "call 5" interface as supported. Any true DOS compatible environment should support it.