'Getting MS-DOS SMARTDrive version from interrupt call 2F/AX=4A10h/BX=0000h
I'm trying to write an assembly procedure to get the SMARTDrive version on a given system. The code to detect if SMARTDrive is loaded works correctly, but I can't seem to get the version from the Base Pointer (BP) register. My compiler, Digital Mars, doesn't seem to support the BP register in the REGS structure of DOS.H, so I can't use regs.x.bp.
I'm using Ralph Brown's Interrupt List as a guide, located here: http://www.ctyme.com/intr/rb-4822.htm
Here's the code I'm working with:
.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
This should return the version in the AX register, but when I run this code it hangs my system. I'm not really sure how to access the data in the BP register without locking up the system. Does anyone else have experience on how to do this correctly? Is there a better way to accomplish this? Any help is greatly appreciated!
Solution 1:[1]
switching the line mov ax, dword ptr [bp]
to mov ax, bp
worked. Thanks to @ecm for the assistance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Charlie Dobson |