TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: HANS LUNSING
date: 1996-11-17 20:07:00
subject: calling XMS services/2

>>> Continued from previous message
' Restore addressing registers
ASM     POP     DI
ASM     POP     SI
ASM     POP     ES
ASM     POP     DS
' Fill register buffer from local stack
REG %AX, rAX
REG %BX, rBX
REG %CX, rCX
REG %DX, rDX
REG %DS, rDS
REG %ES, rES
REG %SI, rSI
REG %DI, rDI
END FUNCTION
'*****************************************************************************
*
Here is an example program to test the unit:
'*****************************************************************************
*
DEFINT A-Z
$INCLUDE "REGNAMES.INC"
$INCLUDE "CALLXMS.BI"
' XMSInfo type
TYPE XMSInfoRec
  DriverMajor    AS INTEGER
  DriverMinor    AS INTEGER
  XMSMajor       AS INTEGER
  XMSMinor       AS INTEGER
  XMSTotalFree   AS INTEGER
  XMSLargestFree AS INTEGER
  HMAAvailable   AS INTEGER
  A20Active      AS INTEGER
END TYPE
CLS
REG %AX, 0
IF CallXMS THEN
  PRINT "No XMS driver!"
  END
END IF
XMS.HMAAvailable = (REG(%DX) = 1)
XMS.DriverMajor = REG(%BX) \ 256
XMS.DriverMinor = REG(%BX) AND 255
XMS.XMSMajor = REG(%AX) \ 256
XMS.XMSMinor = REG(%AX) AND 255
REG %AX, &H700
CallXMS
XMS.A20Active = (REG(%AX) = 1)
REG %AX, &H800
CallXMS
XMS.XMSLargestFree = REG(%AX)
XMS.XMSTotalFree = REG(%DX)
GOSUB PrintXMS
END
PrintXMS:
PRINT "Driver version:"; TAB(31); XMS.DriverMajor; "."; XMS.DriverMinor
PRINT "XMS version:"; TAB(31); XMS.XMSMajor; "."; XMS.XMSMinor
PRINT "XMS total free memory:"; TAB(31); XMS.XMSTotalFree; "Kb"
PRINT "XMS largest free memory block:"; TAB(31); XMS.XMSLargestFree; "Kb"
PRINT "HMA available:"; TAB(31); XMS.HMAAvailable
PRINT "A20 active:"; TAB(31); XMS.A20Active
RETURN
END
$Link "callxms.pbu"
'*****************************************************************************
*
Friendly greeting you,
Hans Lunsing,           Fido     : 2:281/607.214, 2:282/610.12
                        Internet : jlunsing@doge.nl
--- Terminate 4.00/Pro
 # Origin: BBS De Lauwers For BASIC Programmers! ++31594688407 (2:282/610.12)
---------------
* Origin: United Bbs Systems Europe MailGate to -> Fido USA (2:2802/337.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.