从中断调用2F/AX=4A10h/BX=0000h获取MS-DOS SMARTDrive版本



我正试图编写一个汇编过程,以获得给定系统上的SMARTDrive版本。检测SMARTDrive是否加载的代码正常工作,但我似乎无法从基本指针(BP)寄存器获得版本。我的编译器,Digital Mars,似乎不支持DOS.H的REGS结构中的BP寄存器,所以我不能使用REGS . x.p .

我使用Ralph Brown的中断列表作为指南,位于这里:http://www.ctyme.com/intr/rb-4822.htm

下面是我正在使用的代码:

.MODEL Large, C
PUBLIC _get_smartdrive_version
_get_smartdrive_version proc
cli
mov ax, 4A10h
mov bx, 0000h
mov cx, 0EBABh
int 2Fh
cmp ax, 0BABEh          ; verify SMARTDrive signature
jne no_smartdrv
xor ax, ax              ; probably not needed
mov ax, dword ptr [bp]  ; (note also tried without dword ptr, and with es:[bp])
jmp done
no_smartdrv:
mov ax, 0
done:
sti
ret
_get_smartdrive_version endp
end
这个<<p> strong> 返回AX寄存器中的版本,但是当我运行此代码时,它会挂起我的系统。我不太确定如何在不锁定系统的情况下访问BP寄存器中的数据。还有谁有正确操作的经验吗?有没有更好的方法来做到这一点?任何帮助都非常感谢!

换行:

mov ax, dword ptr [bp]

:

mov ax, bp

最新更新