{"id":13344446,"url":"https://github.com/suborb/slowdos","last_synced_at":"2025-07-17T15:35:43.481Z","repository":{"id":88571239,"uuid":"87549074","full_name":"suborb/slowdos","owner":"suborb","description":"Read and write MSDOS discs from BASIC on the ZX Spectrum +3","archived":false,"fork":false,"pushed_at":"2021-02-20T00:46:53.000Z","size":78,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T14:43:02.699Z","etag":null,"topics":["z80","zx-spectrum"],"latest_commit_sha":null,"homepage":null,"language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suborb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-07T13:34:39.000Z","updated_at":"2023-03-29T19:42:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"656415c7-320a-4d0d-ab51-6723744c7613","html_url":"https://github.com/suborb/slowdos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suborb/slowdos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suborb%2Fslowdos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suborb%2Fslowdos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suborb%2Fslowdos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suborb%2Fslowdos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suborb","download_url":"https://codeload.github.com/suborb/slowdos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suborb%2Fslowdos/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265623031,"owners_count":23800090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["z80","zx-spectrum"],"created_at":"2024-07-29T19:33:09.253Z","updated_at":"2025-07-17T15:35:43.463Z","avatar_url":"https://github.com/suborb.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slowdos\n\nSlowdos v2.x  (hereafter referred to as Slowdos), is an\nextension to +3 BASIC which allows MSDOS discs to be read\nand written from BASIC\n\nAlthough there have already been a couple of programs which can\nbe run on the +3 which allow MSDOS discs to be used, they are\nlimited in scope: The original Slowdos only copied files, and\nMSODBALL (by John Elliot) runs only from CP/M and uses an\nobscure format which could be read by both MSDOS and CP/M.\n\nEnter in here Slowdos, the program which allows all manner of\nfunctions to be performed on MSDOS discs from BASIC.\n\n\n## System Requirements\n\nSlowdos will run on any +2a or +3 (hopefully regardless of\nissue), however for practical usage a +3 with an external\ndisc-drive is recommended.\n\nThe external drive should be double-sided and capable of\nreading 80 tracks ie a DSDD disc-drive. Slowdos has been\ndeveloped with 3.5\" drives in mind, though there is no reason\nwhy it shouldn't work with a DSDD 5.25\" drive.\n\nIt is possible that Slowdos will work with single density\ndrives, although they to all intents and purposes obsolete, but\nI make no guarantees as to data integrity.\n\n\n## The new commands\n\nA definitive list of commands now follows, it is not intented\nto be a tutorial as to how to use them, it is presumed that the\nconcepts behind them is already known from use of the\nequivalent +3 commands.\n\nKey to symbols used:\n\na(n) = 16 bit number \ndd   = drive no 1,2,*\nf    = filename\nu1   = source filename\nu2   = destination filename\nss   = stream number \n\nAll parameters in parenthesis [ ] are optional.\n\n\n### Essential disc filing commands\n\nCAT [#ss,]dd\"f\"\n\nCatalogues a disc, to stream ss (default is the screen), the\nfile name may be wild.  The displayed format is identical to\nthat of a normal +3 drive. NB Hidden (system) files are\nautomatically shown.\n\n\nLOAD Pdd\"f\"\n\nLoad a file from the disc, all the usual BASIC extensions may\nbe used ie CODE, DATA, SCREEN$. In addition the extension S can\nbe used to load a 48k snapshot.\n\nThe snapshot format is the .SNA format, supported by all\nemulators and is the de facto standard for 48k snapshots.\n\n\nSAVE Pdd\"f\"[!]\n\nSave a file to disc, as with LOAD all the usual BASIC \nextensions may be used. If ! is specified before any of the\nBASIC extensions then the file is saved without a PLUS3DOS\ncompatible header\n\n\nMERGE Pdd\"f\"   \n\nMerge a BASIC file on disc with the one in memory\n\n\nERASE Pdd\"f\"   \n\nErase the file f from the disc\n\n\nFORMAT Pdd[!][;\"f\"]\n\nFormat the current disc in DSDD MSDOS format. Confirmation is\nasked prior to formatting. If ! is specified then the disc will\nnot be formatted, but merely initialised. The filename f is\nthe disc name, this is not used by Slowdos, but is provided for\nease of use of Slowdos formatted discs on other machines.\n\n\n\n### Advanced disc commands\n\nERASE Pdd\"u1\" TO \"u2\"    \n\nRename the file u1 giving it the name u2\n\n\nMOVE Pdd\"f\" TO #ss  \n\nCopy the file f to the stream ss, note that file filtering\ntakes place, all character codes below 32 are replaced \nwith a space.\n\n\nCOPY Pdd\"u1\" TO \"u2\"     \n\nCopies the file named u1 on the MSDOS disc to the file named u2\non the default +3 drive. u2 may be a drive in which case u1 can\nbe wild, keeping the original filenames. Note that all the\nfiles saved on the +3 disc will be saved with PLUS3DOS headers,\nand if appropriate the headerdata filled to create files\nloadable by +3 BASIC. The default for unrecognised files of\nlength shorter than 65535 bytes is to be a code file with a\nload address of 0. 48k snapshots are saved as filetype 4.\n\n\nCOPY \"u1\" TO Pdd[!][\"u2\"]   \n\nCopy the file u1 from the default +3 drive to the MSDOS disc.\nIf u1 is wild then omit u2. If the ! parameter is supplied then\nthe files saved on the MSDOS disc will be headerless.\n\n\nLOAD @dd,tt,ss,aa\n\nSAVE @dd,tt,ss,aa\n\nThese commands are used for reading/ writing disc sectors from\nmemory.  tt is the track, 0 - 79 (side 1), 80-159 (side 2). ss\nis the sector number (1-9), and aa is the memory address in\nmemory configuration 5,2,0 (normal configuration)\n\n\nMOVE TO Pdd\"f\"\n\nChange directory, equivalent to the CD command on larger\ncomputers. Inside each subdirectory there are always two\nfiles. A \".\" file which refers to the current directory\nand a \"..\" which points to the parent directory. \n\nA full path may be specifed by stringing directories together\nthus:\n\nMOVE TO pdd\"dir1/dir2/dir3....\"\n\nNote the use of the / not \\ - this is in line with all real\noperating systems, UNIX, VAX, AmigaDOS etc\n\nTo move back to the root directory leave the pathname out or\nmake it null.\n\nOnce inside a subdirectory, usage of Slowdos is not affected,\nit is still possible to load/save/copy/rename etc files.\n\n\n### Compatibility Commands\n\nVERIFY Ddd\"f\"\n\nThis commands are inoperative, they pass syntax to avoid\nproblems with programs that do use them.\n\n\nPOKE @a1,a2    \n\nDoes a 16 bit poke for the entire memory configuration (ROM3,\npages 5,2,7). This command is mainly supplied for small patches\nto Slowdos (should they be needed), however it does have other\nuses - try POKE 60433,col and POKE 60431,col to change the\nediting colours for the top and bottom of the screen.\n\n\n## Accessing Spectrum Emulator Files\n\nSlowdos accesses a number of file formats used by emulators on\nother machines. The most common of these is the snapshot file,\nthe usage of this was detailed above, but to recap:\n\nLOAD Pdd\"f\"S  will load a 48K .SNA file and lock the machine in\n              48k mode.\n\nLOAD Pdd\"f\"S! will load a 48k .SNA but will not lock the +3 in\n              48k mode. If you manage to break out of the\nprogram then the chances are that you will be in 48k mode, but\nyou can return to 128k with Slowdos running via a PRINT USR\n23354. Please note with this that crashes/spurious effects may\nsometimes result whilst using the snapshot due to the fact that\ndata in the printer buffer isn't loaded.\n\nSlowdos also supports the .TAP file format. A TAP file is in\nessence an image of a cassette tape, and is often used to\npreserve the loading screen of a game, it is also used by\nAlchemist Software to distribute Alchnews for use on emulators.\n\nSlowdos treats TAP files as (limited) sub-directories, limited\nin the respect that they are not random access nor can a\nCATalogue be performed. However it is possible to copy files\nout of a TAP file to +3 disc.\n\nTo enter a TAP file use the command\n\nMOVE TO Tdd\"f\"[IN]\n\nPlease note the use of T and not P (as for subdirectories). The\nfilename f must have the extension .TAP.\n\nOnce inside a TAP file the command LOAD P*\"\" may be issued to\nload the first BASIC file found within it. As you may have\ndeduced it is necessary to prefix the filename with a P* - this\nis so as to fail +3 syntax and to pass the command to Slowdos.\nAs a result it should be obvious that any program within the\nTAP which loads files from BASIC will have to slightly modified\n- namely the P* inserted before the filename. I believe that\nthis is a minor inconvenience when compared to the flexibility\nthat being able to access a TAP file provides.\n\nFollowing logically, any program which loads headerless files\nwill not work, however it is possible to copy headerless files\nto +3 disc, and then modify the program so that it does work\non a +3 - in essence converting the program back to its native\ncomputer. The syntax of the COPY command is exactly the same\nas for dealing with normal directories.\n\n\nMOVE TO Tdd\"f\"OUT\n\nThis is a very powerful command which allows files on the +3 to\nexport files for use with emulators.\n\nThe file format used is (not unsuprisingly) the .TAP format, to\nuse it you can either copy files to it, or save files into it.\n\nTo close the .TAP file (when all the files are enclosed) do a\nMOVE TO Tdd. The file will automatically be closed, and the\ndirectory entry written. Please note that if you forget to do\nthis, then the .TAP will not be accessible, but space on the\ndisc will have been allocated.\n\nAs a little note to avoid any potential confusion, if you are\nreading a .TAP file, any writing will take place in the current\ndirectory, and if you are writing a .TAP file any reading will\naccess the current directory (on the MSDOS disc).\n\nUnfortunately due to memory constraints it isn't possible to\ncopy files into a .TAP file from an MSDOS disc (and vice\nversa).\n\n\n## Usage of drives\n\nThroughout the list of commands reference has been made to\ndrive numbers, however, since the +3 only supports one external\ndrive, there is only one MSDOS drive,and thus p1 and p2 access\nthe same physical drive.\n\nAlthough the external drive is used by Slowdos, it is still\npossible to perform +3 DOS functions on the B: drive, though\nobviously it isn't possible to use both drives at the same time\neg copy from B: drive to MSDOS disc.\n\nTo this end, and in order to prevent corruption of +3 discs,\nonly discs which match a template MSDOS disc format will be\nused by Slowdos, which rejects for use as MSDOS disc any\nBFORMAT +3 discs. (Obviously it is possible to reformat these\ndiscs for use by Slowdos).\n\n\n## Error messages\n\nAll of the routines are fully error trapped and will return to\nBASIC with a harmless error message should anything untoward\noccur. In addition the RIC messages from +3 DOS have been\ndisposed of, any errors now result in an error message.\n\n\n## General notes\n\nIt is well known that the +3 has problems driving certain\nprinters. A set of pokes was found which solved the problem,\nhowever these shouldn't be used when Slowdos is installed\n(crashes may result if you do), instead use POKE @49286,16\nwhich will enable these problem printers to work. - Please note\nthat this POKE has changed from earlier versions of Slowdos and\nDiSCDOS.\n\nSlowdos survives the 128k NEW command, and need only be \nreloaded if a reset is performed.\n\nSlowdos occupies the second screen (in page 7), and as such\nnothing should be placed there lest the +3 crash in an\ninteresting manner! It also uses some additional space in page\n7, this doesn't interfere with normal usage of the +3 though it\nmay cause some problems with other programs.\n\n\n## Known bugs/feechures\n\nBecause of the +3 CAT syntax problem any CAT phrase involving a numeric variable will not be able to be entered unless the variable(s) exists. All other comands are unaffected, so the value of remedying it seems dubious.\n\n\n## History\n\nv1.0      Original version of program released back in 1994\n??.8.94\nv1.1      Bug release \n??.12.94\n\nv2.0      Crippled demo version of the new Slowdos\n5.12.97\n\nv2.1      Fully featured version of the new Slowdos\n7.12.97\n(intern)\n\nv2.2      Added .TAP, subdirectory support. Added the ! option\n16.12.97  to snapshot loading. Optimized the code a lot.\n\nv2.3      Added writing to .TAP files, added in system calls\n2.3.98    (see Appendix II), incredible amount of optimization\n          made - some 300 bytes saved! Sorted out erasing of\n          files created on Sparc stations, cleaned up a\n          potential problem in SAVEing of arrays.\n\nv2.4      Full compatibility with +3B Syntax ROM,\n24.2.2001 either english or spanish version\n\n\n\nAppendix I - The snapshot file format\n----------\n\nThe snapshot format supported by Slowdos is the common used\n.SNA format derived from the Mirage Microdriver format. This is\nthe de facto standard for 48k snapshots and is supported by all\nmajor emulators.\n\nThe format of the file is as follows:\n\n```\nOffset         Bytes     Description\n\n0                1         i\n1                2         hl'\n3                2         de'\n5                2         bc'\n7                2         af'\n9                2         hl\n11               2         de\n13               2         bc\n15               2         iy\n17               2         ix\n19               1         Interrupt (bit 2=IFF2 1=EI/0=DI)\n20               1         r\n21               2         af\n23               2         sp\n25               1         Intmode (0=im0/1=im2/2=im2)\n26               1         Border colour\n27               49152     Ram dump (16384...65535)\n```\n\n\nAppendix II - System calls\n-----------\n\nAs of v2.3, Slowdos gives you, the programmer, the ability to\naccess MSDOS discs in a simple way, without having to write\nyour own routines. Via these system calls you can do whatever\nyour imagination allows - for example you could read different\nemulator file formats or you could write a file manager! - It's\nup to you!\n\nAll of the calls, are referenced by calling address 49155 in\npage 7 with l holding the routine number, at the moment, the\nfollowing routines are accessible:\n\n1, r_mslog\n\nEntry parameters:   none\nExit parameters:    standard\n\nLog an MSDOS disc in, read in the FAT, check format\n\n\n2, r_getpar\n\nEntry parameters:   none\nExit parameters:    de=address of header in page 7\n\nGet the address of the file header in page 7, this is 7 byte\nblock ala +3 DOS as is arranged as follows:\n\n```\n|----------------|-----|-----|-----|-----|-----|-----|-----|\n|   Byte         |  0  |  1  |  2  |  3  |  4  |  5  |  6  |\n|----------------|-----|-----|-----|-----|-----|-----|-----|\n|Program         |  0  |File length|8000h/LINE |prog offset|\n|Numeric array   |  1  |File length| xxx |name | xxx | xxx |\n|Character Array |  2  |File length| xxx |name | xxx | xxx |\n|Code            |  3  |File length| load addy | xxx | xxx |\n|Snapshot        |  4  |File length| xxx | xxx | xxx | xxx |\n|Longfile        |  5  |   32 bit file length  | xxx | xxx |\n|----------------|-----|-----------------|-----|-----|-----|\n```\n\n\n3, r_rdopen\n\n```\nEntry parameters:   ix=ufia\nExit parameters:    standard\n```\n\nOpen a file on the MSDOS disc for reading. If the file has a\nstandard +3 header, then this header is recognized, and the\nheader block filled out accordingly. If no header is present\nand the file is \u003c65536 bytes, then a header is faked such that\nit is a CODE file with load address 0.\n\n\n4, r_rdbyte\n\n```\nEntry parameters:   none\nExit parameters:    a=byte\n```\n\nRead a byte from the currently open file.\n\n\n5, r_rdblok\n\n```\nEntry parameters:   de=address to load to\n                    bc=number of bytes to read\n                     h=page to load to\nExit parameters:    none\n```\n\nRead a chunk of code from the currently open file to memory in\nthe page given by h\n\n\n6, r_wropen\n\n```\nEntry parameters:   ix=ufia\nExit parameters:    none\n```\n\nOpen a file for reading, if the filetype in the ufia is specified as type 5, then no +3DOS style header will be created.\n\n\n7, r_wrbyte\n\n```\nEntry parameters:   a=byte to write\nExit parameters:    none\n```\n\nWrite the byte in a to the currently open file\n\n\n8, r_wrblok\n\n```\nEntry parameters:   de=address of block\n                    bc=length of block\n                     h=RAM page\n```\n\nWrite a block of memory to disc\n\n\n9, r_wrclos\n\n```\nEntry parameters:   none\nExit parameters:    none\n```\n\nClose the currently open file, write the directory entry and\nFAT.\n\n\n10, r_erase\n\n```\nEntry parameters:   ix=ufia\nExit parameters:    none\n```\n\nErase the files specified by the ufia - may be wild\n\n\n11, r_snpload\n\n```\nEntry parameters:   none\nExit parameters:    none\n```\n\nLoad the currently open reading file as a snapshot file, and\nexecute accordingly.\n\n\n12, r_mscat\n\n```\nEntry parameters:   ix=ufia\nExit parameters:    none\n```\n\nCatalogue a disc directory matching the specifications of the\nufia.\n\n\n13, r_mscatmem\n\n```\nEntry parameters:   ix=ufia\n                    de=address to place catalogue\nExit parameters:    none\n```\n\nCatalogue the disc to an address in memory - make sure you\nhave sufficient room for the catalogue!!! Initialise the memory\nwith 0 before hand!!!\n\nThe format of the data supplied by the disc is unsorted and\nis as follows:\n\n```\nbyte 0    - number of files in directory (0-255)\nThe filename information is as follows:\n     ds   11   - filename (without the \".\")\n     ds   1    - directory flags\n     ds   2    - first cluster\n     ds   4    - file length (32 bit)\n```\n\n- As can be seen, each directory entry requires 18 bytes of\nspace - this can amount to a lot - the routine does not respect\nRAM pages so if you're not careful you could overwrite the\nSlowdos code.\n\n14,  r_seldir\n\n```\nEntry parameters:   de=path name\n                    bc=length of path name\nExit parameters:    none\n```\n\nMove to the directory described by that in de\n\n\nNotes:\n\nIf successful all of the routines will return with carry set,\nif unsuccessful, carry will not be set, and a will hold the\n\"rst 8\" error code - apologies for this, but memory is very\nmuch at a premium!\n\nThe ufia (User File Information Area) is 20 bytes long and is\nordered as follows:\n\n```\n     +0   db   drive (0,1) (irrelevant)\n     +1   db   stream (for r_mscat)\n     +2   ds   filename (12 characters including \".\")\n     +14  db   directory flags (irrelevant)\n     +15  db   filetype                 }\n     +16  dw   filelength               } +3 header info\n     +18  dw   start address/LINE/name  }\n     +18  dw   offset to BASIC          }\n```\n\n\nAppendix III - Bonus program, Snapconv\n------------\n\nSnapconv is small program for the +3 which decomposes snapshot\nfiles into smaller files that can be reconstructed to create a\n+3 BASIC loadable program.\n\nTo use it, simply copy a snapshot file from an MSDOS disc the\ndefault +3 drive, for practical purposes this must be A:.\n\nIf Snapconv is then loaded and the snapshot named entered, the\nsnapshot will be decomposed into 4 separate files, with\ndifferent extensions, but the same filename as the snapshot,\nthese files are as follows:\n\nExtension      CODE parameters         \n\n     .0            0,27    The registers detailed in Appendix I\n     .1        16384,6912  Screendump\n     .2        23296,1280  Printer buffer/BASIC area\n     .3        24576,40960 Main code\n\nIt is then up to you to use the parts as you desire!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuborb%2Fslowdos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuborb%2Fslowdos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuborb%2Fslowdos/lists"}