Files
2024-02-19 00:25:23 -05:00

76 lines
2.5 KiB
HTML

<h2>Allocate Linear Memory Block
<img src="../1.0.gif" alt="[1.0]" width=22 height=17></h2>
Allocates a block of page-aligned linear address space. The
base address of the block may be specified by the client,
and pages within the block may be committed or uncommitted.<p>
<b>Call With</b><br>
<img src="r/ax+ebx+ecx+edx.gif" alt="" width=245 height=59><br>
AX = 0504H<br>
EBX = desired page-aligned linear address of memory
block,
or zero if linear address unspecified<br>
ECX = size of block (bytes, must be nonzero)<br>
EDX = flags
<blockquote><table border=1 cellspacing=0 cellpadding=4>
<tr><th>Bit</th><th>Significance</th></tr>
<tr><td align=center rowspan=2>0</td><td align=left>0 = create uncommitted pages</td></tr>
<tr><td align=left>1 = create committed pages</td></tr>
<tr><td align=center>1-31</td><td align=left>reserved, should be zero</td></tr>
</table></blockquote>
<b>Returns</b><br>
<img src="r/ax+ebx+esi+c.gif" alt="" width=245 height=59><br>
<i>if function successful</i><br>
Carry flag = clear<br>
EBX = linear address of memory block<br>
ESI = handle for memory block<p>
<i>if function unsuccessful</i><br>
Carry flag = set<br>
AX = <a href="errors.html">error code</a>
<table border=1 cellspacing=0 cellpadding=4>
<tr><td>8001H</td><td>unsupported function (16-bit host)</td></tr>
<tr><td>8012H</td><td>linear memory unavailable</td></tr>
<tr><td>8013H</td><td>physical memory unavailable</td></tr>
<tr><td>8014H</td><td>backing store unavailable</td></tr>
<tr><td>8016H</td><td>handle unavailable</td></tr>
<tr><td>8021H</td><td>invalid value (ECX = 0)</td></tr>
<tr><td>8025H</td><td>invalid linear address (EBX not page aligned)</td></tr>
</table>
<h2>Notes</h2><ul>
<li>A DPMI 1.0 host that is 16-bit only will not support this
function.<p>
<li>A 16-bit client of a 32-bit DPMI 1.0 host can use this
function.<p>
<li>The allocated block is always page-aligned. If a specific linear
address is not requested (EBX = 0), the DPMI host allocates the memory
block at any available page-aligned linear address. If a specific
linear address is requested (EBX nonzero), the host either allocates
the block at the specified address or returns <a
href="errors.html">error code</a> 8012H (linear memory
unavailable).<p>
<li><a href="310501.html">Int 31H Function 0501H</a>, which can also
be used to allocate linear memory blocks, does not necessarily
page-align its blocks and does not have the ability to create
uncommitted pages or allocate a block at a specific linear
address. <p>
</ul>