dsk format documentation

4 replies [Last post]
Joined: Oct 20 2013
Posts: 1

I've put together a python 65c02 assembler to program my apple 2e.
I'd like to be able to have it directly output the runable binary into a bootable .dsk format so people can easily get their programs running on an apple 2.

Does anyone have pointers to any documentation describing the dsk format? I've looked around and failed to find any.

As to why write yet another assembler? The reason is that it has a python programmatic interface, so it doesn't need a macro language. You can use python to directly generate code and feed it into the assembler line by line. So python can act as a super powerful macro language.



David Johnston

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speedyG's picture
Joined: Nov 16 2011
Posts: 2426
Re: dsk format documentation

Hello David Johnston,

i guess there a 2 books downloadable from asimov, that will get you ahaead, both from Don Worth and Pieter Lechner:
Beneath Dos and
Beneath ProDOS:

Both books contain insight structures of DOS and Prodos on disk and also description od VTOC and Filehandling and filestructures on disk.

and if you are hunting for the starting point of searching for the .DSK format you might start here at the ciderpress project:
and here:
or here:

and here is source code for DSKtool, a utility to handle DSK format by ectraction or compacting to image:

sincerely speedyG


In early days I had a lot of money but no time - now I have no money but a lot of time....
the second part includes less friends but a lot more joy on life....

Dog Cow's picture
Joined: Dec 11 2008
Posts: 487
Re: dsk format documentation

.dsk is just about the simplest format there is: all 35 tracks of a 16 sector disk, with the sectors in order 0-15.

Every .dsk file is 143,360 bytes long because it's 256 * 16 * 35 bytes.


Mac 512K Blog
Mac GUI VaultApple II BookMac GUI • Email me: dog_cow@m acgui.com

Joined: Apr 11 2006
Posts: 1013
Re: dsk format documentation

Assuming you don't want to write (yet) another disk image manipulation program, AppleCommander has a command-line mode that will take files and transplant them onto disk images for you. It has a native 'ant' interface too, so if you happen to be part of that environment, it's a seamless call to do the deed. Otherwise... you're reading Beyond *DOS books to understand the Apple floppy filesystem data structures, and writing a program to manipulate same. The final result of which is that simple 143,3600 byte file.

mmphosis's picture
Joined: Aug 18 2005
Posts: 321
Re: dsk format documentation