Jump to content

How do I navigate Sparta Dos subdirectories in Assembler?

Recommended Posts

Hello all,


I'm sorry if this has been explaied before but I am unable to find this in the SDX manuals or in the forum.


I have an application where I list a directory and call files. Working fine in SpartaDos. But how can I imply moving into sparta Dos subdirectories?


My application was written based on Dos2.5 first. I open the directory, read in all enties and save the 8 characters of each filename into a list for later call.

Turned out it works fine with SDX as well.


But how do I even recognize SDX subdirectory entires? They do not show at all with my method.


Right now I have to go back to Dos, type CD <subdirectory> and restart my application to acces those subdirectories. I would like to imply Dir changes in my code.


Seems I need a method to get a list of available subdirectory names and some code to navigate between directories.


Can anyone help me here?





Link to comment
Share on other sites

6.3.13 Change Current Directory (CHDIR)
Change the current working directory of a disk.
XIO 44,#IOCB,0,0,"Dd:path"
This will change the directory that is used when the specified drive is accessed without
reference to a specific directory. The rules regarding path and IOCB status defined in
XIO 42 apply here

XIO 44,#3,0,0,"DX:SUBDIR1"

XIO 44,#3,0,0,"DX:<SUBDIR2"


or something similar. check the sdx manual again and search for XIO

Edited by rdea6
Link to comment
Share on other sites

XIO is a standard CIO call e.g. XIO <cmd>,#<iocb>,<aux1>,<aux2>,<fspec>

Usually "Special" command is assumed when using this in Basic. The difference between special commands and the normal range of GET/PUT types is that the IOCB doesn't need to be already opened for the special commands to work.


From assembly POV:

Store byte <cmd> into ICCOM

<iocb> as usual passed in X register (multiplied by 16)

<aux1/2> auxilliary byte #1 and #2 values into ICAX1/2

<fspec> device/file specification, as per procedure if issuing an OPEN command. Filespec is only needed if the IOCB isn't already opened to the required device.

  • Like 1
Link to comment
Share on other sites

Thanks guys for your hints so far!


OK, so I open a directory with command icax1=6 and icax2=0 (SDX short format) and filespec *.* and read in all the Dir entries and store them in memory.

Some of them are files, some of them are directory names.

How can I tell which are the directories so that I can mark them accordingly in my listup and to correctly apply a directory change instead of loading the file when called?

I guess there's a marker bit somewhere in the entry but I cant find it in the Sparta Dos description at first glance.. (I've got a headcold right now and can't concentrate well so I just can't be bothered.. )


It will take me a bit of trying and analysing to figure it out but if you guys can tell me in one brief sentence I would greatly appreciate :-)

Edited by bugbiter
Link to comment
Share on other sites

Thanks guys! My BGP Picture viewer can now recognize subdirectory names in the Directory list and marks them up with brackets.


No to the actual change of the working path:


XIO 44,#IOCB,0,0,"Dd:path" - Does that mean that I always have to keep track and spell out the whole path?


Or may I just put in the subdirectory name? And how can I do a 'CD ..' in assembler to get one level up?

Do I need to delete the last name in the path string and put it in the xio 44 call? Is there an easier way?

Link to comment
Share on other sites

The path is relative to the current working directory unless it begins with a ">" or "\" immediately following the device ID (i.e. after "Dn:"). So if the current working directory is "TEST", you may CWD to a directory inside of "TEST" by omitting the leading path delimiter.


To back up one level, "XIO 44,#IOCB,0,0,"Dn:<") will do (you may use "..\" instead if you wish).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...