!pr2
!lm12
!rm75
Quick Way to Write DOS on a Disk..............Bob Perkins
                                          Tussy, OK 73088

I just received the July AAL and liked the little article on the "FILEDUMP" command.  I had already done just about the same thing.

In fact, I make a lot of changes to DOS.  Too many to POKE in every time I boot up.  So I started looking around for a simple way to replace the DOS image on a disk without disturbing the programs already on it, and without using MASTER.CREATE.  The July Call A.P.P.L.E. had a program to do it, only it seems much more complicated than my solution.

I used the S-C Macro Assembler to create a text file like this:

!lm+5
:1000  LOAD HELLO
:1010  POKE -21921,0:POKE -18448,0:POKE
-18447,157:POKE-18453,0:CALL-18614
:TEXT WRITE.DOS
!lm-5

Note the leading blank before the LOAD and the first POKE.  It is there to leave room for Applesoft's "]" prompt.

Whenever I want to write the DOS image on a disk, I use the SHOW command to list out WRITE.DOS, and then trace over the two command lines from Applesoft.  Presto-Changeo, a new copy of DOS  goes out to the disk.  I suppose you could even EXEC it, though I prefer to trace over it and haven't tried EXECing.

The LOAD HELLO is there to get the boot file name into DOS's filename buffer.  You can use whatever filename you want, of course.  POKE-21921 tell DOS that the last command was an INIT for its startup procedure (i.e. AA5F:00).  POKE-18448 and -18447 start the write at 9D00 (B7F0:00 9D).  POKR -18453 sets the expected volume number to zero, so a match to any volume will occur (B7EB:00).  The CALL is to the "write DOS image" code inside DOS.
