The DOS Wedge is a small program to ease the use of a Commodore disk drive. It has the following properties:
- The error status of a disk drive can be read with one floppy command.
- The directory of a floppy disk can be listed without overwriting an existing BASIC program.
- A compact command syntax allows sending of drive commands.
C64 DOS Wedge[edit | edit source]
The DOS Wedge for the C64 was programmed in machine language by Bob Fairbairn. It uses the memory area $CC00–$CFFF (52224–53247).
Loading[edit | edit source]
The BASIC program "C-64 Wedge" of the test-/demo diskette (1541, 1570/1571) is loaded and run with:
LOAD "C-64 WEDGE",8
- After that "C-64 Wedge" loads the machine code into the memory at $CC00 (52224) and runs it.
- Finally the start screen shows "DOS MANAGER V5.1".
The new commands[edit | edit source]
> can be used alternatively to @ to begin a floppy command. A value in square brackets is optional.
|@||Display the error status (see also STATUS). Attention: The disk drive must be ready or the command will hang!|
|@$||List the directory without overwriting the memory.|
|@#devno||Set the current device number of the disk drive to devno, for e.g. @#8 or @#9.|
|/filename||Load the BASIC program filename.|
|↑filename||Load and run the BASIC program filename.|
|%filename||Load the machine code program filename.|
|←filename||Save the BASIC program filename.|
|@diskcommand||Send a drive command, e.g.|
@N:diskname[,id] - Format a disk (NEW). Without id only the directory is cleared, aka fast format.
|@Q||Deactivate the Wedge.|
Remarks[edit | edit source]
- Similar to standard BASIC commands the new commands can also be used in a BASIC program.
- Leading spaces are ignored.
SYS 52224activates the DOS Wedge again after deactivation by
- When you want to use the DOS Wedge commands in your programs the name of the disk command following the @ prefix must be enclosed by quotation marks, e.g.
- The commands of the DOS wedge practically became a standard and are included in the command set of many floppy speeders in extended or improved form. Also some machine language monitors picked up the '@' syntax.
Internal details[edit | edit source]
The wedge patches the CHRGET routine in the Zeropage, where every character that is processed by the BASIC interpreter is checked. If it is a command of the wedge the corresponding DOS wedge routine is called.
On the left is the SMON disassembler listing. On the right in the comment are the original values.
,0073 E6 7A INC 7A ,0075 D0 02 BNE 0079 ,0077 E6 7B INC 7B ,0079 AD 08 02 LDA 0208 ,007C 4C F3 CC JMP CCF3 ;,007C C9 3A CMP #3A ,007F 0A ASL ;,007E B0 0A BCS 008A ,0080 C9 20 CMP #20 ,0082 F0 EF BEQ 0073 ,0084 38 SEC ,0085 E9 30 SBC #30 ,0087 38 SEC ,0088 E9 D0 SBC #D0 ,008A 60 RTS
Jump back to the CHRGET routine:
,CD1E C9 3A CMP #3A ,CD20 B0 03 BCS CD25 ,CD22 4C 80 00 JMP 0080 ; CHRGET Rest run ----------------------------------- ,CD25 4C 8A 00 JMP 008A
Articles[edit | edit source]
- 64'er special issues SH05 (1986, site 111): "Das DOS 5.1 auf der Demo-Diskette" (German computer magazine)
- Macro Assembler Development System (chapter 5.0)
Links[edit | edit source]
- Commodore 64 Reference Guide PDF
- project64.c64.org: "COMMODORE 64 MACRO ASSEMBLER DEVELOPMENT SYSTEM" look at chapter 5.0
- atarimagazines.com: "Commodore DOS Wedges: An Overview"
- project64 unusedino.de :"MAPPING THE Commodore 64" look CHRGET
- CBM 2040/3040/4040/8050 Disk Drive Manual (PDF)
DOS Wedge enhanced: