Showing changes from revision #1 to #2:
Added | Removed | Changed
R0 | Use |
---|---|
0 | No Op – |
1 | Get device name – you should place the device name at R2 and the length of the name in |
2 | Get free space for device – used to find the free space on a device, which should be written to the buffer. Reason code 4 is is now the |
3 | Compare device – used to check if a file exists on a particular drive. A fast filing system such as RAMFS is allowed to always return Z |
4 | Get free space for device (64 bit) – used to find the free space on a device. From RISC OS 3.60, this call is used rather than 2. If R0 is non-zero on exit, or if an error occurs, then reason code 2 is called. Thus your routine must give an error for both reason codes 4 and 2 before Free will believe |
Entry | ||
---|---|---|
R0 | R0 | 0 (reason code) |
Exit | |
---|---|
All Register Preserved |
Entry | |
---|---|
R0 | 1 (reason code) |
R1 | Filing System Numbers |
R2 | Pointer to buffer |
R3 | Pointer to device or ID |
Exit | |
---|---|
R0 | Length of |
R1 | Preserved |
R2 | Preserved |
R3 | Preserved |
Entry | |
---|---|
R0 | 2 (reason code) |
R1 | Filing System Numbers |
R2 | Pointer to 3 word buffer (See below) |
R3 | Pointer to device or ID |
3 word buffer | |
---|---|
Offset | Meaning |
+0 | Total size of device (0 if unchanged) |
+4 | Free space on device |
+8 | Used space on device |
Exit | |
---|---|
R0 | Preserved |
R1 | Preserved |
R2 | Buffer provided upon entry is updated |
R3 | Preserved |
Entry | |
---|---|
R0 | 3 (reason code) |
R1 | Filing System Numbers |
R2 | Pointer to filename |
R3 | Pointer to device or ID |
R6 | Pointer to special field |
Exit | |
---|---|
R0 | Preserved |
R1 | Preserved |
R2 | Preserved |
R3 | Preserved |
R6 | Preserved |
Z flag is set if R2, R6 point to a file on R3.
Entry | |
---|---|
R0 | 4 (reason code) |
R1 | Filing System Numbers |
R2 | Pointer to 6 word buffer |
R3 | Pointer to device name or ID |
6 word buffer | |
---|---|
Offset | Meaning |
0, 4 | Total size of device (0 if unchanged) |
8, 12 | Free space on device |
16, 20 | Used space on device |
Note:
Exit | |
---|---|
R0 | 0 |
R1 | Preserved |
R2 | Buffer provided upon entry is updated |
R3 | Preserved |
R6 | Preserved |
The routine will be called in User mode with a stack consisting only of the return address (no other use should be made of it). The routine can either:
The routine can either:
The routine should exit using:
LDMIA R13!,{PC}
Don’t return an error for unused reason codes, instead return with registers preserved, to allow for future extensions to be handled in the same manner as reason code 4 was added.