=> R0 = 12
R1 = pointer to directory name
R2 = pointer to buffer
R3 = number of objects to read
R4 = where to start, 0 for first time
R5 = length of buffer
R6 = wildcarded name to match (if 0, "*" is used)
<= R3 = number of objects read
R4 = where to continue, or -1 for no more
C flag is clear if R3 = 0, else it is set
This SWI reads entries from the specified directory. The correct code structure to call this SWI is:
repeat
{
call OS_GBPB 12
if (R3 <> 0)
{
process buffer
}
} until (R4 = -1)
as it is legal to return R3 = 0 before the end of the directory. Also, do not assume anything about the value in R4.
OS_GBPB 12 buffer
Offset Contents
0 Load address
4 Exec address
8 Length
12 Attributes
16 Object type
20 File type
24 name (0-terminated)
Entries are word aligned.
|
|
|