qdosmsq:traps:trap_1:schp

Differences

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

Link to this comparison view

qdosmsq:traps:trap_1:schp [2011/02/28 16:13] (current)
george.gwilt created
Line 1: Line 1:
 +====== SMS_SCHP ======
 +This trap returns part of an allocation to the common heap. See [[achp|MT_ALCHP]].
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$38|D0.L|Error return.|
 +|D1.L|New size required. |D1.L|New size allocated.|
 +|D2.L|Unused.|D2.L|Corrupted.|
 +|D3.L|Unused.|D3.L|Corrupted.|
 +|A0.L|Base address of area.|A0.L|Preserved.|
 +|A1.L|Unused.|A1.L|Corrupted.|
 +|A2.L|Unused.|A2.L|Corrupted.|
 +|A3.L|Unused.|A3.L|Corrupted.|
 +===== Error =====
 +|ERR_NJ|Invalid Job.|
 +
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * The new, reduced, size of the area still starts at the original address. It is the higher portion which is returned to the heap. This trap is useful when you want to have a smaller area than before. It is better to reduce the size this way than to return the whole area to the heap and allocate a new area of the smaller size.
 +
 +===== Example =====
 +The example below shows an allocation being reduced to $800 bytes. It is assumed that A0.L contains the address of the original allocation.
 +<code>
 +alloc   moveq   #$38,d0         ; SMS_SCHP
 +        move.l  #$800,d1        ; New allocation
 +        trap    #1              ; Reduce the allocation
 +        ...                     ; Do something here.
 +</code>
 +
  
  • qdosmsq/traps/trap_1/schp.txt
  • Last modified: 2011/02/28 16:13
  • by george.gwilt