h6. [[OS SWI Calls]] h6(. » [[OS_Memory]] h6((. » OS_Memory 17 h2. OS_Memory 17 h5. (SWI &68) |_<^{width:4em}. Entry | | |<^. R0 |<^. 17 (reason code) | |<^. R1 |<^. [[Memory Map Page Access|Access privilege]] to start search from (0 to begin enumeration) | |_<^{width:4em}. Exit | | |<^. R0 |<^. Preserved | |<^. R1 |<^. Access privilege number (-1 if at end of enumeration) | |/8<^. R2 |<^. Permissions: (0 if at end of enumeration) | |<^. Bit 0: Executable in user mode | |<^. Bit 1: Writable in user mode | |<^. Bit 2: Readable in user mode | |<^. Bit 3: Executable in privileged modes | |<^. Bit 4: Writable in privileged modes | |<^. Bit 5: Readable in privileged modes | |<^. Bits 6+: Reserved | h4. Use This call allows you to enumerate the available access privileges and read their permissions. On exit, R1 will either be -1 or a valid AP number. If it is an AP number than R2 will contain the permission flags associated with that AP. Note that the AP number returned may be different to the AP number that was provided on entry (e.g. if the AP number provided on entry was not valid) h4. Notes To enumerate all available AP values, you must increment the returned R1 value by one on each call, e.g.: <pre>ap% = -1 REPEAT ap% += 1 SYS "OS_Memory",17,ap% TO ,ap%,flags% IF ap% <> -1 THEN PRINT ap%;" ";flags% UNTIL ap% = -1</pre> This call was introduced in RISC OS 5.23. For the permissions supported by earlier RISC OS versions, see [[Memory Map Page Access]]. [[OS_Memory 18]] can be used to find an AP value that most closely matches a given set of permissions. h4. See also * [[OS_Memory]] * [[OS_Memory 18]] * [[Memory Map Page Access]]