en:docs:fapi:dossuballoc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dossuballoc [2018/08/30 16:34] – created prokusheven:docs:fapi:dossuballoc [2021/12/05 11:05] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
  
-This call suballocates portions of a segment allocated by DosAllocSeg or DosAllocShrSeg, and initialized by DosSubSet.+====== DosSubAlloc ======
  
-==Syntax== +This call suballocates portions of a segment allocated by [[DosAllocSeg]] or [[DosAllocShrSeg]]and initialized by [[DosSubSet]].
- DosSubAlloc (SegSelectorBlockOffset, Size)+
  
-==Parameters== +===== Syntax ===== 
-;SegSelector (SEL) - input : Data segment selector that allocates the memory. +<code c> 
-;BlockOffset (PUSHORT) - output : Address of the allocated block offset. +DosSubAlloc (SegSelector, BlockOffset, Size) 
-;Size (USHORT) - input : Memory block size requested in bytes.+</code> 
 + 
 +===== Parameters ===== 
 + 
 +  SegSelector ([[SEL]]) - input : Data segment selector that allocates the memory. 
 +  BlockOffset ([[PUSHORT]]) - output : Address of the allocated block offset. 
 +  Size ([[USHORT]]) - input : Memory block size requested in bytes. 
 + 
 +===== Return Code ===== 
 + 
 +rc ([[USHORT]]) - return
  
-==Return Code== 
- rc (USHORT) - return 
 Return code descriptions are: Return code descriptions are:
-* 0          NO_ERROR 
-* 311        ERROR_DOSSUB_NOMEM  
-* 313        ERROR_DOSSUB_BADSIZE 
  
-==Remarks==+  * 0          NO_ERROR 
 +  * 311        ERROR_DOSSUB_NOMEM  
 +  * 313        ERROR_DOSSUB_BADSIZE 
 + 
 +===== Remarks ===== 
 Before a segment allocated by [[DosAllocSeg]] or [[DosAllocShrSeg]] can be suballocated, it must first be initialized for suballocation by a call to [[DosSubSet]]. Before a segment allocated by [[DosAllocSeg]] or [[DosAllocShrSeg]] can be suballocated, it must first be initialized for suballocation by a call to [[DosSubSet]].
  
-Allocation size must be a multiple of four bytes. Otherwise, it is rounded up to a multiple of four bytes. The maximum value for the size parameter is the size that was set with DosSubSet minus 8. Note that no paragraph (16-byte) alignment is required; all requests are serviced on a byte alignment basis.+Allocation size must be a multiple of four bytes. Otherwise, it is rounded up to a multiple of four bytes. The maximum value for the size parameter is the size that was set with [[DosSubSet]] minus 8. Note that no paragraph (16-byte) alignment is required; all requests are serviced on a byte alignment basis.
  
-A suballocated block of memory in a suballocated segment is freed by a call to DosSubFree. +A suballocated block of memory in a suballocated segment is freed by a call to [[DosSubFree]]
  
-==Example Code== +===== Example Code ===== 
-===C Binding=== + 
-<PRE>+==== C Binding ===
 + 
 +<code c>
 #define INCL_DOSMEMMGR #define INCL_DOSMEMMGR
  
Line 36: Line 48:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +==== MASM Binding ===
-<PRE>+ 
 +<code asm>
 EXTRN  DosSubAlloc:FAR EXTRN  DosSubAlloc:FAR
 INCL_DOSMEMMGR      EQU 1 INCL_DOSMEMMGR      EQU 1
Line 47: Line 60:
 PUSH   WORD    Size          ;Size of requested block PUSH   WORD    Size          ;Size of requested block
 CALL   DosSubAlloc CALL   DosSubAlloc
 +</code>
 Returns WORD Returns WORD
-</PRE> 
- 
- 
  
-====== Note ======+===== Note =====
  
 Text based on [[http://www.edm2.com/index.php/DosSubAlloc]] Text based on [[http://www.edm2.com/index.php/DosSubAlloc]]