h6. [[OS SWI Calls]] h6(. » OS_DelinkApplication h2. OS_DelinkApplication h5. (SWI &4D) |_<^{width:3em}. Entry | | |<^. R0 |<^. Pointer to buffer | |<^. R1 |<^. Buffer size in bytes | |_<^{width:3em}. Exit | | |<^. R0 |<^. Preserved | |<^. R1 |<^. Number of bytes left in buffer | h4. Use The purpose of this call is to remove any vectors that an application is using. h4. Notes When an application running at &8000 is going to be swapped out, it must remove all vectors that it uses. Otherwise, if the kernel attempted to call the vector it would jump into whatever happened to be at this memory address in whatever application was running at the time - probably with disastrous results. The buffer is used to store details of the vectors used, so they can be restored afterwards with [[OS_RelinkApplication]]. Each vector requires 12 bytes of storage and the list is terminated by a single byte. If the space left is 0, you are to allocate another buffer and repeat the call; the first buffer is still valid, only the vectors which didn't fit into it are placed into the second buffer. When relinking you must pass all buffers used by this call. Note that this call will only delink the standard [[Software Vector Numbers|software vectors]]. Ticker events, hardware/processor vectors, IRQ handlers and [[System Control Handlers|environment handlers]] must be preserved by other means (when running under the Wimp, it will preserve environment handlers for you). h4. See also * [[OS_RelinkApplication]]