Category : C++ Source Code
Archive   : VMVCPP.ZIP
Filename : XMS.ASM
include xms.inc
.data?
pfnXms dd 1 dup (?)
.code XMS_TEXT
public __ErrXmsCall
__ErrXmsCall proc near
assume ds:nothing
call [pfnXms] ;AX = 0 and BL < 0 if error
or ax,ax
jnz Exit ;Brif no error
or bl,bl
jns Exit ;Brif no error
mov al,bl ;AL = Error code
cbw ;AH = 00 or FF
add ax,errXmsBase-0FF80h ;Map to ERR value
;This add instruction also sets the carray flag
Exit:
ret
__ErrXmsCall endp
;BOOL PUBLIC __FXmsCheckInstalled(void);
public __FXmsCheckInstalled
__FXmsCheckInstalled proc
assume ds:@data
mov ax,4300h
int 2fh
cmp al,80h ;Is driver installed?
jne NoXms ;Brif not
mov ax,4310h
int 2fh ;ES:BX = XMS control function
mov word ptr [pfnXms],bx
mov word ptr [pfnXms+2],es
xor ax,ax ;AH = 00h (Get XMS Version Number)
call [pfnXms] ;AX = XMS Version
cmp ax,0200h ;Is this version 2.00 or better
jae Exit ;Brif so, AX != 0. Returning TRUE
NoXms:
xor ax,ax ;Return FALSE
Exit:
ret
__FXmsCheckInstalled endp
end
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/