Jump to content
Sign in to follow this  
Pengwin

Formatting a disk

Recommended Posts

Just asked this over in the programming forum, but I thought I would ask here as well:

 

I am writing a project in Kyan Pascal, but I need the program to format a disc before storing data. I cannot find a way of doing this directly from pascal, so I was hoping someone out there might have an assembly listing of a format routine I could then embed in the pascal source.

 

I am using an 800XL with a standard 1050 drive. The DOS that I will be using for the app is DOS2.5

 

Anyone?

Share this post


Link to post
Share on other sites

Hi,

 

you need to send a CIO Command. The command number is depended from the DOS you're using and the Density you're formatting, mostly between 251 and 254. You'll find a list hare --> http://www.strotmann.de/twiki/bin/view/APG/PgmXIOCmd

 

Kyan Pascal should have a CIO or XIO Command to send CIO Commands to a handler. If not, it can be easily don't from embedded assembler.

Share this post


Link to post
Share on other sites

Hmmmm, Kyan manual makes no mention of any CIO or XIO calls?

 

 

 

Curt

 

Just asked this over in the programming forum, but I thought I would ask here as well:

 

I am writing a project in Kyan Pascal, but I need the program to format a disc before storing data. I cannot find a way of doing this directly from pascal, so I was hoping someone out there might have an assembly listing of a format routine I could then embed in the pascal source.

 

I am using an 800XL with a standard 1050 drive. The DOS that I will be using for the app is DOS2.5

 

Anyone?

Share this post


Link to post
Share on other sites

Hmmmm, Kyan manual makes no mention of any CIO or XIO calls?

 

Yeah, that's why I was hoping for an assembler routine. I know the basics of 6502, but have never actually coded anything in assembler.

Share this post


Link to post
Share on other sites

Here are some C/asm sources for doing XIO that I wrote. They are not perfect.

 

xio.zip

 

 

Here is some info from DERE: http://www.atariarchives.org/dere/chapt08.php#H8_6

And from Mapping: http://www.atariarchives.org/mapping/appendix17.php

XIO commands: http://www.telusplanet.net/public/pairman/xiocodes.txt

 

I *think* that a format can be done in C with the following:

 

#define DISK_IOCB 1
//Open
xio(0x3, DISK_IOCB, 4, 0, "D1:", 0)
//Format double density first/ then single density
xio(0xfe, DISK_IOCB, 0, 0, , "D1:", 0);
//Format double density only (DOS 2.5)
xio(0xfd, DISK_IOCB, 34, 0, , "D1:", 0);
//Format single density only (DOS 2.5)
xio(0xfd, DISK_IOCB, 0, 0, , "D1:", 0);

 

I have not tried the above, but this is what I think will work...

Edited by Cybernoid

Share this post


Link to post
Share on other sites

No problem. Good luck on your project and please be sure to post your "personal accounts" here.. :)

 

Yes, I really do read Krazy Pengwin's Atari 8-bit Home...

Edited by Cybernoid

Share this post


Link to post
Share on other sites

Yes, I really do read Krazy Pengwin's Atari 8-bit Home...

 

That's good, means I'm not talking to myself when I update the blog or projects :-D

 

Of course I will post the finance package on here. Or rather, I'll put a link to my site when it's ready for distribution. Not sure when that will be though, I seem to be working in stops and starts at the moment. :sad:

Edited by Pengwin

Share this post


Link to post
Share on other sites

Thanks for the link to the CIO libraries Cybernoid.

 

I have created a format routine based on the open function, and it works.

 

I am also in the process of creating a Get_Dir function and a File_Exists function. With these libraries, my program should be a lot more professional and robust.

 

And thanks to Carsten for writing them :)

Share this post


Link to post
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.

Guest
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.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...