11-01-2003, 07:38 PM
Hello there everyone,
I was busy scripting an XMS module in QB, when I found a problem.
The first part (to detect if there is a XMS driver) was easy: i just called int 2Fh with ax=4300h and if al was 80h there was one. But next... I called int 2F with ax=4310h to get the XMS driver location. (stored in es:bx). I stored this in a variable like this:
1st point: is this the right thing to do, considering Intel's backwards notation?
Then I want to execute a routine using the XMSdriver, e.g. retrieve the XMS version, with ax=0. In ASM, I would do it like this:
But how do I do something like this in QB? I couldn't find any interrupt routine which was able to call a memory procedure with arguments, so I turned to CALL ABSOLUTE. I wrote an assembly program like this:
I converted this to raw hex assembly (machinecode) using debug. I put it into a variable ASM$ and I did this:
I hoped it would return the XMS version in Version%, but it either says it couldn't open COM3 or crashes completely.
What am I doing wrong here? Can anyone tell me please?
I was busy scripting an XMS module in QB, when I found a problem.
The first part (to detect if there is a XMS driver) was easy: i just called int 2Fh with ax=4300h and if al was 80h there was one. But next... I called int 2F with ax=4310h to get the XMS driver location. (stored in es:bx). I stored this in a variable like this:
Code:
XMSdriver& = CVL(MKI$(RegsX.bx) + MKI$(RegsX.es))
Then I want to execute a routine using the XMSdriver, e.g. retrieve the XMS version, with ax=0. In ASM, I would do it like this:
Code:
mov ax, 0
call [XMSdriver]
But how do I do something like this in QB? I couldn't find any interrupt routine which was able to call a memory procedure with arguments, so I turned to CALL ABSOLUTE. I wrote an assembly program like this:
Code:
; STACK LAYOUT
; 0: IP (word)
; 2: CP (word)
; 4: XMSdriver (dword)
; 8: Version (word)
push bp
mov bp, sp
mov ax, 0
call [bp+4]
mov word ptr [bp+8], ax
pop bp
ret 6
Code:
DEF SEG = VARSEG(ASM$)
CALL ABSOLUTE (Version%, XMSdriver&, SADD(ASM$))
What am I doing wrong here? Can anyone tell me please?