h6. [[VFPSupport]] h6(. » [[VFPSupport SWI Calls|SWI Calls]] h6((. » VFPSupport_ExceptionDump h2. VFPSupport_ExceptionDump h5. (SWI &58EC9) |_<^{width:4em}. Entry | | |/6<^. R0 |Flags: | |Bit 0: Get exception dump | |Bit 1: Get exception context | |Bit 2: Clear exception dump | |Bit 3: Create exception dump | |Other bits: Reserved, should be zero | |/2<^. R1 |Context pointer (if bit 3 of flags set) | |Otherwise ignored | |_<^{width:4em}. Exit | | |<^. R0 |Copy of exception dump (if bit 0 of flags set), otherwise preserved | |<^. R1 |Exception context (if bit 1 of flags set), otherwise preserved | |\2. All other registers preserved | h4. Use This call allows for reading and writing of the VFP exception dump that VFPSupport maintains. VFPSupport will automatically fill the exception dump with a copy of the current VFP context whenever a trapped exception occurs and raises a RISC OS error. This call allows code to read that exception dump, or to create its own exception dump should it desire. The exception dump is a standard VFP context structure, and so can be examined using [[VFPSupport_ExamineContext]]. Behaviour of the call is controlled by the flags value in R0. Multiple flags can be specified at once. They order of processing and their behaviour is described below: # The create flag is handled first. If this flag is set, R1 is treated as a pointer to a VFP context to copy to the internal exception buffer. This will overwrite the current contents. If a null pointer is specified, it will result in the buffer being cleared. # Next, the two get flags (bit 0 and bit 1) are checked. If bit 0 is set, R0 on exit will contain a copy of the exception context. This copy must be freed by the caller using [[OS_Module 7]]. The returned value will be zero if there is no exception context available. An error will be returned if there is insufficient memory to copy the context. # If bit 1 is set, the original address of the exception context will be returned - i.e. the value of R1 specified when the exception buffer was initialised. This value should only be used for identifying the context; no guarantee is made that the memory it points to is still valid. Zero will be returned if there is no exception context available. # Finally, if bit 2 is set the exception buffer will be cleared. All operations on the exception buffer occur in an atomic manner. For example, setting bits 0, 1 and 2 allow for the contents of the buffer to be read and then cleared. If a subsequent exception occurs halfway through the operation then it will not affect the returned results, but it will be correctly stored within the exception buffer. However, if lack of memory prevents the exception from being returned to the caller, then it will still be cleared from the internal buffer. h4. See also * [[VFPSupport_ExamineContext]]