Differences
This shows you the differences between two versions of the page.
qdosmsq:vectors:rchp [2008/06/27 19:26] norman created |
qdosmsq:vectors:rchp [2008/06/27 19:29] (current) norman Fixed bugs in three lines of code! |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== MM_RECHP/ | ||
+ | This vector deallocates memory on the common heap. It should only be called in supervisor mode. The vector is atomic. The memory being deallocated should have been allocated using [[qdosmsq: | ||
+ | |||
+ | ^Call Parameters^^Return Parameters^^ | ||
+ | |D1.L|Unused. |D1.L|Corrupted.| | ||
+ | |D2.L|Unused. |D2.L|Corrupted.| | ||
+ | |D3.L|Unused. |D3.L|Corrupted.| | ||
+ | |A0.L|Address of area to deallocate. |A0.L|Corrupted.| | ||
+ | |A1.L|Unused. |A1.L|Corrupted.| | ||
+ | |A2.L|Unused. |A2.L|Corrupted.| | ||
+ | |A3.L|Unused. |A3.L|Corrupted.| | ||
+ | |A6.L|System variables address |A6.L|Preserved.| | ||
+ | |||
+ | ===== Errors ===== | ||
+ | No errors are returned by this vector call. | ||
+ | |||
+ | ===== Notes ===== | ||
+ | * All registers not shown above are not used on entry and are preserved on exit. | ||
+ | * **Must** be called in supervisor mode only. | ||
+ | * Mainly used in device driver ' | ||
+ | * This vector call is //atomic//. | ||
+ | |||
+ | |||
+ | ===== Example ===== | ||
+ | The example below shows the use of this vector to deallocate a previously allocated chunk of memory. For the sake of the example, the start address of the area is assumed to be on the top of the stack. | ||
+ | |||
+ | < | ||
+ | Kill_hp move.w | ||
+ | movea.l (a7)+, | ||
+ | ; Assume A6 is correct already. | ||
+ | jsr (a2) ; Make the call. | ||
+ | ... ; Carry on here. | ||
+ | </ | ||