TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: BRIAN MCLAUGHLIN
date: 1995-09-12 22:06:00
subject: MAXLIB 2d Array Code 2/2

>>> Continued from previous message
 FirstPlace% = (Index1% - Handle.FirstUBound) + 1
 SecondPlace% = (Index2% - Handle.SecondUBound) + 1
 RealIndex% =  -32768 + (FirstPlace% * Handle.Multiplier) + SecondPlace%
 OutXMS BUFFER, Handle.MaxHandle, RealIndex%
 Length% = Handle.Length  ' how long is our ANY parameter?
 BufSeg = VARSEG(BUFFER)  ' where is our buffer?
 BufOff = VARPTR(BUFFER)
 ! Push DS                ; save required registers
 ! Push SI
 ! Push DI
 ! Les DI, [BP+18]        ; load ES:DI with address of ANY parameter
 ! Mov SI, BufOff
 ! Mov AX, BufSeg
 ! Mov DS, AX             ; load ES:DI with address of BUFFER
 ! Mov CX, Length%        ; load CX with number of bytes to move
 ! Rep Movsb              ; copy CX bytes of BUFFER into ANY param
 ! Pop DI                 ; restore the required registers
 ! Pop SI
 ! Pop DS
END SUB
'========================================
 SUB Erase2XMS (Handle AS TwoDimHandle)
'========================================
  EraseXMS Handle.MAXHandle
END SUB
'--------------------------  END CODE ----------------------------
 * SLMR 2.1a * MAXLIB For PB v1.2 - Access arrays and files in EMS/XMS!
--- WILDMAIL!/WC v4.12 
---------------
* Origin: Com-Dat BBS - Hillsboro, OR. HST DS (1:105/314.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™.