I am developing a XMS support to my programs based on a script
writing by Dave Navarro, Jr.
I can:
08h) Query Free Extended Memory
09h) Allocate Extended Memory Block
0Ah) Free Extended Memory Block
But not:
0Bh) Move Extended Memory Block
My code is it:
Sub VersionXMS()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, 0
! mov BL, 0
! call Dword Ptr Pointer
! mov OK??, DX
! mov Version1?, AH
! mov Version2?, AL
! pop DS
If OK??=1 then
Print "Version del controlador XMS: ";
Print LTrim$(Str$(Version1?)); "." LTrim$(Str$(Version2?))
end if
END SUB
SUB TotalMemoriaExtendida()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, 8
! mov BL, 0
! call Dword Ptr Pointer
! mov TMB??, AX
! mov Libre??, DX
! pop DS
Print "Memoria extendida libre: "; Libre??; "KB"
Print "Tama¤o del maximo bloque libre: "; TMB??; "KB"
END SUB
SUB ReservarBloqueDeMemoriaExtendida()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, 9
! mov BL, 0
! mov DX, 40
! call Dword Ptr Pointer
! mov OK??, AX
! mov Identificador??, DX
! pop DS
If OK??=1 then
Print "Se reserv¢ bloque de memoria extendida ID: "; Hex$(Identificador??)
end if
END SUB
SUB LiberarBloqueDeMemoriaExtendida()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, &H0A
! mov BL, 0
! mov DX, Identificador??
! call Dword Ptr Pointer
! mov OK??, AX
! pop DS
If OK??=1 then
Print "Se liber¢ bloque de memoria extendida ID: "; Hex$(Identificador??)
end if
END SUB
SUB SubirInformacionXMS()
DIM Pointer AS DWORD
DIM Estructura as EstructuraParaMoverDatos
Estructura.NoBytes = 10
Estructura.IDFuente = 0
Estructura.SegDirFuente = VARSEG(BufferXM$)
Estructura.DesDirFuente = VARPTR(BufferXM$)
Estructura.IDDestino = Identificador??
Estructura.DesDirDestino = 0
Estructura.SegDirDestino = 1
SegEstructura?? = VARSEG(Estructura)
DesEstructura?? = VARPTR(Estructura)
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, &H0B
! mov DI, SegEstructura??
! mov SI, DesEstructura??
! call Dword Ptr Pointer
! mov OK??, AX
! mov ER?, BL
! pop DS
If OK??=1 then
Print "Se subieron los datos a la memoria extendida."
else
Print "ERROR "; Hex$(ER?)
end if
END SUB
SUB BajarInformacionXMS()
DIM Pointer AS DWORD
DIM Estructura as EstructuraParaMoverDatos
Estructura.NoBytes = 10
Estructura.IDFuente = Identificador??
Estructura.SegDirFuente = 0
Estructura.DesDirFuente = 1
Estructura.IDDestino =0
Estructura.SegDirDestino = VARSEG(BufferXM$)
Estructura.DesDirDestino = VARPTR(BufferXM$)
SegEstructura?? = VARSEG(Estructura)
DesEstructura?? = VARPTR(Estructura)
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, &H0B
! mov DS, SegEstructura??
! mov SI, DesEstructura??
! call Dword Ptr Pointer
! mov OK??, AX
! mov ER?, BL
! pop DS
If OK??=1 then
Print "Se bajaron los datos de la memoria extendida."
else
Print "ERROR "; Hex$(ER?)
end if
END SUB
Someone can help me?
JAER Mex2001
------------------
writing by Dave Navarro, Jr.
I can:
08h) Query Free Extended Memory
09h) Allocate Extended Memory Block
0Ah) Free Extended Memory Block
But not:
0Bh) Move Extended Memory Block
My code is it:
Sub VersionXMS()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, 0
! mov BL, 0
! call Dword Ptr Pointer
! mov OK??, DX
! mov Version1?, AH
! mov Version2?, AL
! pop DS
If OK??=1 then
Print "Version del controlador XMS: ";
Print LTrim$(Str$(Version1?)); "." LTrim$(Str$(Version2?))
end if
END SUB
SUB TotalMemoriaExtendida()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, 8
! mov BL, 0
! call Dword Ptr Pointer
! mov TMB??, AX
! mov Libre??, DX
! pop DS
Print "Memoria extendida libre: "; Libre??; "KB"
Print "Tama¤o del maximo bloque libre: "; TMB??; "KB"
END SUB
SUB ReservarBloqueDeMemoriaExtendida()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, 9
! mov BL, 0
! mov DX, 40
! call Dword Ptr Pointer
! mov OK??, AX
! mov Identificador??, DX
! pop DS
If OK??=1 then
Print "Se reserv¢ bloque de memoria extendida ID: "; Hex$(Identificador??)
end if
END SUB
SUB LiberarBloqueDeMemoriaExtendida()
DIM Pointer AS DWORD
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, &H0A
! mov BL, 0
! mov DX, Identificador??
! call Dword Ptr Pointer
! mov OK??, AX
! pop DS
If OK??=1 then
Print "Se liber¢ bloque de memoria extendida ID: "; Hex$(Identificador??)
end if
END SUB
SUB SubirInformacionXMS()
DIM Pointer AS DWORD
DIM Estructura as EstructuraParaMoverDatos
Estructura.NoBytes = 10
Estructura.IDFuente = 0
Estructura.SegDirFuente = VARSEG(BufferXM$)
Estructura.DesDirFuente = VARPTR(BufferXM$)
Estructura.IDDestino = Identificador??
Estructura.DesDirDestino = 0
Estructura.SegDirDestino = 1
SegEstructura?? = VARSEG(Estructura)
DesEstructura?? = VARPTR(Estructura)
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, &H0B
! mov DI, SegEstructura??
! mov SI, DesEstructura??
! call Dword Ptr Pointer
! mov OK??, AX
! mov ER?, BL
! pop DS
If OK??=1 then
Print "Se subieron los datos a la memoria extendida."
else
Print "ERROR "; Hex$(ER?)
end if
END SUB
SUB BajarInformacionXMS()
DIM Pointer AS DWORD
DIM Estructura as EstructuraParaMoverDatos
Estructura.NoBytes = 10
Estructura.IDFuente = Identificador??
Estructura.SegDirFuente = 0
Estructura.DesDirFuente = 1
Estructura.IDDestino =0
Estructura.SegDirDestino = VARSEG(BufferXM$)
Estructura.DesDirDestino = VARPTR(BufferXM$)
SegEstructura?? = VARSEG(Estructura)
DesEstructura?? = VARPTR(Estructura)
IF Pointer = 0 THEN
! push DS
! mov AX, &h4310
! int &h2f
! mov Word Ptr Pointer[0], BX
! mov Word Ptr Pointer[2], ES
! pop DS
END IF
! push DS
! mov AH, &H0B
! mov DS, SegEstructura??
! mov SI, DesEstructura??
! call Dword Ptr Pointer
! mov OK??, AX
! mov ER?, BL
! pop DS
If OK??=1 then
Print "Se bajaron los datos de la memoria extendida."
else
Print "ERROR "; Hex$(ER?)
end if
END SUB
Someone can help me?
JAER Mex2001
------------------
Comment