h6. [[OS SWI Calls]] h6(. » OS_ValidateAddress h2. OS_ValidateAddress h5. (SWI &3A) |_<^{width:4em}. Entry | | |<^. R0 |<^. Minimum address | |<^. R1 |<^. Maximum address | |_<^{width:4em}. Exit | | |<^. R0 |<^. Preserved | |<^. R1 |<^. Preserved | |\2<^. C flag is clear if the range is OK, else set| h4. Use The purpose of this call is to check that a given address range is valid, i.e. that it maps to some kind of RAM. h4. Notes This call does not check that the memory actually exists, only that it ought to exist. If you have used [[OS_SetMemMapEntries]], then this call will not work as expected. This call also does not report any access information - no guarantee is made that you will be able to read or write to the memory in your current CPU mode. The behaviour of OS_ValidateAddress has changed significantly between different OS versions. h5. Archimedes Prior to RISC OS 3.5, the following areas were considered valid: * Any logical address (0-32MB) which has RAM mapped to it * The second mapping of screen memory at the start of the physical mapping of RAM * (In RISC OS 3) anything reported as valid by [[Service_ValidateAddress]] h5. RISC OS 3.5 From RISC OS 3.5, the following areas were considered valid: * Any dynamic area * Several special kernel regions - zero page workspace, processor stacks, etc. * Screen memory * Anything reported as valid by [[Service_ValidateAddress]] However note that this version of Service_ValidateAddress does not correctly detect valid regions of [[Sparse Dynamic Areas]]. Additionally, not all special regions are reported - e.g. the CAM, page tables, kernel buffers used with long command lines, RISC OS 5 HAL workspace, etc. h5. RISC OS Select Under RISC OS Select the call was reimplemented as a call to [[OS_Memory 24]]. Physically mapped regions will not be reported as valid, however [[Service_ValidateAddress]] can be used to override this. The LegacyScreen module uses this technique to mark screen memory as valid. All other regions reported by OS_Memory 24 are considered valid, e.g. system dynamic areas such as the ROM dynamic area. Special code also exists to mark zero page as valid. h5. RISC OS 5.21 In RISC OS 5.21 the call was also changed to be implemented via [[OS_Memory 24]]. The OS considers the following locations as valid: * Any non-physically mapped memory which is completely user or privileged readable or writable * Any completely physically mapped memory which is also completely user readable & writable (i.e. screen memory on some systems) * Anything reported as valid by [[Service_ValidateAddress]]. Under RISC OS 5 no special code is required to mark zero page as valid, as zero page is one of the areas which OS_Memory 24 will report on. h4. See also * [[OS_Memory 24]] * [[OS_SetMemMapEntries]] * [[Service_ValidateAddress]]