module
29

With XtalDOS loaded. Every call: function number in C, then CALL 5. 0005h holds JP EC00H.
| Byte | Holds |
|---|---|
| 0 | Drive: 0 current, 1 drive 0, 2 drive 1 |
| 1-8 | Name, capitals, padded with spaces |
| 9-11 | Extension, padded with spaces |
| 12 | Extent (filled by open) |
| 14 | 80h after an open (the BDOS's own) |
| 15 | Record count of the extent (filled by open) |
| 16-31 | Block numbers, 16-bit, low byte first (filled by open) |
| 33-35 | Record number for read/write random, low byte first (35 = 0) |
| C | Call | Give it | Get back in A |
|---|---|---|---|
| 2 | Print a character | E = character | |
| 9 | Print a string | DE = text ending $ (not printed) | |
| 15 | Open | DE = FCB | FFh not found; else 0-3 (the entry's place among four) |
| 16 | Close | DE = FCB | 0-3 |
| 19 | Delete | DE = FCB | 0; FFh not found. Sets byte 0 of every entry to E5h, nothing else |
| 20 | Read sequential | DE = FCB | 0 read; 1 end of file. Moves to the next extent itself |
| 21 | Write sequential | DE = FCB | 0 |
| 22 | Make | DE = FCB | 0-3. The entry is listed at once, empty until closed |
| 23 | Rename | DE = FCB, new name from byte 16 (byte 16 = 0) | 0; FFh not found. Renames every extent |
| 26 | Set DMA address | DE = address | Reads and writes use 128 bytes there. 0080h when a program starts |
| 33 | Read random | DE = FCB, record in 33-35 | 0 read; 1 no such record; 4 no such extent |
| 34 | Write random | DE = FCB, record in 33-35 | 0. Past the end lengthens the file |
CP 0FFH, never OR A.No Sector 1: / Try Again(Y/N)? (N abandons your program), No Drive 1: / No.(0-3)?. Your program gets no error code..dsk fails (Bad Data 1:); use an .mfi.| Address | |
|---|---|
| 0000h | JP FA03H: JP 0 restarts the DOS and restores the CCP |
| 0005h | JP EC00H |
| 0080h | Default DMA address |
| 0100h | Your program, loaded and called here |
| E100h-EBFFh | The CCP. Your entry stack (EB18h) and return address (EAD9h) are in it: leave it alone if you end with RET |
| EC00h | The BDOS |
This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.