Hooking Up DOS Wedge To PETs With Power
Elizabeth Deal
Malvern, PA
Here is a cookbook procedure that allows the use of Commodore's DOS support and/or the Universal Wedge with PETs equipped with Professional Software's Power. It is only for Upgrade PETs. BASIC 4.0 systems don't really need the Wedge.
Follow These 6 Steps Once:
1. Reset the PET and turn POWER on with the usual SYS9*4096. 2. Load the Wedge program. Then get into the monitor with SYS4. 3. Make the listed changes, being careful to make only the changes appropriate for your version of the Wedge program: Old DOS-SUPPORT needs a change in the contents of $0749/A, $074E/F and $0798/9 from 00 76 to FE 97 (jump to Power instead of the CHRGOT routine). It also needs a replacement of the four bytes at $072C to $072F from the existing C9 40 F0 0D to EA EA EA EA (to disable the ‘@’ key). Universal Wedge needs changes in the contents of $0549/A, $054E/F and $0598/9 from 00 76 to FE 97, and replacement of the four bytes at $052C to $052F from C9 40 F0 0D to EA EA EA EA. Remember to push RETURN after each change so your PET can hear you. 4. Save the program under a different name, "PDOS" perhaps. 5. Now RUN the Wedge. If the PET crashed, go back to step 1. 6. Get into the monitor once again and ask for bytes $0070 to 00723 (.M 0070 0072). Write down the two bytes that follow 4C and don't lose the note. This is the wedge's address in 6502 format, low byte first.
In The Future:
Turn Power on, load your newly created wedge, RUN it in the usual fashion, and always remember to write down the contents of $0071/72. (You may need this later, as we shall see.)
What's Happening?
After Power has been set up, we take over and tell the PET to check our Wedge routine before it goes to Power. That's done by the change in $0070/71. In three cases (no recognized wedge command, error channel read and utility commands), the Wedge routine formerly exited to the CHRGOT subroutine ($0076). We force it to go to Power with JMP $97FE (six bytes beyond the start of Power), which is the very change you made in three places to the Wedge code. Printing the directory, load and load/run sections remain intact.
Finally, we eliminate the ‘@’ key from Wedge's repertoire in order to leave it for a more important task in Power's search routine. We did it by replacing four consecutive bytes with $EA (NOP) to skip that code. The ‘>’ (greater than key) and all others remain unchanged.
Assorted Notes
This is just one of many ways the hookup can be achieved. It loosely follows the instructions on page 62 in the Power manual. I think a better way is that described on page 63. However, the method presented here is the simplest to understand and explain. The method on page 63 requires some fiddling with the Wedge code and would require more typing on your part.
You have to remember the address of the Wedge, which is in the two bytes you jotted down. You can use instant key REM macros for remembering them. The reason is that if you use Power's FIX command, Power will stick the old values (its own address) into the CHRGET routine ($0070) and you will have to change them back to point to the Wedge.
If you use the OFF command, Power will replace your address with the regular CHRGET code, also disabling the Wedge. It's best to leave the Wedge disabled until Power is turned on again. Otherwise, if you enable the Wedge by changing the values in the CHRGET routine you will ultimately end up in Power, since that's where we told the Wedge to go when its done. For the same reason you should not use this version of the Wedge if you don't plan to use Power.
Extra Note On The Wedge
I have written recently that the Universal Wedge overshoots its correct loading boundaries when it is RUN. I also incorrectly stated that the old DOS-support does not. Sorry! Both programs do it. The reason is that, as coded, two pages (512 bytes) of code are moved to high memory but the code reserves only enough room for the Wedge code (359 bytes). You can write your own mover as a fix. If not, and if you are loading the Wedge to a place other than near the top of memory you may want to lower the top of memory pointer to accomodate the entire program, otherwise you'll wipe out whatever code you have already placed above the Wedge. This can be done by entering FF in place of 67 in byte $08B2 in the DOS support, or in byte $066B in the Universal Wedge, if you have the room.