4 ;******************************************************************************
5 TITLE EXTPOOL
- MODULE to manage a pool of extended memory
6 ;******************************************************************************
8 ; (C) Copyright MICROSOFT Corp. 1986
10 ; Title: MEMM.EXE - MICROSOFT Expanded Memory Manager 386 Driver
12 ; Module: EXTPOOL - Manage a pool of extended memory.
20 ;******************************************************************************
24 ; DATE REVISION Description
25 ; -------- -------- --------------------------------------------
26 ;******************************************************************************
27 ; Functional Description:
29 ; "Fixit Orders" Crisis mode file. We need to ship data structures up hi.
30 ; So at init time we get a pool of extended memory and manage it for the
31 ; fixit routine. Services provided include initialise, allocate and
32 ; blkmov to the memory.
34 ;******************************************************************************
39 ;******************************************************************************
40 ; P U B L I C D E C L A R A T I O N S
41 ;******************************************************************************
42 public pool_initialise
46 ;******************************************************************************
47 ; L O C A L C O N S T A N T S
48 ;******************************************************************************
51 ;******************************************************************************
53 ;******************************************************************************
54 include vdmseg
.inc ; segment definitions
57 ;******************************************************************************
58 ; E X T E R N A L R E F E R E N C E S
59 ;******************************************************************************
63 ;******************************************************************************
64 ; S E G M E N T D E F I N I T I O N
65 ;******************************************************************************
67 ;*************************************************************************
71 ;*************************************************************************
75 ext_start dw 0000h ; start of the pool of extended memory
76 dw 0010h ; 24 bit address
83 ;*************************************************************************
87 ;*************************************************************************
89 assume
cs:LAST
, DS:DGROUP
, ES:DGROUP
92 ;******************************************************************************
93 ;*** Pool Initialise *** Give this memory manager the memory it is to play ;
96 ; INPUTS: AX = start offset of the extended memory in K ;
97 ; CX = size of the memory ;
103 ; AUTHOR: ISP (ISP) Sep 1, 1988 ;
105 ;*****************************************************************************;
107 Pool_Initialise proc
near
113 push cx ; save size of memory
116 mul cx ; dx:ax size in bytes offset from 1M
118 add ax,cs:[ext_start
] ; add it to 1M
119 adc dx,cs:[ext_start
+2] ;
121 mov cs:[ext_start
],ax ;
122 mov cs:[ext_start
+2],dx ;
124 pop ax ; get size into ax
129 mov cs:[ext_size
+2],dx
141 ;******************************************************************************
142 ;***Get buffer*** Give some poor beggar the memory he is asking for ;
144 ; INPUTS: cx = size of buffer required in bytes ;
146 ; OUTPUTS: DX:AX = address of buffer ;
147 ; cx = size allocated
151 ; AUTHOR: ISP (ISP) Sep 1, 1988 ;
153 ;*****************************************************************************;
158 ; assume that the memory is present, put start address in dx:ax
160 mov dx,cs:[ext_start
+2]
161 mov ax,cs:[ext_start
]
163 ; then proceed to determine if it really exists
168 cmp eax, dword ptr cs:[ext_size
]
171 ; it does exist, adjust the size and the start address
173 sub dword ptr cs:[ext_size
],eax
174 add dword ptr cs:[ext_start
],eax