Qbasicnews.com

Full Version: CALL ABSOLUTE for XMS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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:

Code:
XMSdriver& = CVL(MKI$(RegsX.bx) + MKI$(RegsX.es))
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:
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
I converted this to raw hex assembly (machinecode) using debug. I put it into a variable ASM$ and I did this:
Code:
DEF SEG = VARSEG(ASM$)
CALL ABSOLUTE (Version%, XMSdriver&, SADD(ASM$))
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?
why do u need to use call absolute? why not use call interrupt?

i am intrested in your XMS module. i wanted to store strings in xms. can you module do that right now?
I have only one routines completed yet, which is to detect if there is XMS present.

However... can someone point out to me how to call the XMS Driver within QB? Can it be done with CALL INTERRUPT or do I need CALL ABSOLUTE for it? In asm I can do it with the call routine, but how is this done in QB?
relsoft should know what I'm talking about, he called this XMS Driver in his XMS module 'XMSDUDE' Wink

Please answer this question, so that I can go on scripting my XMS module!
relsoft? Jark? Sterling? Plasma? Anyone?
Well I have seen many progs which use call interrupt but same progs can be done using call absolute. For example the mouse routines can be implemented using both call interrupt as well as call absolute.
I think call interrupt is slower than call absolute but not too sure =|
I know. I have scripted Mouse Modules, Keyboard Modules, EMS Modules, EMSLayer Modules, Palette Modules, etc. etc myself.

Both can be done with Interrupt, as well as Absolute.

But this is something different (XMS), there is an XMSdriver somewhere in memory and I need to call it. I know the driver location, and in asm I could do something like this:

Code:
dd XMSdude ?
mov [XMSdude], bx
mov [XMSdude+2], es
xor ax,ax
call [XMSdude]

But how to do this in QB? With INTERRUPT or ABSOLUTE? I tried with ABSOLUTE, but it doesn't work somehow, anyone knows?
Smoky(one of the creators of FL) may be able to help you out.
Can you bring him into contact with me?

Or are there people HERE who know the answer to my problem? :roll:
I hope so. relsoft? Jark? Sterling? Anyone?
I have seen him around on qb45.com's forum. But i dunno whether he still is around. He is registered with this site but there are only 3 posts by him and unfortunately no contact info =(

I'll see if I can find his email =)
Neo: I would think you would need a shared Typed Var for the XMS manager then pass the address via Varseg and Varptr if you want to do it via Call Absolute. Didn't try it though. ;*)

Something like.

Type XmsDude
Blah as Long
Leng as long
End type

then
Xms.Leng=64000

Call Absolute Varseg(Xms),Varptr(Xms)

Can't remember the exact struc of the XMS manager. the one you call to move bytes between XMS and base.
Can you tell me how to set up the ASM code for the CALL ABSOLUTE then?
Pages: 1 2