• OS_File question

    From Bob Latham@3:633/10 to All on Monday, February 23, 2026 11:40:05
    I would like to understand what this means...

    It's from PRM OS_File 13.


    If R0=13
    R4 = pointer to control-character terminated comma separated path
    string.

    What does that mean? I can find no examples anywhere.


    I have no problem with OS_File 17, I've used it for years but 13 I
    just can't work out what I'm doing wrong but work for me it does not.


    I read this as R4 points to a path to a directory terminated by zero.
    R1 points to a file name, zero terminated.
    So I expect this to look for the file in that directory but it
    doesn't.
    And what have commas got to do with it?


    Thanks for your help.

    Bob.


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Martin@3:633/10 to All on Monday, February 23, 2026 12:33:31
    In article <5cafa1143ebob@sick-of-spam.invalid>,
    Bob Latham <bob@sick-of-spam.invalid> wrote:
    I would like to understand what this means...

    It's from PRM OS_File 13.
    If R0=13
    R4 = pointer to control-character terminated comma separated path
    string.
    What does that mean? I can find no examples anywhere.

    It means what it says! Remember a path ends in a full stop.
    I assume that the 'comma separated' is referring to the register
    separation, not the components of the path string, which are separated
    by full stops (or colon)

    I have no problem with OS_File 17, I've used it for years but 13 I
    just can't work out what I'm doing wrong but work for me it does
    not.

    I read this as R4 points to a path to a directory terminated by
    zero. R1 points to a file name, zero terminated.

    Zero terminators would work, but it can be any control character.

    So I expect this to look for the file in that directory but it
    doesn't.
    And what have commas got to do with it?

    From that I assume you are writing in BASIC. The commas separate the
    register parameters. The single line:

    SYS "OS_File",13,"Desktop",,,"ADFS::SSD.$.!Boot.Choices.Boot."
    TO r0%,r1%,r2%,r3%,r4%,r5%

    reads details for the Desktop file in Boot, setting registers to
    something like:

    r0%=1 ~r1%=&4E9FD0 ~r2%=&FFFFEA5B ~r3%=&ECF6D418
    r4%=5389 r5%=3

    The three commas after "Desktop" pass null values in for registers r2
    and r3, as they are not used.

    --
    Martin Avison
    Note that unfortunately this email address will become invalid
    without notice if (when) any spam is received.

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Theo@3:633/10 to All on Monday, February 23, 2026 13:20:43
    Martin <News04@avisoft.f9.co.uk> wrote:
    In article <5cafa1143ebob@sick-of-spam.invalid>,
    Bob Latham <bob@sick-of-spam.invalid> wrote:
    I would like to understand what this means...

    It's from PRM OS_File 13.
    If R0=13
    R4 = pointer to control-character terminated comma separated path
    string.
    What does that mean? I can find no examples anywhere.

    It means what it says! Remember a path ends in a full stop.
    I assume that the 'comma separated' is referring to the register
    separation, not the components of the path string, which are separated
    by full stops (or colon)

    I assume it's a comma-separated list of paths, eg:

    ADFS::HardDisc4.$.Foo.,SCSI::USBstick.$.bar.etc.,System:,Resources:Apps.\0

    where '\0' is typically a zero byte but could be any character less than 32.

    Just like you'd typically set Example$Path to the above string.

    Many OS_File SWIs take a path which AIUI means the path is searched until
    the file is found. For example, if you did OS_File 13 on
    System:Modules.CLib you'd end up searching !System.Modules.400 then !System.Modules.350 then !System.Modules.310 as those are all part of System$Path which is searched from left to right. Supposing the file was
    then found as !System.Modules.310.CLib then the command would return the information about that file.

    Zero terminators would work, but it can be any control character.

    Indeed - 'control character' in this context means an ASCII char < 32.

    So I expect this to look for the file in that directory but it
    doesn't.
    And what have commas got to do with it?

    From that I assume you are writing in BASIC. The commas separate the
    register parameters. The single line:

    SYS "OS_File",13,"Desktop",,,"ADFS::SSD.$.!Boot.Choices.Boot."
    TO r0%,r1%,r2%,r3%,r4%,r5%

    reads details for the Desktop file in Boot, setting registers to
    something like:

    r0%=1 ~r1%=&4E9FD0 ~r2%=&FFFFEA5B ~r3%=&ECF6D418
    r4%=5389 r5%=3

    The three commas after "Desktop" pass null values in for registers r2
    and r3, as they are not used.

    Commas for registers are used in BASIC, but they're not used in assembler.
    I think you have gone up the garden path here.

    Specifically this says r4 is set to this value, but in your example you'd
    set r4, r5, r6, ... - if it was like that it would describe what those registers are used for.

    Theo

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Martin@3:633/10 to All on Monday, February 23, 2026 14:13:14
    In article <dCF*kuXzA@news.chiark.greenend.org.uk>,
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    Martin <News04@avisoft.f9.co.uk> wrote:

    [Snip]

    I assume that the 'comma separated' is referring to the register separation, not the components of the path string, which are
    separated by full stops (or colon)

    I assume it's a comma-separated list of paths, eg:

    Yes - absolutely right.
    I realised that after posting, but you beat me to correcting it!

    [Snip]

    SYS "OS_File",13,"Desktop",,,"ADFS::SSD.$.!Boot.Choices.Boot."
    TO r0%,r1%,r2%,r3%,r4%,r5%

    Specifically this says r4 is set to this value, but in your example
    you'd set r4, r5, r6, ... - if it was like that it would describe
    what those registers are used for.

    I do not think my example set r5 or r6!

    --
    Martin Avison
    Note that unfortunately this email address will become invalid
    without notice if (when) any spam is received.

    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bob Latham@3:633/10 to All on Monday, February 23, 2026 14:15:22
    In article <5cafa5f8c8News04@avisoft.f9.co.uk>,
    Martin <News04@avisoft.f9.co.uk> wrote:
    In article <5cafa1143ebob@sick-of-spam.invalid>,
    Bob Latham <bob@sick-of-spam.invalid> wrote:
    I would like to understand what this means...

    It's from PRM OS_File 13.
    If R0=13
    R4 = pointer to control-character terminated comma separated path
    string.
    What does that mean? I can find no examples anywhere.

    It means what it says!

    Really :-)

    Remember a path ends in a full stop.

    I think that was it. For some reason I had it in my head that the
    full stop ending was for xxx$path not any "path". Having the full
    stop is giving me better results. Thank you.


    From that I assume you are writing in BASIC.

    No, assembler.

    Cheers,

    Bob.


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bob Latham@3:633/10 to All on Monday, February 23, 2026 14:22:03
    In article <dCF*kuXzA@news.chiark.greenend.org.uk>,
    Theo <theom+news@chiark.greenend.org.uk> wrote:
    Martin <News04@avisoft.f9.co.uk> wrote:
    In article <5cafa1143ebob@sick-of-spam.invalid>,
    Bob Latham <bob@sick-of-spam.invalid> wrote:
    I would like to understand what this means...

    It's from PRM OS_File 13.
    If R0=13
    R4 = pointer to control-character terminated comma separated path string.
    What does that mean? I can find no examples anywhere.

    It means what it says! Remember a path ends in a full stop.
    I assume that the 'comma separated' is referring to the register separation, not the components of the path string, which are separated
    by full stops (or colon)

    I assume it's a comma-separated list of paths, eg:

    ADFS::HardDisc4.$.Foo.,SCSI::USBstick.$.bar.etc.,System:,Resources:Apps.\0

    Oh, I see, multiple paths that makes sense now.

    My problem was no full stop at the end of my path. I don't normally
    use "paths." so forgot that.


    Thanks.
    Bob.


    --- PyGate Linux v1.5.12
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)