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.|
 +|A0.L|Base address of area.|A0.L|Preserved.|
 +===== 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.
 +alloc   moveq   #$38,d0         ; SMS_SCHP
 +        move.l  #$800,d1        ; New allocation
 +        trap    #1              ; Reduce the allocation
 +        ...                     ; Do something here.
  • qdosmsq/traps/trap_1/schp.txt
  • Last modified: 2011/02/28 16:13
  • by george.gwilt