qdosmsq:vectors:alhp

Differences

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

Link to this comparison view

qdosmsq:vectors:alhp [2009/01/15 16:13]
george.gwilt created
qdosmsq:vectors:alhp [2009/02/12 14:46] (current)
george.gwilt Link added
Line 1: Line 1:
 +====== MM_ALLOC/MEM_ALHP - Vector $D8 ======
 +
 +This vector allocates space in a user heap.
 +
 +^Call Parameters^^Return Parameters^^
 +|D0.L|Unused|D0.L|Error code.|
 +|D1.L|Number of bytes required. |D1.L|Number of bytes allocated.|
 +|D2.L|Unused |D2.L|Corrupted.|
 +|D3.L|Unused |D3.L|Corrupted.|
 +|A0.L| Pointer to pointer to free space |A0.L|Address of allocated area.|
 +|A1.L|Unused |A1.L|Corrupted.|
 +|A2.L|Unused |A2.L|Corrupted.|
 +|A3.L|Unused |A3.L|Corrupted.|
 +
 +
 +===== Errors =====
 +
 +|ERR_OM|Out of memory.|
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * The space allocated contains in its first long word the size of the space. Provided the user has a copy of this size the whole of the space can be used.
 +
 +
 +===== Example =====
 +The example below shows how to obtain space from a user heap.
 +
 +It is assumed that A6 points to the data space and that the address of the pointer to free space is in heapad(a6). See [[rehp|MM_LNKFR/MEM_REHP]].
 +
 +<code>
 +        move.l  #504,d1         ; Number of bytes needed
 +        lea     heapad(a6),a0   ; Pointer to pointer to free space
 +        movea.w MM_ALLOC,a2     ; address of MM_ALLOC
 + jsr (a2) ; Make the call
 + bne.s Error_handler ; Oops!
 +</code>
 +
  
  • qdosmsq/vectors/alhp.txt
  • Last modified: 2009/02/12 14:46
  • by george.gwilt