在MS-DOS上调用5接口 [英] Call 5 interface on MS-DOS

查看:113
本文介绍了在MS-DOS上调用5接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MS-DOS的Hello,World程序,它使用int 21h进行系统调用.

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"是字符串'hello,world',13,10,'$'的地址.

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

该程序有效.

但是,当我用"call 5"替换(第一个)"int 0x21"时,程序使计算机崩溃(即运行PTS-DOS的VirtualBox虚拟机).在DOSbox上,它只是终止并返回到命令提示符.

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.

现在我想知道...

  1. 更高版本的DOS是否不再支持CP/M兼容性调用5接口?
  2. PTS-DOS和DOSbox中的DOS不支持呼叫5吗?
  3. 我使用的界面错误吗?
  4. 我必须首先配置段寄存器吗? (我尝试将所有段寄存器设置为零.)

有什么想法吗?

更新:我接受了答案,因为根据文档它是正确的.它仍然不起作用,但这可能是由于我的DOS版本或其他问题所致.

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.

推荐答案

是否有一个DOS版本,您实际上已经在其中看到过CP/M呼叫5"的工作?我从DOS 2.1开始,但是确实为1.1编写了一些代码,而我看到的唯一CP/M兼容性是在FCB中.当然,我并没有明确地寻找它,但是我不记得有人称呼叫5"被任何人支持...

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...

跟进:

最新的PSP定义(在Web上列出,因此YMMV)确实具有受支持的呼叫5"接口.任何真正的DOS兼容环境 都应支持它.

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.

这篇关于在MS-DOS上调用5接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆