Optimized BW-DOS by DMSC

March 3, 2024 · View on GitHub

This is a fork of the original BW-DOS sources, converted to MADS assembly syntax and with modifications by HolgetJanz and DMSC.

The main changes from BW-DOS 1.3 to this sources are described bellow.

There is a makefile to assemble all sources, just type make to generate all the bianry files in the build/disk folder and build and a disk image using the mkatr tool.

Changes from BW-DOS 1.3

Changes to the resident DOS and command processor

  • Reduced memory usage: new version has MEMLO at $1E9D, 43 bytes less than the original. Also, the disk file is 181 bytes shorter.

  • Modern syntax for the commands.

    Internal commands are renamed to modern ones,

OriginalNew
RENAMEREN
ERASEDEL
PROTECTPROT
UNPROTECTUNPROT
CREDIRMD
DELDIRRD
CWDCD
LOADLOAD
CARCAR
RUNRUN
PRINTPRINT
TYPETYPE
DIRDIR
DIRSDIRS
BASICBASIC
  • Adds MAN command, same as TYPE, allows reading on-line documentation.

  • Always disable BASIC on startup for the XL/XE computers, so it boots directly to the command processor if no external cartridge is present. This means that you need to type BASIC ON and then CAR to run BASIC.

  • Move COMTAB to page 7, at absolute address $726. This allows programs specifically written for BW-DOS 1.4 or newer to call the API directly.

  • Size optimizations in many areas, obfuscation in the binaries removed and simplified the loader.

  • The version is shown as 1.4D, 1.4 is the modifications by HolgetJanz.

  • Fixed some minor bugs:

    • Improve performance of sector allocation for overwrite cases.
    • Don´t accept @ as 9 when parsing hexadecimal numbers.
    • Avoid screen corruption when enabling BASIC.
    • Fixes detection of RAMBO XL 256k expansion in RAMDISK handler.

Optimization to the resident commands

Many of the external commands are reduced in size, both in disk and in the resident size after installation, for example, RAMDISK now only uses 31 bytes of low RAM and XFSIO only 103.

CommandOriginal Size / ResidentNew Size / Resident
ARGSPRN1484 / 1581446 / 158
ARGSRTC1388 / 2701346 / 270
AUTOCWD731 / 74639 / 74
CLOCK1069 / 210821 / 151
DOSDRIVE986 / 108876 / 70
KEYBUFF1066 / 278825 / 183
RAMBOX1746 / 341658 / 34
RAMDISK2165 / 732014 / 31
RTIME81316 / 94 (213)1120 / 91 (199)
XFSIO1074 / 115925 / 101
XLRDISK1341 / 731274 / 31

Optimization to the external commands

Many of the external commands are reduced in size:

CommandOriginal SizeNew Size
BACKUP46174611
BLOAD487377
BOOT605511
CHKDSK470434
CHVOL344301
COPY13061142
CUT702628
DATE661509
DIRMAST26822252
DISASS16031179
DUMP783600
ELSE243166
ENDIF99
FORMAT27842652
HEXEDIT728558
IF442308
MDUMP554382
MEM620503
MEMEDIT502366
MENU98839695
MOVE17361520
MSDOS23102292
MSINI19161565
NEWED422364
OFFLOAD935829
PAUSE273150
SAVE466381
TIME659511
UNERASE15241498
VERIFY227197
XBAT315238

Extra external commands

Currently, the new external commands are:

  • PWD: shows the current (default) path in the given drive.