Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R0 | 17 (reason code) |
R1 | Access privilege to start search from (0 to begin enumeration) |
Exit | |
---|---|
R0 | Preserved |
R1 | Access privilege number (-1 if at end of enumeration) |
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 |
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)
To enumerate all available AP values, you must increment the returned R1 value by one on each call, e.g.:
ap% = -1 REPEAT ap% += 1 SYS "OS_Memory",17,ap% TO ,ap%,flags% IF ap% <> -1 THEN PRINT ap%;" ";flags% UNTIL ap% = -1
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.