qdosmsq:vectors:rchp

Differences

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

Link to this comparison view

qdosmsq:vectors:rchp [2008/06/27 20:26]
norman created
qdosmsq:vectors:rchp [2008/06/27 20:29]
norman Fixed bugs in three lines of code!
Line 20: Line 20:
   * Mainly used in device driver '​close'​ routines to deallocate space used for channel definition blocks and so on.   * Mainly used in device driver '​close'​ routines to deallocate space used for channel definition blocks and so on.
   * This vector call is //atomic//.   * This vector call is //atomic//.
 +
  
 ===== Example ===== ===== Example =====
-The example below shows the use of this trap call to obtain ​the address ​of the location ​of the system variables prior to some (unknown?) usage of that returned address.+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.
  
 <​code>​ <​code>​
 Kill_hp move.w ​ MM_RECHP,​A2 ​    ; MM_RECHP vector address. Kill_hp move.w ​ MM_RECHP,​A2 ​    ; MM_RECHP vector address.
-                                ​; Assume A6 is correct already +        movea.l (a7)+,​a0 ​       ; Unstack the start of the allocated area. 
- jsr (a2) ; Make the call+                                ​; Assume A6 is correct already. 
 +        jsr      (a2)           ​; Make the call.
         ...                     ; Carry on here.         ...                     ; Carry on here.
 </​code>​ </​code>​
  
  • qdosmsq/vectors/rchp.txt
  • Last modified: 2008/06/27 20:29
  • by norman