Book of Softkeys Volume 1

download Book of Softkeys Volume 1

of 162

Transcript of Book of Softkeys Volume 1

  • 8/14/2019 Book of Softkeys Volume 1

    1/162

    Ha ..dco ..e COMPUTIST's

    Book 01 SoltkevsVolulDe I

    SoltKey Pub l i sh ing

  • 8/14/2019 Book of Softkeys Volume 1

    2/162

    Welcome to the Book Of Softkeys, apublication devoted to the serious user ofApple ][ and Apple ][ compatiblecomputers. The articles published in thisvolume detail the removal of copyprotection schemes from commercial disksor contain information on copy protectionand backup methods in general.

    Our editorial policy is that we do NOTcondone software piracy, but we do believethat honest users are entitled to backupcommercial disks they have purchased. Inaddition to the security of a backup disk,the removal of copy protection gives theuser the option of modifying applicationprograms to meet his or her needs.

    Entire contents copyright 1985 by SoftKey Publishing. All rights reserved. Copyingdone for other than personal or internal reference (without express written pennission fromthe publisher) is prohibited. Any opinions expressed by the authors are not necessarily thoseof Hardcore COMPUTIST or SoftKey Publishing.Apple usually refers to the Apple II series computer, and is a trademark of Apple Computers, Inc.

  • 8/14/2019 Book of Softkeys Volume 1

    3/162

    General Information:Applesoft Disks (Softkey To) " 9Some general pointers on how to find Applesoftprograms loaded by non-standard DOS disks.Boot Code Tracing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 22There's no protecting against this method of diskcracking.Boot Code Tracing Revisited " 27Take another look at how to trace a program as itloads into memory.Demuffins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Make this handy disk cracking tool from a program

    supplied by Apple.Diskedit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 43Read, Write and Edit sectors on any DOS 3.3 disk.It's easy with this program.Diskview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 84A mini-nibbler that reads raw nibbilized data fromany disk, regardless of format.Getting On The Right Track. . . . . . . . . . . . . . . . . . . . . . . . . . .. 99Here's how to tell what track your read/write head ispositioned over. A real help on those difficult copies.Hidden Locations Revealed. . . . . . . . . . . . . . . . . . . . . . . . . . . . 106Take a peek at these favorite locations used byprotected software.(A Fix For) RANA Drive Owners. . . . . . . . . . . . . . . . . . . . . . 130A way to boot code trace on a Rana drive.Tricks & Bombs , 139

  • 8/14/2019 Book of Softkeys Volume 1

    4/162

    Contents

    152155156

    141147149151

    Sammy Lightfoot .Screenwriter IT .Sneakers .Spy's Demise .Starcross .Suspended (see Zork I)Ultima ][ .Ultima ][ (2) .VisifIle .Visiplot/Visitrend .Witness (see Zork I)Wizardry .Wizardry (2) .Zork I, Zork IT, Zork 1lI " '\ .

    )

    SoftkeysAkalabeth. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Ampermagic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Apple Galaxian (see Boot Code Tracing)Aztec , , . . . . . . . .. . .. . . .. . . 12Bag Of Tricks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Bill Budge's Trilogy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Buzzard Bai t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Cannonball Blitz. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Casino '" " . . . .. . . .. . . .. 38Data Repor ter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Deadline (see Zork I)Disk Organizer IT (see Hidden Locations Revealed)Egbert IT Communications Disk. . . . . . . . . . . . . . . . . . . . . . . . . 89Hard Hat Mack 101Home Accountant.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110Homeword , 112Lancaster. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 113Magic Window IT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 115Multi-Disk Catalog (see Boot Code Tracing Revisited)Multiplan. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119Pest Patrol. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120Prisoner IT.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 129

    131133135136137

  • 8/14/2019 Book of Softkeys Volume 1

    5/162

    ~ A k a l a b e t hCalifornia Pacific ComputersRequirements:Apple][ 48KOne blank diskMUFFIN (from DOS 3.3 master disk)By BobbyAkalabeth is a hi-res adventure/maze/treasure hunt gamedistributed by California Pacific Computers. It has a few bugsthat need correcting. Here is a method of "down-loading"Akalabeth from its protected diskette so that you can make theFIXes described in Softfix and additions.

    1) Boot from the DOS 3.3 master diskPR#62) Remove the master disk, insert the blank disk and enter thehello program10 PRINT CHR$(4) "RUNAI*******************

    *******1" :REM THERE ARE 26 ASTERISKS3) Initialize the blank disk with the new hello programINIT HELLO

    4) Remove the initialized disk, insert the master disk and loadMUFFINBLOAD MUFFIN

    5) Make the following changes to allow MUFFIN to read theprotected diskPOKE 4257,6POKE 6664,222POKE 6685,181POKE 6742,217POKE 6774,222POKE 6795,173POKE 6834,2176) Now start MUFFIN and follow the prompts to copyAkalabeth. Use the initialized disk for the destination disk.CALL 2051

    6) To play the game, simply run the hello program.

  • 8/14/2019 Book of Softkeys Volume 1

    6/162

    SoftrlX & AdditionsOne of the reasons for removing programs and files fromcopy-protected disks is that you can now fix them, alter them,and even make additions to them. In other words, you can now

    customize them to fit your particular needs.Since you have already "freed" Akalabeth from its"protected" disk, you can now fix its annoying scrollingproblem and add a new magical command.PROBLEM: The "hit points" of the foes you are fightingoften flash (scroll) by so fast that you can't see what they were

    and therefore cannot make a valid combat decision.FIX: Put in a pause after it prints the hit points. There areother minor fixes that modify screen format, greetings andfarewells (Quit has been changed to eXit).SPECIAL MAGICAL ADDITION: TELEPORTATION

    To help the brave Magi descend into, and ascend out of, theforbidden depths of this World of Doom, we have added aspecial teleportation option. (Use only if you have I or moremagic amulets because this option "bums up" amulets just as ifyou had used the Magic Ladder-Up or Ladder-Down commands.)When you choose the 5th option: TELEPORT, you'll get:I-UP 2-DOWN. Take your choice. I f you choose UP you willcontinue upward until either you surface or you run out ofamulets and get an: OUT OF MAGIC message. Choose DOWNand you'll be asked: HOW MANY LEVELS? It is a GETstatement, so choose a number from I to 9 and don't bother tohit "return". I f you run out of magic now, you're really in aWorld of Doom!Here's how to add the teleport command to your deprotectedakalabeth disk.

    1) Load the file "MAIN PROGRAM"LOAD MAIN PROGRAM

    2) Enter the BASIC program on the next page.3) Save the changed program back to the diskSAVE MAIN PROGRAMThat's all there is to it. I f you know of another fix or additionto Akalabeth or for any prepackaged programs on the market,(whether they are on protected disks or normal format disks),drop a note to SoftKey Publishing and we'll let other apple-users

    know about it.

  • 8/14/2019 Book of Softkeys Volume 1

    7/162

    BASIC program to add teleport option1664 PRINTM$(MN) "'S'HIT'POINTS=" MZ%(MN ,1) : FOR QS =1TO 500: NEXT1682 PRINT "1-Upu 2-DNu 3-KI LLu 4-mu 5-TELEPORT" : GET Q$ :Q =VAL (Q$ ) :PR INT Q: IF Q5THEN 16821685 ON QGOTO 1686 11690 11691 11692 ,18001800VTAB21: CALL-958: PRINT "1-Upu 2-DOWN'''; : GETQ$ :00= VAL (Q$) :

    PRINT 00 : IF 00 2THEN 18001810 ON 00 GOTO 1820 118401820 IN = IN -1 : PRINT CHR$ (7) : IF IN =1THEN 15811822 IF PW(5) .75 THtN PW(5 ) =PW(5 ) - 11826 GOTO 18201840 PR INT "HOW'MANY'LEVELS?'" ; : GET Q$ :00 =VAL (Q$) : PR INT 00 : FOR QS=1TO 00 :IN= IN +1 : IFRND (1 ) > .8THEN PW (5 ) =PI'/ (5 ) - 11844 IF PW(5 )

  • 8/14/2019 Book of Softkeys Volume 1

    8/162

    ~ A m p e r - M a g i cAnthro-DigitalRequirements:48K Apple or an Apple lieAmper-MagicOne blank diskApple's COPYA programText file editor (AppleWriter II, Apple's EDASM, etc.)A Disk Edit utility (THE INSPECTOR or WATSON.)FIXCAT from "Bag of Tricks" and FlO are also useful.By Bob BragnerAmper-Magic is a disk library of machine-language routinesthat can be easily attached to Applesoft programs thus providingextensions to BASIC such as PRINT USING, SWAP, DELETEARRAY, INPUT ANYTHING and many, many more. Theroutines are connected to Applesoft through the ampersand "&"

    and it is easy to pass parameters. There is also a second disk ofroutines available dealing largely with screen formatting.I f you do any serious programming in Applesoft and find thelanguage too slow for some applications but the thought ofwriting your own machine language routines to speed things upmakes your head hurt, then Amper-Magic is for you.This program is super-friendly and comes with a well thought

    out loose-leaf manual. The price is a little steep, however. I paid$67 for my master and another $15 to be a "RegisteredCommercial Owner." Such registration entitles you to automaticnotification in case the manufacturers add any corrections orimprovements and also authorizes you to use the Amper-Magicroutines in any commercial applications you may write. Havingpaid this one-time fee, your only other obligation is to mentionAnthro-Digital's name in the documentation of any programusing their routines. Fair enough. More than fair: generous.However, I did balk at the $7 price tag on the backup disk.That's about $4 more than I'm willing to pay for such anecessity. But I like lots of backups, so I set about making them.To my dismay I discovered that not only is Amper-Magicprotected, it is protected in a very ingenious, and potentiallydangerous, way. Actually, it is mentioned nowhere that the diskis protected and you are nowhere warned not to write anythingonto the master disk. This is not friendly.Amper-Magic has several levels of protection. You can copythe disk with Apple's COPYA without a hitch, but the resultwon't work. When you attempt to EXEC t h ~ m a i n controltextfile as directed, the disk drive turns on anq stays on.

    Book of Softkeys Vol. I 4

  • 8/14/2019 Book of Softkeys Volume 1

    9/162

    Hitting reset will lock up your machine. The only w ~ : y ~ out arecontrol/open Apple/reset or tum-the-machine-off-then-on.'An examination of the controlling text fIle called Amper-Magicshowed, among other things, the following:FF$ = "A" : FOR I = 1 TO 29 : FF$ = FF$ + CHR$(8): NEXT IPRINT CHR$(4); "BRUN"FF$DEL 1,0RUNFor you newcomers, CHR$(8) is the backspace on yourkeyboard (ElH). It's been so long since anyone used controlcharacters to conceal fIlenames in catalogs that it never evenoccurred to me to look for them. This particular trick causes thefIlename to be written over by the next one in the catalog, thusrendering it invisible. Cute.Changing the fIle's name to something more respectable (onthe copy, of course), I proceeded to examine the binary fIle nowsimply called "A".This is a 288-byte file that lives at $25B. The code is notdifficult to disassemble, but it was doing some strange things. Itappeared to look for 14 bytes in track 0, sector 0, and tocompare them with a table in memory. I f they matched, and if anumber of other conditions were met, then another programcalled "AMPER.MAGIC PROGRAM" was loaded. Otherwise,program "A" hung up. Since program "A" did a jump to thestandard DOS LOAD command, AMPER.MAGIC PROGRAMhad to be somewhere in the catalog track (track $11) and it hadto be in the VTOC. But it wasn't.Call up WATSON or THE INSPECTOR and do a sector-usemap of your Amper-Magic disk. Now look at sector $F of track$11 and backstep through the catalog. In sector $C you will seethe "A" fIle whose name contains 29 inverse "H"s (it's at track$21, sector $08.In sectors $B and $A you will see some deleted Applesoft fIleswith odd names like NILO and NILl which seem to have beenused to overwrite other deleted binary files with names like"REPEET" and "RWTS.O." They contain (meaningless?) datastatements. When you get to sector $9, you will see that the linkto the next catalog sector (8) is missing! Hmm... To DOS thismeans that this is the end of the catalog.Backstep once more and all at once the words"AMPER.MAGIC PROGRAM" are staring at you from sector$8. This program appears to start at track $OF, sector $F. Checkit out; it does.Backstep some more. Notice that the link in sector $2 ismissing. Now look at sector 1 and you will find yourself lookingat what must be a VTOC! "But VTOC's are supposed to be in

  • 8/14/2019 Book of Softkeys Volume 1

    10/162

    sector 0," I hear someone say. I don't? Well, anyhow, there is abyte in DOS called READ/WRITE VTOC BUFFER. It islocated at $BOOD (45069) and it normally contains a O.Just for fun, try poking the value 1 there and type"CATALOG" with an ordinary disk in the drive. (For a lot offun, poke in a number greater than 15!) Unless the disk has hada great many file names on it at one time, this track will usuallybe empty and your catalog will have disappeared. I f any filenames have been stored in this sector, CATALOG will displaysome quaint garbage since DOS will attempt to interpret what itfinds there as a VTOC. Place your AMPER.MAGIC master inthe drive, do a POKE 45069,1, then CATALOG and you willsee the hidden file.Returning to a more careful examination of the disassembledcode of A", it turns out that this program does indeed store a1 at $BOOD before it attempts to load the AMPER.MAGICPROGRAM. The latter program, for its part, pokes a 0 backinto that location so it can get at the routines stored on the disk.The reason this method of copy-protection is dangerous, asidefrom the fact that you don't know it is there, is that the normalVTOC at sector 0 may not know anything of AMPER.MAGICPROGRAM. I f it thinks the sectors it occupies are unused, andif you try to save something on the disk, DOS will cheerfullywrite allover the hidden program. Moral: Never write anythingto a master disk, even i f the manufacturer doesn't tell you not to.Additional examination of "A" reveals that the whole routinecan be bypassed. The program checks to see whether or not it isrunning on an original disk and whether or not an EXEC file isin operation. Finally, it doctors the VTOC and loads the hiddenprogram. A quick examination of AMPER.MAGIC PROGRAMshows that it makes no attempt to protect itself once it isrunning.Here is a step-by-step procedure to crack AMPER-MAGIC(the commands to type in are given in bold):1) Copy the master disk using normal COPYA proceduresRUN COPYA

    2) Point DOS to the VTOC on sector 1POKE 45069,1

    3) Catalog the diskCATALOG

    4) Load the AMPER.MAGIC PROGRAM fileLOAD AMPER.MAGIC PROGRAM

  • 8/14/2019 Book of Softkeys Volume 1

    11/162

    5) Unlock the AMPER.MAGIC PROGRAM fileUNLOCK AMPER.MAGIC PROGRAM

    6) Delete the AMPER.MAGIC PROGRAM fileDELETE AMPER.MAGIC PROGRAM

    7) Point DOS to the VTOC on sector 0POKE 45069,0

    8) Catalog the disk againCATALOG

    9) Save the AMPER.MAGIC PROGRAM fileSAVE AMPER.MAGIC PROGRAM

    10) Unlock the EXEC text file AMPER.MAGICUNLOCK AMPER-MAGIC

    II) Bring up a text file editor such as AppleWriter lIe, AppleEDASM, etc.12) Load AMPER-MAGIC into the editor.13) Insert the word "REM" at the beginning of the line thatreads PRINTCHR$(4);"BRUN"FF$.14) Insert the following:

    CHR$(4)"LOAD AMPER.MAGIC PROGRAM"before the last line in the file (the one that says "RUN").15) Save this as a text file under the name AMPER-MAGICSAVE AMPER-MAGIC16) Exit the editor.You now have a de-protected copy of Amper-Magic fromwhich you can make all the working backups you want usingnormal copy procedures.You're not quite done yet, though, because the disk's catalogis still a bit messed up. To manually restore the missing linksyou can use WATSON/THE INSPECTOR (and zero out theextra VTOC at track $11, sector 1) or you can run the FIXCATutility in "Bag of Tricks" and let it do the work for you.You really should repair the catalog if you intend to use FlO

    to move files off of, or onto, the deprotected disk. I f you useFIXCAT you should ignore the temptation to restore the deletedfiles since most of them have been written over.There is, however, a strange little Applesoft program notlocated at track $10, sector $E (its track/sector list is in sector$F). Restore this program and call it "WEIRD HELLO", thenrun it for an odd message.7 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    12/162

    By the way, Volume 2 of Amper-Magic is unprotected and canbe copied without any fooling around. I like to FID all its binaryflIes over to the deprotected master since both disks are mostlyempty space anyhow.Do you want to add more routines to the library? Move

    everything to a hard disk or a Ram Pseuodisk? Eliminate theannoying beeps in the main program? With your unprotectedversion of Amper-Magic you are now free to make anymodifications you wish.

    Book of Softkeys Vol. I 8

  • 8/14/2019 Book of Softkeys Volume 1

    13/162

    ~ S o f t k e y To Applesoft DisksBy Bobby

    I f the program you have is working to your satisfaction, thereis really no reason to go through the trouble of "unlocking" thecopy-protection. I recommend that everyone obtain a bit-copyprogram and use it to backup their software. The methodsdescribed here are for programs that you feel need FIXing. Inorder to FIX them, you have to be able to list them.Another reason for putting programs on normal DOS is toconserve disk space by placing more than one program on adisk. I f you just make a bit-for-bit backup of ten disks, you nowhave 20 disks. However, by "downloading" the protectedprogram to normal DOS, you can probably put all ten on two orthree one-sided disks.The Open-Heart Surgery Method

    Requirements:Apple ][+ 48KApplesoft in ROMInteger cardTape recorderOne blank initialized disk (3.2 or 3.3 as appropriate)This method is not for beginners. It requires some knowledge

    of programming and involves a number of monitor commands.An understanding of Zero Page locations is helpful.No matter what has been altered, this method will workbecause the computer must know the program location in orderto RUN it. The following locations apply to Applesoft in ROMand 48K DOS. They are used by the computer to tell it wherethe program is located and what to do with it. Multibyteaddresses are given in standard format (e.g. hex lo-byte,hi-byte).$D6 is the RUN flag. Any time this byte has the high bit set, theprogram in memory will auto-run.$3F2, $3F3 is the reset vector. (See page 37 of your Apple ][+Reference Manual (A][ RM.)$3F4 is the power up byte (EOR of $A5 and the value at $3F3.

    See page 37, A][ RM.)$67, $68 is the start-of-program pointer. See page 140 of theApplesoft BASIC Programming Manual(AB-PRM).$AF, $BO is the end-of-program pointer. See page 141,AB-PRM.9 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    14/162

    $9DBF (CALL-25153) reconnects DOS. See page 144 of yourDOS 3.3 Manual (DOSM).$AS51 (CALL-22446) reconnects the input hooks. (Bypasses$9DBF and any time-bombs that may have been plantedthere.)$AA60, $AA61 is the length of the last loaded program. Seepage 144, DOSM.$AA72, $AA73 is the start of the last BLOADED program. Seepage 144, DOSM.The following steps were written for an Apple ][+ 48K withApplesoft in ROM and an Integer card. I f you have Integer inROM and an Applesoft card, be sure to reverse the appropriate

    steps (i.e. when it says to flip the switch UP on your Integercard, flip the switch DOWN on your Applesoft card). HittingRETURN after commands is implied and will only be referencedin certain lines for clarity.1) Boot the backup copy of your program disk (never use theoriginal).2) Flip the Integer card switch UP and press RESET to enter themonitor.3) Check the start of program pointer. If the number is not$801, then write it down for later reference.

    67.684) Reset the run flag.

    06:05) Change the reset vector to jump into the current language.

    3F2:03 EO 456) Flip the Integer card switch DOWN, press RESET and type

    LISTI f the program does not list, you may be trying to list a binaryfile. Check $AA72,AA73 to see if this is true.7) Save your program to tape.8) Take a good look at your listing. Write down the names ofany files that are LOADed or RUN and the start address of anybinary file, if given. List all POKEs and CALLs.9) On some protected disks the command parser in DOS ischanged. This tends to wipe out some of the common commands(e.g. LOAD, SAVE, CATALOG). Another popular trick is tochange DOS so it does not allow any direct commands. In orderto load and save the files that make up your program, select thefirst line entry that LOADs or BLOADs a file. DELETE all lineentries above and below the selected line (e.g. you want line 5,

    Book of Softkeys Vol. I 10

  • 8/14/2019 Book of Softkeys Volume 1

    15/162

    so DELETE lines 0 through 4, and 6 through 63999).10) NowCALL -25153

    I f it bombs, restart. Repeat all steps up to 10 and nowCALL -22446This reconnects the DOS. Then type

    RUNThis will load your selected file.11) Save the file to tape and repeat these steps until all files areSAVEd.12) Boot normal DOS. LOAD the files one at a time from tapeand SAVE to your disk.13) Examine all the Applesoft listings to make certain that all thefiles have been transferred.Now that all the files are on normal DOS, examine them forhidden bombs. Bombs are program lines that serve no purposeother than to garbage the program. See "Tricks and Bombs".

    For Integer ProgramsThe zero page pointers for Integer programs are:

    Start of programEnd of program

    HEX$CA, $CB$4C, $4D

    DEC202,20376,77

    These pointers tell your computer where the program is inmemory. The hex address is in normal lo-byte, hi-byte format.Hope these tips will help you find your program. Good luck!

  • 8/14/2019 Book of Softkeys Volume 1

    16/162

    ~ A z t e cDatamostRequirements:Apple][ 48KOne blank diskCopyA from DOS master diskDisk edit programBy Marco Hunter

    Here is a quick softkey.1) Use the modified COpyA from Zork softkey.2) Edit track 00, sector 03, change byte 42 from 38 to 18.

    That's it.

    Book of Softkeys Vol. I 12

  • 8/14/2019 Book of Softkeys Volume 1

    17/162

    Bag Of TricksQuality SoftwareRequirements:Apple ][, ][+, IIe or compatibleBlank disk initialized with 48K slave DOSBag of Tricks diskBy Neil Taylor, Earl Taylor and Ray DarrahHave you ever booted the Bag of Tricks disk and received an

    irritating message to use the original, when it's already in thedrive? Have you ever wanted to avoid the menu and skip right tothe needed program? Perhaps you are afraid of crashing theoriginal and can't get a good copy. Here is an easy (albeitsomewhat long) way to get an unprotected version.Basic Procedure

    To unprotect the programs on the original disk, each one willhave to be loaded by its DOS and then saved by a normal DOS.The programs loaded by the Bag of Tricks DOS are located at$800 in memory which normally is overwritten during the bootprocess. Before they can be saved, they must be moved to a safearea of memory. The programs can then be run by normal DOS.Loading and Saving

    The following procedure for loading and saving TRAX is usedin a slightly different form for each of the remaining Bag ofTricks programs: INIT, ZAP, and FIXCAT.TRAX

    I) Boot the 3.3 master, insert the blank disk and typeFPINIT HELLO

    2) Boot the Bag of Tricks disk (the menu will be displayed).3) After the light goes off open the drive door.4) Press reset once, wait a couple of seconds and press it again.5) To enter the monitor

    CALL -1516) Then type9489:4C 59 FF

    13 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    18/162

    7) Close the drive door.8) Type9400G

    9) To load TRAX, typeT

    10) Then type3800

  • 8/14/2019 Book of Softkeys Volume 1

    19/162

    ZAP

    The supplement is the same for INIT, ZAP and FIXCAT, soStep 14 can be eliminated.9) To load ZAP typeZ

    10) Then type5000

  • 8/14/2019 Book of Softkeys Volume 1

    20/162

    18) Change the program so that it will work at this new location5485:555517:555530:555542:56554A:56

    19) Insert the blank disk and boot itC600G

    20) Save this patch programBSAVE FIXPRG3,AS5400,LS30021) Change the HELLO program to the following and you'redone!

    Hello Program10 TEXT : HOME: HIMEM: 2560020 IF PEEK (104 ) =96 THEN 5030 POKE 103 ,1: POKE 104 ,96: POKE 24576 ,040 PRINT CHR$ (4) "RUWHELLO"50 A=PEEK ( - 16384 ) - 128 : IFA =70 OR A=73 OR A=84 OR A=90 OR A=69THEN 10060 POKE - 16368 ,070HTAB 10: VTAB 10 : PRINT "LOAOING'MENU","80 PRINT CHR$ (4) "BLOAO'PICTURE,A$4000" : POKE -16299 ,0 : POKE -16297

    ,0 : POKE -16302 ,0: POKE - 16304 ,090 IFPEEK ( - 16384 )

  • 8/14/2019 Book of Softkeys Volume 1

    21/162

    The boot process of Bag of Tricks is relatively simple buttedious, especially since it would have to be done five times(once for each program and once for the picture).That problem can be bypassed by taking advantage of anoversight by the authors. When reset is pressed the Apple triesto boot because the power-up byte is not set correctly. This isthe byte that tells the Apple when it has been turned on. (Seepage 37 of the Apple ][+ Reference Manual). When the powerup byte is set improperly the Apple will try to boot regardless ofthe address pointed to by the reset vector. When reset is hit fromthe menu the Apple acts like it has just been turned on and triesto boot. When reset is pressed the second time the Apple is putinto Applesoft.Loading The Programs

    In the sixth step of the save/load procedure the three bytes 4C59 FF represent the machine language opcodes which tell thecomputer to jump to the routine that causes it to stop and enterthe monitor (acting like a stop from Applesoft). Now after theDOS has loaded any of the programs, control will be given tothe user, not to the program.

    Saving To Normal DiskThe program is now in memory and the Apple is under control

    with the modified Bag of Tricks DOS in the machine.Unfortunately, it is far from normal and has no convenientSAVE or BSAVE. What now? Save it to tape? Perish thethought; a normal DOS can be rebooted.Since the booting process uses page 8 ($800-$8FF) in memory,which is exactly where the program starts, a special routine inthe Apple's monitor is used for moving memory out of the way.It simply transfers the part of memory which the program residesin byte by byte from one place in memory to another. Bymoving the programs higher in memory they are put in a safearea not used by the boot. That is what Steps 9 and 10 are for.Once the program is moved, the backup disk can be safelybooted.

    Backup FilesThere should be nine files on the backup now: TRAX,TRAX.SUP, INIT; SUPPLEMENT, ZAP, FIXCAT, PICTURE,FIXPRG3 and HELLO. The HELLO program is simply a menuthat allows the backup to imitate the original disk. The picture isthe same as the one on the original disk.

    17 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    22/162

    The other seven files make up the four major Bag of Tricksprograms (the other files are routines). Each program is in twoparts, a main section and a supplement, but the supplements forINIT, ZAP and FIXCAT are the same. To run any of theseprograms, the accompanying supplement must also be loaded. Touse TRAX, TRAX.SUP must be loaded first. For the other threeprograms, SUPPLEMENT must be loaded first.

    How To Run The ProgramsBecause the programs were moved before they were saved,they will be loaded into the wrong spot if just BRUN orBLOADed. To make sure everything is in the right place, DOShas to be told where to place the program. FOR EXAMPLE: Torun TRAX, first load in the supplement with BLOADTRAX.SUP,A$8700. This loads the supplement into the correctplace in memory. Then the TRAX program can be run withBRUN TRAX,A$800.Similarly, the supplement for INIT, ZAP and FIXCAT would

    be BLOAD SUPPLEMENT,A$7600. To run the program:BRUN INIT,A$800 (ZAP or FIXCAT can be substituted for thetitle INIT).Final Analysis

    All four Bag of Tricks programs are extremely useful. ZAP isan excellent disk editor with convenient help pages. It also hasdefinable commands (a nice touch). INIT is the program that youneeded to convert all your disks to DOS 3.3. It allowsreinitialization without loss of data. FIXCAT is great for doingall of those tedious chores related to recovering crashed disks.There is only doubt about TRAX. Its sole use seems to belooking at the protection schemes on disks (it gives a greatoutput for users of lOB). However, TRAX will not analyze theBag of Tricks disk. I f the authors couldn't figure out how toanalyze their own protection schemes, TRAX can't be all thatgood. On the other hand, maybe it was deliberate. Maybe theauthors are trying to say, "Break and copy other disks, but notours!"

    Book of Softkeys Vol. I 18

  • 8/14/2019 Book of Softkeys Volume 1

    23/162

    ~ B i l l Budge's Trilogy Of GamesCalifornia PacificRequirements:48K Apple ][ PlusBOOTl3 (from DOS master disk)Trilogy of GamesA blank disketteBy Michael DeckerOne of Bill Budge's earliest offerings was his Trilogy ofGames: Driver, a rudimentary driving-skills game; Pinball, arudimentary you-guessed-it; and Space Wars, a (I won't say it)two-player space battle.This old, DOS 3.2 disk still sells, and Space Wars remainsone of the most entertaining arcade-style games in which twoplayers can directly battle each other. Most people often prefer itto newer, much more sophisticated games in which one battlesthe computer. 1 was motivated to de-protect the game by a slightbug (one player's ship is more affected by gravity than the othership) and by my annoyance with the game's DOS 3.2 format.

    Inside Budge1 first tried cracking the disk. Protection was simple: changesin the prologues/epilogues. However, it looked like direct diskaddressing was used. Ugh.So, I booted with an Inspector/BASICS disk, then bootedTrilogy. At the menu I reset out, then looked memory over:picture at $4000; program at $6000. Hmm.I then booted DOS and saved picture and program. Next, I

    restarted the program (6000G) and, in tum, loaded each game. Ifound the entry points and saved the games. Next, I examinedthe main program and identified the transition between the menuand the disk access routines. Finally, I wrote an Applesoftprogram to handle the game switching. Presto! The TransparentBudge!Doing It

    1) Boot the DOS 3.3 System Master.PR#6

    2) Prepare to boot 13-sector DOSBRUN BOOT13

  • 8/14/2019 Book of Softkeys Volume 1

    24/162

    3) Insert the Trilogy disk and press RETURN.4) Hit ESC to get to menu.5) Remove the disk and press RESET.6) Press RESET again.7) Boot the 48K slave disk.

    PR#68) Save the picture first

    BSAVE PICTURE, A$4000,L$20009) Enter the monitor

    CALL -15110) Make this modification

    67B7:4C D2 D711) Save the first 8 pages of this modified program

    BSAVE ATTRACT, A$6000,L$80012) Restore the original program

    67B7:20 00 6D13) Insert Trilogy disk and re-start the game.

    6000G14) Hit ESC to get to menu.15) Type 1 to select Driver, the first game in Trilogy.16) When the title and/or instructions come up, hit RESET.17) Swap disks and save the just loaded program

    BSAVE DRIVER,A$800,L$180118) Enter the monitor again

    CALL -15119) Repeat Steps 13-18 for PINBALL and SPACE WARS usingthe same BSAVE parameters.20) Coldstart BASIC and DOSFP

    21) Type in the following BASIC menu "HELLO" program.10 ON PEEK (104) =112 GOTO 20 : POKE 103 ,1 : POKE 104 ,112 : POKE 28672 ,0: PR INT CHR$ (4 ) "RUNBUOGE. HELLO"20 PRINT CHR$ (4) "BLOAO'ATTRACT"30 PRINT CHR$ (4) "BLOAO'PICTURE"40 POKE 10 ,76 : POKE 11 ,0 : POKE 12 ,96 : PR INT USR (0) : CALL - 10621500$ =CHR$ (13) +CHR$ (4) : VTAB 1 : ON PEEK (67) - 3GOTO 60,70,8060 PR INT 0$ "BLOAO'OR IVER" : CALL 3523 : RUN 40

  • 8/14/2019 Book of Softkeys Volume 1

    25/162

    70 PRINT 0$ "BLOAO'PINBALL" : CALL 2048 : RUN 4080 PRINT 0$ "BLOAO'SPACE'WAR" : CALL 6015 : RUN 4022) Save itSAVE BUDGE.HELLO

    I would sometimes get an ?OUT OF MEMORY ERROR. I fyou should encounter this, just type RUN 20 and you'll be fine.Now, would someone tell me how to make both spaceshipsfeel the same gravity?

    21 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    26/162

    ~ B o o t Code TracingBy BobbyRequirements:Apple IIOne disk drive with Apple controllerApple GalaxianEmpty 48K slave diskKnowledge of machine code/assembly language

    Boot code tracing is the most difficult of all the sofikeyspresented. It is also the most effective method of transferringsingle load binary programs, those which load into the Apple atBoot and do not access the disk again. Therefore, be warned thatthis softkey is definitely not for beginners. You must have someknowledge of machine code or assembly language.The initial Boot or Boot 0 is determined by a program on thedisk controller card. This program is stored in ROM (Read OnlyMemory) and cannot be changed by the program on a disk. Anon-standard format may be used on a disk to prevent copying,but that disk will not Boot on your Apple unless track 0, sectoro is readable by the disk controller card. This means that youcan also read it and, by controlling the boot process, you candetermine where the program is and save it to disk.In order to demonstrate this process, the Boot of the binaryprogram Apple Galaxian will be traced. This is a familiar gameand almost everyone owns a copy.The Boot 0 code is at $C6oo. I f your controller card is not inslot 6, then change the number after the $OC to correspond tothe appropriate slot (i.e. Slot 5 would be $C5OO). First the codewill be moved down into RAM (Random Access Memory) wherea portion of it can be modified. Tum on your Apple, pressRESET to halt the boot, then enter the monitor

    CALL -151And type

    9600

  • 8/14/2019 Book of Softkeys Volume 1

    27/162

    The reason for this is that the Boot 0 code contains a routinethat finds which slot the controller card is in. It does this bycalling a return code in the F8 ROM and extracting the returnaddress to locate the page boundary. The code itself isrelocatable (will run anywhere in memory).The purpose of Boot 0 is to transfer the code stored on disk attrack 0, sector 0 into memory and to execute it. Then the diskcode (Boot 1) will take over the Boot process. Here is where thefirst change will be made.Examine the code at the end of page $96. At $96F8 you willfind a IMP to $801. This is the next Boot stage (Boot 1). Boot 0needs to load and not run the Boot 1 code at page $08, so thecode at $96F8 will be changed to IMP to the monitor afterturning off the drive motor. In order to save having to reenterthe same code, put the routine at $9500.96FA:95 N 9501:AD E8 CO 4C 59 FFThe base address $C088 is used to tum the drive motor off.You must add the slot number of your controller card to thisaddress in the form $sO where "s" is the slot (i.e. slot 5 wouldbe $C088 + $50 = $COD8). I f you're not used to hexadecimalnumbers, there is a table on page 82 of the Apple ][+ referencemanual with the base addresses and conversions for each slot.After making the changes and checking that they are correct,you are ready to begin. Run the code at $9600 (Boot 0).$96OOGWhen the drive stops, Boot 1 will be in memory at page $08.

    I f you examine the code at $800 you will see that it is written torun at page $02. The first part of the code is a move routine thattransfers the code from page $08 to page $02, then IMPs topage $02.Boot I should be moved to page $98 so you can makechanges. The code must be moved or else the next time you runBoot 0, it will be overwritten.

    9800

  • 8/14/2019 Book of Softkeys Volume 1

    28/162

    2 will be in memory at page $03. Move the code at $300 to$9300.9300

  • 8/14/2019 Book of Softkeys Volume 1

    29/162

    B028:BO AD lC BO C9 09 90 EAB030:4C 59 FFBooo.B032After entering the code, link Boot 3 to it and link Boot 2 toBoot 3.B749:4C 00 BO N 9343:4C 00 B7Check to see that all the changes are correct, then run Boot O.When the drive stops you should see a lot of inverse and flashingcharacters on the screen. This is the portion of the program thatis loaded into the text screen area. An image of this code is

    safely stored at $2000.Remove the backup copy of Apple Galaxian and insert the 48Kslave disk in the drive. Boot the disk and enter the monitor.There are a few more changes to make before the file can beBSAVEd.The binary program that you are going to save is 132 sectorslong. DOS will not normally allow you to save a file this long,so change the range limitation in DOS from 32K to 64K.A964:FFWhen the slave DOS was Booted, it over-wrote the code onpage $08. An image of the page $08 code was saved at $2800.Move this code down to page $08.800

  • 8/14/2019 Book of Softkeys Volume 1

    30/162

    Now that it is safely stored on the disk, you can run it anddiscover how much of the memory that was saved is really used.More often than not, all of memory is not used. A large part ofwhat was saved is not required by the program. BLOADing thefile and erasing pages before you run the program is the simplestway to determine what sectors are necessary. You coulddetermine if there is sufficient memory that is not used andretrace the Boot code in order to save the HIRES picture. This isa fine point that is not required and is left up to the reader.

    Book of Softkeys Vol. I 26

  • 8/14/2019 Book of Softkeys Volume 1

    31/162

    Boot Code Tracing: RevisitedBy MycroftRequirements:Knowledge of machine language48K Apple ][ with Integer CardMulti-Disk Catalog by Sensible SoftwareOne blank initialized disk

    I f you have a little knowledge of machine languageprogramming, and a good measure of perseverance, this articlewill help you to defeat the locking scheme used in a large groupof programs (those that boot up and run without subsequent diskaccess) and let you capture them on standard DOS. Most gamesand many utility and business programs fall into this category.

    The TheoryThe basis for this approach is: No matter what protectionscheme is used, the program must boot on a standard Apple inorder to run. I f we could somehow step through the bootprocess, get everything loaded, and then stop just prior to goingto the start of the program, we would be able to save the wholething and run it under standard DOS.The APPLE Boot process starts with Boot 0 in the Disk

    Controller ROM. This short machine language programBLOADS track 0, sector 0 (containing Boot 1 of the disk beingbooted) at locations $800 thru $8FF, and then jumps to $801 toexecute Boot 1. Boot 1 reads Boot 2, and the process continuesthrough successive Boot stages until finally the main program isloaded and run.Assuming your disk Controller card is in slot 6, the code forBoot 0 starts at $C600 and extends through $C6FA. I f youpower up your APPLE, enter the monitor and do a "C600L" ,the beginning of the disassembly listing of Boot 0 can be seen. I fyou type a few more L's you will be able to see the jump toBoot 1 at $C6F8.What we would like to do is execute Boot 0, but stop beforejumping to Boot 1. But, how is this done?Reset

    The RESET routine is at $FF59 in the monitor ROM. Itperforms a function similar to pushing the RESET button. I fcalled, a RESET cycle is performed and any executing programwill be stopped. I f we could get Boot 0 to jump to $FF59 insteadof $801, we will have accomplished our first objective.27 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    32/162

    Modifying Boot 0Since Boot 0 is in ROM, it cannot be directly modified. Thesolution is to move it to RAM using the monitor's memory moveroutine so we can change it to suit our needs. The new locationshould be somewhere in RAM where it will not be overwrittenin successive Boot stages. Memory that is just below DOS isusually safe to use, since many locked programs use only slightlymodified versions of normal DOS.Because of the routine in Boot 0 that finds the slot the DiskController is in, the second digit of the address we move Boot 0to must be the same as the slot number. So let's use

    $9600-$96FF.The First Step

    From the monitor, type9600

  • 8/14/2019 Book of Softkeys Volume 1

    33/162

    other programs which use a virtually identical Boot sequence, Iam sure they can be unlocked using this same technique withonly a few changes (try one of your own once-load programs ifyou don't have Multi-Disk Catalog). You'll need an initializedslave diskette and make sure there is a write-protect tab on thedisk you are trying to unlock.

    Unlocking Multi-Disk Catalog HIBOOT 0

    Tum on your APPLE with the disk drive empty and pushRESET to stop the drive. This will keep the APPLE's memoryclear. Insert the locked disk and type

    CALL -151Type96OO

  • 8/14/2019 Book of Softkeys Volume 1

    34/162

    and stop it at that point with9301:4C 59 FFOne other byte in Boot 1 must be changed so that ourmodified code is executed properly. Type9805:98

    Now do a9600G

    once again, and typeCOES

    to stop the drive.BOOT 2

    The next stage of the Boot normally starts at $301. Move thiscode by typing9300

  • 8/14/2019 Book of Softkeys Volume 1

    35/162

    Enter9OOO:A9 5D C5 3E DO 03 4C 5D9008:02 4C 59 4C 59 FFThe source code for this routine would look like

    9000-A9509002-C53E9004-00039006-4C 50 029009-4C 59 FF

    LOA #$50CMP $3EBNE $9009JMP $0250JMP $FF59

    Load va Iue.Same?No, go RESETYes, go on.Jump RESET.Change the Boot code to jump to this subroutine by typing9343:4C 00 90

    and do another9600G

    BOOT 3At the beep, you can stop the drive (COE8) and examine thecode beginning at $3700 looking for the next jump out. It is at$3747, and is a jump to $lB03. So, as before, change this jumpby typing374 7:4C 59 FF

    Writing To The ROMThe code we moved to memory page $93 ($9300) wasresponsible for reading in this portion of the Boot. But since wejust made a change at $3747, we don't want it to be over-writtenwhen we start the Boot over again. What we do is change byte$93CC so that a dummy write is done by letting it "write" to

    the ROM!93CC:DOand also changing bytes $9315 and $933E to reference thislocation instead of $3CC. Type9315:93933E:93The "write" of the next Boot stage; therefore, begins at$Dooo, and is ineffectual except to keep the drive running and inthe proper read mode. Change the subroutine we put in at $9000to go to the modified next stage by typing9009:4C 00 37

    31 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    36/162

    Now type9600G

    one last time. This time when you hear the beep, the drive willstop by itself.Start listing the program at $IB03, looking for the next majorjump out. You should fmd it at $IC25, and it is a jump to

    $lE54. TypelC25:4C 59 FFIB03GNow list beginning at $lE54. There is an immediate jump to

    $9D84. List from $9D84.Language Card?

    At $9DE4 and $9DE7 are two indirect jumps, through $9D5Eand $9D5C, respectively. Examine the code carefully, beginningat $9D84, and you will find that the first indirect jump is takenby systems equipped with language cards (RAM cards), and thesecond for those without. No matter; the second indirect addresswill ultimately be jumped to whichever system you have. To findout what it is, type9DE7:4C 59 FF9D84G

    When you hear the beep, type9D5C.9DSD

    and the screen will display (low byte first) the address indirectlyjumped to as $33D5. Begin listing from $33D5 and you shouldfind the next JMP way down at $34BC; it goes to $OOFD.Once again, type34BC:4C 59 FF33D5GThe disk drive will start and the last segment of the programwill be loaded in. If everything worked correctly you should heara beep, the drive will stop, and the screen will display garbage.

    Where The Program StartsNormally, the program would next jump via the page zerolocation we just changed at $34BC to the start of the multi-diskcatalog main program. TypeOOFDL

    to see where the start is.Book of Softkeys Vol. I 32

  • 8/14/2019 Book of Softkeys Volume 1

    37/162

    The software protectors have put one last obstacle in our path.$OOFD takes an indirect jump through page zero locations $4Eand $4F to the start of the program. We can't examine theselocations to find out where the jump goes because they getchanged when a RESET cycle is executed. Not to worry,though, because if you type348FLyou can see that locations $4E and $4F are set from $33CO and$33C1, respectively. Typing

    33CO.33Cl..

    will thus divulge (low byte first) the starting address of the mainprogram as $1294.The program occupies memory from $800-$18FF,$5000-$5CFF, and $9DOO-$BFFF. You find this out by scrollingthrough memory to try and identify program statements and data,often a trial and error process. I f you get too much, no realharm is done, but too little and the program will not run.Ail that remains to be done is to capture the program undernormal DOS.Moving The Memory

    Warm Booting a slave diskette will over-write memorylocations $800-$8FF and $9600-$BFFF, but everything from$900-$95FF will be unaffected. To move the "lower" part ofthe program ($800-$1800) up and out of the way of the Boot,and adjacent to the "middle" part, type

    3FOO

  • 8/14/2019 Book of Softkeys Volume 1

    38/162

    The source code for this routine looks like:3E02- A9 50 LOA #$50 SETUP3E04- 85 30 STA $30 AOORESS OATA3E06- A9 7F LOA #$7F FOR MEMORY3E08- 85 3F STA $3F MOVE ROUT INE3EOA- A9 90 LOA #$90 FOR TOP OF3EDC- 85 43 STA $43 PROGRAM.3EOE- 20 F3 3E JSR $3EF3 'MOVE'SUBR3EE1- A9 3F LOA #$3F DO IT AGAIN3EE3- 85 30 STA $30 FOR 'BODOM'3EE5- A9 4F LOA #$4F PART OF PROG3EE7- 85 3F STA $3F3EE9- A9 08 LOA #$083EEB- 85 43 STA $433EEO- 20 F3 3E JSR $3EF33EFO- 4C 94 12 JMP $1294 PROG START3EF3- AO FF LOY #$FF3EF5- 84 3E STY $3E3EF7- C8 INY3EF8- 84 3C STY $3C3EFA- 84 42 STY $423EFC- 20 2C FE JSR $FE2C MONITOR MEM3EFF- 60 RTS MOVE

    The Final TestNow remove the protected disk from the drive, replace it witha normal DOS (slave) disk and type

    ~ (Hold the 8 key down and press "P", then release the 8 keyand press RETURN). When the Boot is complete, typeBSAVE MDC,A$3ED2,L$412EYour unlocked program will now BRUN normally and can becustomized as you see fit.Try this procedure with your other "one-shot" load programs.You will probably be surprised at how often it works.Page zero locations changed by RESET:$20-$2B$31$33-$3F$40-$49$4E-$4F

    Book of Softkeys Vol. I 34

  • 8/14/2019 Book of Softkeys Volume 1

    39/162

    ~ B u z z a r d BaitSirius Software Inc.Requirements:48K Apple, with old F8 monitor ROMOne disk drive with DOS 3.3Initialized 48K Slave DOS 3.3 diskBuzzard BaitBy Clay HarrellSirius Software always provides us with games that arechallenging both in play and protection. Buzzard Bait is noexception. I f you try copying the disk with your favorite nibblecopier, you will find that the people at Sirius have done theirhomework in discovering ways to defeat you (but we have cometo expect that from this fun-loving bunch).Not being one who enjoys watching the bytes go by for hours

    with a copier, I tend to think there is a better way. Although theSirius people have gone to great lengths to protect their diskfrom the bit bunch, they failed to protect the memory to anygreat extent. (A Note for Replay-Wildcard owners: Sirius hasn'tforgotten you either! Just enough disk access has been put in todiscourage any easy copies).Once the game is done with its load and the little red lightgoes out, RESET should be the next key pressed and the monitorprompt should appear.Snooping through memory and checking all the "standard"starting locations reveals that an 8000G will start the game upjust as if nothing happened! Further examination of memoryreveals that Buzzard Bait lives from $800 to $9800.Now all we must do is move the portions of memory that getdestroyed in a Slave disk, boot to a safe location and save thegame as a BLOADABLE file. Hi-res page one is a perfectcandidate for this since it gets re-drawn upon starting the gameand, therefore, does not need to be saved.We must also defeat the disk access that occurs between alllevels. This access does not load any data, but just checks to seeif the disk is present.In cookbook fashion, here is what we must do:I) Boot Buzzard Bait.2) Reset into monitor after the drive stops.3) Move the code from $800 through $1000 up to $20002000

  • 8/14/2019 Book of Softkeys Volume 1

    40/162

    4) Move the code from $9600 through $9800 down to $30003000

  • 8/14/2019 Book of Softkeys Volume 1

    41/162

    ~ C a n n o n b a l l BlitzSierra On-Line, Inc.Requirements:Apple ][+ or equivalentCOPYAA sector editorCannonball BlitzOne blank diskBy StaffHere is a short APT for Cannonball Blitz which will reducethe hazards encountered on the second level of play. Afterfinishing Level 1, just press the space bar and the repeat keysimultaneously (or press the space bar continuously if you haveautomatic repeat) until the screen changes to the next level.When play begins at the second level, the number of cannonswill have been reduced to only two.

    And a Quick Softkey. . .To copy the entire disk, use COPYA. Then, using a sectoredit program such as DiskEdit, read Track 17, Sector OE, andchange address CD from 49 to 60. Finally, write the sector backto the disk. This backup copy can be copied using any of thenumerous copy programs on the market. To run the program,simply boot the disk.

    37 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    42/162

    ~ C a s i n oBy Leonard Nadel, DDSTo unlock the disk Casino so it can be accessed and backed-upwith COPYA, use the same method as for Zork. (See table ofcontents.) No changes in the sector mode are necessary!

    Book of Softkeys Vol. I 38

  • 8/14/2019 Book of Softkeys Volume 1

    43/162

    ~ D a t a ReporterSynergistic SoftwareRequirements:48K Apple ][+COPYAData ReporterOne blank diskBy Don HalleyThe Data Reporter, from Synergistic Software is advertised as

    Version 2 of the popular modifiable database system. I t isbasically a data storage and retrieval system with graph plottingcapabilities, a text editor, and many data management features.Documentation for Data Reporter is fairly complete, althoughit suffers from the same unimaginative approach to organizationas does the documentation for its competitors. There is no indexand the table of contents offers no help beyond one or two-wordreferences to program features. A tutorial section would beappreciated by the uninitiated user, and a reference tablecontaining pointers to key sections would help.Normal Copy

    The documentation suggests that a copy of the original disk bemade for general use in order to prolong the original's life. TheCOPYA program on the DOS System Master may be used, butit will encounter a read error on the last track. This track hasbeen written with a modified DOS and its contents are read intomemory via a short machine language program appended to thelast line of the HELLO program. This means that you mustalways boot from the original, then swap to your application diskfor processing.

    Unprotected CopyA little PEEKing around will reveal that the protected sectorsare from $00 to $06 on track $22, and that the informationcontained there is loaded into memory from $9400 to $9AFF.Examination of the HELLO program shows that it does nottouch this area upon exit. This means that both a way of reading

    the protected portion of the disk into the proper memorylocations (HELLO) and a clean exit have been provided.Here's the step-by-step procedure:1) Make a copy using COPYA. (Ignore the read error.)39 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    44/162

    2) RUN the HELLO program on the original disk.3) Choose the QUIT option from the primary menu.4) Replace the original disk with your copy.5) Type these commands:BSAVE HELLO.OBJ, A$9400, L$06FFLOCK HELLO.OBJUNLOCK HELLO63999 PRINT D$ "BLOAD HELLO.OBJ" : RETURNSAVE HELLOLOCK HELLOPR#6You now have a fully operational backup for only the cost of,

    the disk itself. Of course, you may make as many additionalbackups as you like from this disk.

    Book of Softkeys Vol. I 40

  • 8/14/2019 Book of Softkeys Volume 1

    45/162

    ~ D e m u m nBy BobbyRequirementsApple n, n+, IIe with 48KOne disk driveBlank initialized diskDOS 3.3 Master disk with MUFFINProgrammers Aid ROM

    Muffin is a program on the 3.3 DOS Master disk. It is usedto transfer l3-sector ftles to l6-sector disks. To accomplish this,it contains an image of 13-sector RWTS (Read or Write a Trackand Sector). It uses this internal RWTS to read the ftle and thenwrites to your diskette using the external or resident DOS.DemutTm is created by changing the jumps in the program sothat it uses the resident DOS to read and the internal RWTSimage to write. Also, the internal RWTS is changed from a 13sector image to a 16 sector image.1) Boot the DOS 3.3 Master diskPR#6

    2) Switch to Integer and load MUFFININTBLOAD MUFFIN

    3) Enter the monitor and initialize the Programers Aid CodeRelocation featureCALL -151D4D5G

    4) Tell the relocate routine what we're moving and where it goes1900

  • 8/14/2019 Book of Softkeys Volume 1

    46/162

    115B:D9031197:AO 2015AO:AO D2 C5 D3 C9 C4 C5 CE15A8:D4 AO C4 AE CF AE D3 AE15F7:C4 C520AO:A9 IE 8D B9 B7 20 FD AA20A8:48 A9 BD 8D B9 B7 68 60

    9) Save the new DEMUFFIN program.BSAVE DEMUFFIN,A$803,L$I900

    Directions & ExplanationsDemuffin directions are identical to Muffm's. You want toconvert the files, so you have to select the disk slot and driveand the file name you want to convert. It is helpful to type =for the file name so that all the available file names will bedisplayed when you answer yes to the question: "Do you wantprompting?". Now you can choose which files to convert(transfer).I f a file doesn't transfer and you get an I/O ERROR, you'll bereturned to the menu. Just repeat all the steps but don't botherconverting the files you have already converted, and bypass theproblem file (it probably isn't needed by the program anyway).Continue to convert as many files as you can.

  • 8/14/2019 Book of Softkeys Volume 1

    47/162

    ~ D i s k E d i tBy Charles HaightCertain tools are required to understand DOS and to

    manipulate disk meso The first is a nibbler or bit editor. Thesecond and most important of these is a sector editor.DiskEdit is one such utility.DiskEdit is a user oriented direct disk access program. Simplystated, DiskEdit allows the user to read or write any sector on adisk. This means that the user can:Directly edit fdes on disk.

    Change text in binary mesoInsert illegal characters in REMs.Directly alter data base mesoMove sectors (even between disks).Repair crashed disks.Format catalog names.Remove illegal codes in me names.Write flashing and inverse titles.Repair the VTOC.UnDELETE deleted mesoHide me names.

    DiskEdit will display an entire sector as hexadecimal andASCn.The keyword in DiskEdit is simplicity. The commands aresingle key entry (you don't have to keep hitting return). WithDiskEdit you can directly enter control, inverse, flashing andlower case characters. Input and display information can be inhex or decimal. The shimmering cursor is easy to identify evenwith a screen full of inverse and flashing characters. You canjump the cursor to any absolute position within a sector. TheNEXT and LAST commands allow you to single-step throughtrack/sectors. And DiskEdit has a simple escape. I f you changeyour mind, pressing the escape key will set the defaults andreturn you to the command mode.Disk Overview

    Before we begin entering DiskEdit, let 's take a closer look atDOS and a normal disk.The flexible (or floppy) diskette can be thought of as a discshaped piece of recording tape, and essentially that's all it is. Aflat disk shape is used, instead of a flat strip (as in a tape), inorder to maximize the rate of data transfer. For instance, totransfer data to and from a tape, the computer would have toREAD all of the tape preceding the area where the data wasstored before it could transfer the required data. This method of

    43 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    48/162

    information retrieval is known as "sequential access" and isabout the same as scanning a cassette tape for a favorite song.The disk, on the other hand, is set up in such a way that thecomputer can go directly to a piece of data or program byscanning the disk laterally. This method of information retrievalis known as "random access" and is similiar to selecting aparticular song on a record.Before a disk can be used, it must be formatted. The INITcommand is used for this purpose.When a disk is initialized, the Disk Operating System (DOS)writes 35 concentric tracks. Each track is divided into 16 blockscalled "sectors". (DOS version 3.2 writes only 13 "sectors".)Each sector contains an address mark and a data mark. Thesemarks start and end with a unique pattern of bytes.The address mark tells the DOS what track/sector it iscurrently reading. It contains the volume, track, sector andchecksum information. The data mark contains the actual data. Ittells the DOS where the data begins and ends and includes achecksum that is used to verify the accuracy of the data.

    I f you have ever tried to load a program and the disk drivestarted making a slight chatter, chances are that the DOS couldnot read one of these markers. It then recalibrates the read/writehead by moving it back to track zero and stepping (counting eachtrack that it passes over) back out to where it was supposed tobe.The tracks are numbered from $00 (0) to $22 (34) and thesectors from $00 (0) to $OF (15). Tracks $00 through track $02(a total of three tracks; zero, one and two) contain the DOSprogram.The DOS gives the Apple the ability to manipulate data on adiskette. In this program are all of the commands related tocontrolling the disk drive (i.e. CATALOG, INIT,LOAD...) and a set of ERROR messages which, unless youeither are a magician or don't use the Disk II, you have probablyseen before.The disk controller card that connects the Disk II to the Applealso has a small program on it. When you boot a disk, thisprogram tells the Disk II to read track $00 (0), sector $00 (0)(remember, we start counting at zero instead of one) intomemory.The program on track $00, sector $00 contains the informationrequired to read in sectors $00 through $09 on track $00. Theprogram on sectors $00-$09 reads in the remaining informationon track $00-$02. When this process is completed, the entireoperating system (DOS) will be in memory.At this point, DOS takes over and runs the "HELLO"program. The program that was used to initialize a disk isusually refered to as the hello or greeting program.

    Book of Softkeys Vol. I 44

  • 8/14/2019 Book of Softkeys Volume 1

    49/162

  • 8/14/2019 Book of Softkeys Volume 1

    50/162

    Please read each paragraph before pressing any keys andfollow the directions carefully.Insert the DiskEdit back-up disk in Drive 1. Tum on yourcomputer. DiskEdit will prompt you when it is ready.Press any key to start.What is your status?

    On the bottom of the screen are the status indicators andprompts. They tell you the slot (SL), drive (DR), track (T),sector (S), volume (V), byte position (B), filter (F) and dataentry mode currently selected.ReadingPress the 'R' key. This tells DiskEdit that you want to READa sector from the disk. A flashing prompt will appear next to thetrack (T) indicator. DiskEdit is asking you what track to read.Type '01'. This tells DiskEdit that you wish to read track $01(1). The flashing prompt will move over to the sector (S)indicator. Respond to this prompt by typing '8'.

    The disk drive should whirr for about two seconds, and thenstop. The screen should be full of numbers and letters. You arenow looking at the contents of track $01 (1), sector $08 (8) inwhat is known as hex or hexadecimal format on the left side ofyour screen and ASCII on the right side.Hex a what?

    Hexadecimal is a base sixteen numbering system. I t gets itsname from the fact that it contains all of the numbers found innormal base 10 (decimal 0-9) plus six alphabetic characters (Athm F).Say 'AS-KEY'

    ASCII stands for "American Standard Code for InformationInterchange." This is the alphanumeric equivalent of all of thosehex symbols on the right.

    Error messagesThe sector you are now viewing ($08) contains the DOS errormessages (they are continued on sector $09).Press the 'N' key. This will increment the sector count and

    cause Diskedit to read the next sector. I f the sector count hadbeen at $OF (15), the track count would have been incrementedby one and the sector count reset to $00 (0).The "Boot" Program

    You are now viewing the sector where the "Boot" programname is stored. In the center of the screen is the file name'DISK EDIT'. This is the name of the program that the DOS

  • 8/14/2019 Book of Softkeys Volume 1

    51/162

    will automatically 'RUN' when this disk is booted. (If youdecide later to change the boot program name on this disk, thisis where you should come.)Let's follow how DOS located the fIle "DISK EDIT" whenyou booted this disk.Press 'R' to read. Type' 11' for the track and '0' for thesector.You are looking at the VTOC or bit map. The second andthird byte point to the first directory (catalog) sector. These bytesshould be '11 OF'.Press 'R' and type '11' for the track and 'F' for the sector.The sector you are viewing is the first part of the directory,

    which extends downward to sector $01 (1). Press the zero key.This is a special function key designed to make viewing catalogsectors more meaningful. The screen will return to normal whenyou press any other key.Moving the cursor

    The I, J, K and M keys are the cursor movement keys. Thecursor has a wrap around feature. I f you go off the screen onone side, you will come back on the opposite side.Press the '0 ' key. The flashing prompt will appear next to thebyte position (B) indicator.This command allows us to move the cursor to a specificlocation on the screen. Move the cursor to the beginning of thefIle name by typing 'OE'. The cursor should now be in front ofthe 'D' of "DISK EDIT".Move the cursor back one character by pressing 'J'. Look atthe hex portion of your screen. The '02' is used by DOS to tellwhat type of program DiskEdit is and whether it is locked orunlocked. The '0' means that the fIle is unlocked. The '2' meansthe fIle is Applesoft.

    EditingPress the 'E' key. This tells DiskEdit that you wish to edit thesector.Type '82'. Press 'ESC' to exit the EDIT mode. Press the '0 'key. Type '2C'. The byte you are looking at and the '00'following it are the hex equivalent of the sector use count for thefIle. Press the 'E' key. Type '00'. Press 'ESC' to exit the EDITmode.Press the zero key.The program HELLO is shown with an asterisk. Changing the

    '02' into a '82' locked the fIle. Entering the '00' will change thesector count for the fIle to zero.

    47 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    52/162

    WritingWARNING: Read the following paragraph completely beforeyou press any keys.Up to this point, you have only been editing the diskinformation that is in the computer's memory. In order to makethe changes permanent you need to WRITE this information backto the disk.The command to do this is 'W' for WRITE. Press the 'W'key. Press 'RETURN' for the track (T) and sector (S).When the RETURN key is pressed in response to a prompt theprogram will act as if the default values were entered. Thedefault values for the track and sector are the last track/sectorthat was read or written.The program will beep and a warning will be printed. This isyour last chance to change your mind. You must press RETURNto have DiskEdit write to your disk. Any other key will abortthis operation.Press RETURN. The buffer contents are now written to the

    disk. Press the 'C' key to see the catalog. The first file will belocked (indicated by the asterisk' *' next to the file type) and thesector count will be '000' . Press any key to continue.This completes the exercise. Experiment with DiskEdit usingthis same scratch diskette.Summary of Commands

    ESC This is the "I changed my mind" key. Press this keyto reset defaults and exit back to the command mode.RTN The RETURN key, when used to answer an inputprompt, will accept the current default and continue. (Example:When prompted for the track and sector during a read command,pressing RETURN twice will cause the current track and sectorto be read.)> Track skip command. Increments the track number andperforms a READ. Does not increment the sector.< Track skip command. Decrements the track number andperforms a READ. Does not decrement the sector number.A Sets character entry mode to ASCIIB Disassemble buffer command. Calls the monitor todisassemble buffer contents starting at the cursor location. Use

    the space bar to continue disassembly one line at a time or pressRETURN to disassemble 20 additional lines. Press 'P' to printthe screen display. (Press ESC to exit.)C Displays the disk catalog using the current slot and drive.Prints the number of free sectors on the disk.D Flips the active drive from 1 to 2 or from 2 to 1 on eachkeypress.Book of Softkeys Vol. I 48

  • 8/14/2019 Book of Softkeys Volume 1

    53/162

    E A continuous-edit mode, this mode allows you to typechanges just like on a typewriter. Pure cursor movement issupported using control keys. I f you are in hexadecimal format,only valid hex digits are accepted as input. In ASCII format allkeys are valid except the control keys listed below. (Press ESCto exit.)

    Ctrl KeyFINQz

    Functionset FLASH modeset INVERSE modeset NORMAL modemove cursor upmove cursor downmove cursor rightmove cursor left

    + This edit submode is entered using the plus (+) key. The' EDIT ' prompt is changed to '++EDIT++' . It isidentical to the normal edit mode except that it does not supportcontrol functions. All keys are valid except ESC. Controlcharacters may be directly entered. The plus (+) key or thesemi-colon (;) may be used to enter this submode.F This is the filter format command it allows you to changethe filter values so that you can configure your own filters.G Turns the sound on or off each time you press the 'G'key. (Default at BOOT is on.)H Sets character entry mode to HexadecimalI Moves cursor up.J Moves cursor left.K Moves cursor right.M Moves cursor down.L Reads last sector.N Reads next sector.o Allows cursor to be jumped to any absolute position inthe displayed sector.P Sends the buffer contents to your printer. A header isprinted first which shows the track, sector, and volume. Whenfirst used, the program will ask which slot your printer is usingand whether you wish to use 40 or 80 columns.R Prompts you for the track and sector to read. Use theRETURN key to accept default values.S Prompts you for a new slot. Valid entries are from 1 to 7.U Toggles the status indicators between hex and decimal andupdates the display information. Only the track, sector, andcursor are affected by this key. (Default at BOOT is hex.)W Prompts you for the track and sector to write to. Use theRETURN key to accept default values. After entering the track

    49 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    54/162

    and sector, DiskEdit will beep and pause. This is your lastchance to change your mind. Press RETURN to WRITE, or anyother key to escape.X Clears the screen and exits to BASIC.ASCn Filters

    The number following the filter (F) indicator is the filtercurrently selected.There are 9 filters. Each affects the format of the displayedscreen contents. They do not change the actual buffer contents inany way. They may be selected by pressing the correspondingnumber (1-9) key.RoBing your own

    The filters can be modified from the keyboard. Select a filter(1-9) by pressing the appropriate number key. Press the 'F' key.The 256 screen characters are divided into 8 blocks. Theprompt under 'BLOCK' indicates the original group of characterswhile the prompt under 'CHG:' indicates what characters will bedisplayed on the screen.The first prompt is 'INYl' for inverse letters. Press '7'. Thiscauses all inverse characters in block 1 to display as normal.Block 7 is normal letters. The 'INVl' prompt under 'CHG:' willchange to 'NOR2'. By pressing a number from 1 to 8, each ofthe original blocks can be changed to display as any other block.Pressing 'RETURN' will skip a block.Next to 'CHG:' is 'FN#'. The "FN#' is short for functionnumber. There are 3 functions.

    1. Print block, delete one character2. Delete block, print one character3. Delete entire blockCustomizing the Program

    DiskEdit is an Applesoft program with packed machine code.This means that the machine code portion of the program ishidden in such a way that DOS thinks it is part of the Applesoftprogram.The machine code is hidden behind the REM in line 0 ratherthan at the end of the BASIC program. This was done in orderto allow program modification while keeping the program size assmall as possible.

    I f you load the program and list it, you will see a singleBASIC line:oCALL 2167 : GOTO 10 : REM

    Book of Softkeys Vol. I 50

  • 8/14/2019 Book of Softkeys Volume 1

    55/162

  • 8/14/2019 Book of Softkeys Volume 1

    56/162

    320 GOSUB 50330 IF KY =141 THEN RETURN340 GOSUB 280350 IF KY =128 THEN GOSUB 120: GOTO 320360 IFPEEK (HF) AND KY >9 THEN GOSUB 120: GOTO 320370 RETURN380 REM CALCULATE HEX/DEC NO.390 IFNOT PEEK (HF) THEN KY =Al * 16 +A2: RETURN400 KY =A1 * 10 +A2: RETURN410 REM GET TRACK VALUE420 VTAB 22: HTAB 14 - PEEK (HF): GOSUB 320: IF KY >15 THEN KY =TK: GOTO480430 IFNOT PEEK (HF) AND KY >2 THEN 480440 IF KY >3THEN 480450 A1 =KY: PRINT N$; : GOSUB 320: IF KY >15 THEN KY =A1: GOT0480460 A2 =KY: GOSUB 390470 REM CHECK FOR VAL IDTRACK#480 IF KY 34 THEN PRINT G$; : GOTO 420490 REM SAVE OLD TRK#, POKE NEW500 TS =TK:TK =KY: POKE TR, TK: CALLTT510 REM GET SECTOR VALUE520 VTAB 22: HTAB 21 - ( PEEK (HF)) * 2: GOSUB 320: IF KY >15 THEN KY =SE:GOTO 620530 REM CHECK FOR HEX I/O540 IFNOT PEEK (HF) THEN 620550 REM SAVE KEY560 IFKY >1THEN 620570 REM GET ANOTHER KEY580 Al =KY: PR INT N$; : GOSUB 320: IF KY >15 THEN KY =Al : GOTO 620590 REM CHECK FOR VAL IDSECTOR#600 A2 =KY: GOSUB 390: IF KY 15 THEN PR INT G$ ; : GOTO 520610 REM SAVE OLD SCT#, POKE NEW620 SS =SE:SE =KY: POKE SC,SE: CALLTT630 REM IFWR ITE THEN LAST CHANCE640 IF PEEK (CM) =WRTHEN VTAB24: HTAB 2: PRINT "PRESS'RETURWTO'->";:FLASH: PRINT "WRITE";: NORMAL: PRINT "0 THEN

    Book of Softkeys Vol. I 52

  • 8/14/2019 Book of Softkeys Volume 1

    57/162

    GOSUB 240760 REM SAVE CURRENT TRACK/SECTOR770 TS =PEEK (TR):SS =PEEK (SC) :TK =TS:SE =SS780 CALL XC:KY =PEEK (225) - 192790 IF KY =- 5OR KY =- 21 THEN1380800 IFKY 26 THEN 750810 ON KY GOSUB 100,1870,1830,100,1400,840,1450,100,100,100,100,100,100,100,1590,1480,100,420,1680,100,100,100,1720 ,1740 ,100,100:GOTO 750820 PR INT G$; : GOTO 750830 REM *** DEFINE FILTER ***840 TEXT: HOME: VTAB 22: HTAB7: PRINT "CONF IGURAT IOWFOR'F ILTER'#" PEEK(FL)850 VTAB 2: PRI NT G$"#BLOCK....#CHG: ..FN#CHR$STATUS"

    860 PRINT870 DL =PEEK(231) +PEEK(232) *256 - 1:CG =PEEK(233) +PEEK(234) *256-1880 FI =PEEK (FL)890 REM PRINT CURRENT VALUES900FORX=1 T08: PRINT X" !"F$(X)"'->''';910 F=PEEK (CG +X)920 F1 = INT (F / 32) +X: IF Fl >8THEN Fl =F1 - 8930 F2 =F- ( INT (F / 32) *32)940 F3 =PEEK (DL +X)950 F4 =PEEK (NO +FI)960 F1 (X) =Fl: F2(X) =F2: F3(X) =F3 + (F(Fl) * (F2 0)) +(F(X) * (f2 =0))970PRINTF1"!"F$(F1);: HTAB23: PRINTF2;: HTAB27: POKE2091,F3: CALLHP: CALL AP: IFX1THEN 1000

    980 HTAB 36: IF F4 =1THEN PRINT"OW";990 IF F4 =0THEN PRINT "OFF";1000 PRINT: PRINT: NEXT1010 REM EDIT CURRENT VALUES1020 FOR X=1TO 8: VTAB X*2+2: HTAB 121030 REM GET BLOCK #1040 GOSUB 50:A =KY -176: IF N$ =CHR$ (13) THEN A=F1(X) :N$ =""1050 IF A< lOR A>8THEN PRINTG$;: GOTO 10401060 PRINT N$;': HTAB 15: PRINT F$(A);: HTAB 231070 C=F2 (X)1080 REM CALCULATE OFFSET1090 IFA> =XTHEN F=A- X1100 IFA

  • 8/14/2019 Book of Softkeys Volume 1

    58/162

    1180 KY =F3 (X): IF C=0THEN KY =01190 IFC< lOR C=3THEN 12701200 VTAB 20: HTAB 1: PR INT "ENTER CHARACTER: ,,, ; : GOSUB 50: IFKY =141 THENKY =F3(X)1210 IF KY 223 THEN PR INT G$; : GOTO 12001220 IF KY 191 THEN KY =KY + (l +A) * 321240 KY =KY - 256: HTAB 1: CALL - 868: VTAB X*2+21250 POKE DL +X, KY1260 HTAB 27: POKE 2091 ,KY: CALLHP: CALL AP1270 NEXT1280 REM GET FILTER STATUS1290 PRINT: PRINT: PRINT "LEAVE'FILTER'ON'DURING'EDIT?'(Y/";: INVERSE:PR INT "N"; : NORMAL: PR INT ") :"'G$; : GOSUB 501300 HTAB 1: CALL - 868: VTAB4: HTAB 36: IF N$ = "Y" THENA =1: PRINT"ON''' ; : GOTO 13201310 PRINT "OFF"; :A =01320 POKE NO +FI ,A1330 REM RESTORE SCREEN, EXIT1340 FOR X=1TO 500: NEXT1350 GOTO 7301360 REM +tED IT+t MODE ENTRY PO INT1370 IFF I =0THEN RETURN1380 VTAB 24: HTAB 2: INVERSE: PRINT"+tEDIT+t"; : POKE NC,O: GOT014101390 REM EDIT MODE ENTRY POINT1400 VTAB 24: HTAB 2: INVERSE: PR INT"ED IT";: POKE NC,11410 NORMAL: HTAB 12: PR INT "MODE" ; :1420 PRINT "AUPRESS''TO'EXIT";

    1430 CALL ED: VTAB 23: HTAB 1: CALL - 958: GOTO 801440 REM TURN SOUND ON/OFF1450 PR INT G$;: IF G$ =CHR$ (7) THEN G$ ="": RETURN1460 G$ =CHR$ (7): RETURN1470 REM *** PRINT HARDCOPY ***1480 IFNOT PR THEN GOSUB 17601490 GOSUB 301500 Al =PEEK (BF) *256 - 11510 PR# PR: PRINT1520 PR INT "TRACK: All ; : POKE NM, TK: CALL HX: PR INT '''SECTOR: "; : POKE NM, SE:CALL HX: PRINT"'VOLUME:'" PEEK (VO)1530 FOR X=0TO 255 STEP 16 I l l : POKE NM,X: CALL HX: HTAB5: PRINT "-";1540 FOR A=1TO 16 I LI : POKE2091, PEEK (AI +X+A) : CALLHP: NEXT1550 FOR A=1TO 16 I LI: POKE2091, PEEK (AI +X+A) : CALLAP: NEXT1560 PRINT: NEXT1570 PR# 0: GOTO 801580 REM ** * JUMP CURSOR ***1590 VTAB 22: HTAB 32 - PEEK (HF): GOSUB 320: IF KY >15 THEN CALL TT:RETURN1600 Al =KY: PR INT N$; : GOSUB 320: IF KY >15 THEN KY =AI: GOT01660

    Book of Softkeys Vol. I 54

  • 8/14/2019 Book of Softkeys Volume 1

    59/162

    1610 A2 =KY: PRINT N$;: GOSUB 390: IF NOT PEEK (HF) THEN 16601620 IF KY >25 THEN 16601630 Al =KY: GOSUB 320: IF KY >15 THEN KY =AI: GOTO 16601640 A2 =KY: PR INT N$; : GOSUB 390: IF KY 255 THEN CALL TT: GOTO15901650 REM CALCULATE NEW CURSOR POSN1660 POKE CS,KY: CALL MV: CALL TT: RETURN1670 REM CHANGE SLOT NO.1680 VTAB 22: HTAB 4: GOSUB 320: IF KY >15 THEN CALL TT: RETURN1690 IFKY 7THEN 16801700 POKE SL, KY * 16: CALL TT: RETURN1710 REM WR ITE ATRACK/SECTOR1720 POKE CM, WR: GOSUB 420: POKECM, RD: CALL TT: RETURN1730 REM CLEAR SCREEN, RECONNECT DOS AND EX ITTO BAS IC1740 TEXT: HOME: POKE 103,1: POKEI04, 8: CALL 1002: END1750 REM FIND PRINTER SLOT1760 GOSUB 30: VTAB 12: PRINT "WH ICWSLOT'I S'YOUR'PR INTER'USING?'I-r" ;:GOSUB 320: IFKY >15 THEN RETURN1770 IF KY >7THEN GOSUB 120: GOT017601780 IFNOT KY THEN RETURN1790 PR =KY: LI =21800 PR INT : PRI NT : PRINTTAB(6) "PR INT'US ING'80'COLUMNS'(Y/";: INVERSE:PRINT "N";: NORMAL: PRINT ") :";: GOSUB 50: IFN$ = "Y" THEN LI =11810 RETURN1820 REM CALL FOR CATALOG1830 CALL 1002: ONERR GOTO 18501840 GOSUB 30: PRINT: PRINT CHR$(4) "CATALOG,D" PEEK (DR)",S" PEEK (SL) /16: PRINT: CALLFR: POKE 35,24: VTAB 24: HTAB7: PRINT

    "PRESS'ANY'KEY'TO'CONTINUE 4 l ' ; : GOSUB 210: GOT07301850 POKE 216,0: GOTO 2401860 REM DISASSEMBLE THE BUFFER1870 GOSUB 30: VTAB 21: PRINT: PRINT:KY =PEEK (CS)1880 REM START AT CURSOR1890 POKE 58, KY: POKE 59, PEEK (BF)1900 Al =0:A2 =211910 REM START AT LAST BYTE1920 FOR X=1TO A2: IF PEEK (59) >PEEK (BF) THEN :Al =1: IF PEEK (1152) 160 THEN PRINT: GOTO 20901930 IFAl THEN PR INT : NEXT : GOT020901940 CALL BI1950 NEXT1960 REM KEY? =EXIT1970 GOSUB 210: IF KY =155 THEN21301980 REM KEY? =20 LI NES1990 IF KY =141 THEN 19002000 REM KEY? =1LINE2010 IF KY =160 THEN A2 =1: GOT019202020 IF KY =213 THEN GOSUB 140: GOSUB 1550: VTAB 1: GOTO 189055 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    60/162

    2030 IF KY 208 THEN 19702040 REM PR INT SCREEN2050 GOSUB 140:L=KY2060 IFNOT PR THEN GOSUB 17602070 HOME: KY =L: PR# PR: GOT018902080 REM PR INT EX ITMESSAGE2090 PR INT "ENO'OF'BUFFER'PRESS'RETURWTO'CONT INUE" ; : GOSUB2102100 REM LAST CHANCE TO PR INT2110 IF KY =208 THEN 20502120 REM EXIT BINARY ROUTINE2130 PR INT : POKE 35 I 24: PR# 0: GOT07302140 REM OEFINE VARIABLES2150 RD =1:WR =2: LI =22160 SL =2071 :OR =2072:VO =2084:TR =2074:SC =2075:CM =20822170 NM =2091 :FL =2101 :EF =2094:HF =2095:CS =2100:BF =21032180 NC =20992190 FI =PEEK (FL)2200 NO =PEEK (2106) +PEEK (2107) *256221010= 2111:MV= 2114:HX= 2117:EO= 2120:B' =2123:FR=2126:IT=2129:XC =21352220 HP =2141 :AP =21442230 F$(l) = "INV1":F$(2) = "INV2":F$(3) = "FLS1":F$(4) = "FLS2":F$(5) ="CTRL":F$(6) = "NOR1":F$(7) = "NOR2":F$(8) ="L/C'"2240 F(l) =192:F(2) =128:F(3) =128:F(4) =64:F(5) =64:F(6) =O:F(7) =0:F(8) =-642250 G$ =CHR$ (7)2260 VTAB 8: PRINT "O'SKEOIT....VERS'0N...4 "0": PRINT

    "'COPYR IGHT'1981' (C) 'HARDCORE'COMPUT 1ST": PR INT2270HTAB5: FORX=l T032: PRINT"-";: NEXT: PRINT: HTAB6: PRINT"A'O ISK'EO ITING'UT ILITY'PROGRAM"2280 HTAB 5: FOR X=1TO 32: PRINT"-";: NEXT: PRINT: PRINT2290 VTAB 22: PRI NT "I NSERT'OISK'--'PRESS'ANY'KEY'TO'CONTINUE"; : GOSUB210: VTAB 22: CALL - 958: GOTO 730

    Diskedit source code00100015 * OISKEOIT II - VERSION 4.10020 * COPYRIGHT 1981 SOFTKEY0025 * LAST UPOATEO MAR 24 8400300035 .OR $8000040 .TF EDO0045

    0022- 0050 WNOTOP .EQ $220023- 0055 WNOBTM .EQ $230024- 0060 CH .EQ $240025- 0065 CV .EQ $250026- 0070 BASE2 .EQ $26,27Book of Softkeys Vol. I 56

  • 8/14/2019 Book of Softkeys Volume 1

    61/162

    0028- 0075 BASEl .EQ $28,29003A- 0080 PCL .EQ $3A, 3B0048- 0085 10BPL .EQ $480067- 0090 PRGSTR .EQ $67OOEO- 0095 LOC .EQ $EOOOEl- 0100 NUM .EQ $E100E4- 0105 BUFFER. PO INTER .EQ $E400E7- 0110 DCHR .EQ $E7, E800E9- 0115 CFLT .EQ $E9,EA0309- 0120 RWTS .EQ $30903E3- 0125 GET! OB .EQ $3E3COOO- 0130 KEY .EQ $COOOC010- 0135 STROBE .EQ $C010B3F2- 0140 VTOC .EQ $B3F2E024- 0145 L1NPRT .EQ $E024F88C- 0150 INSOS .EQ $F88CF803- 0155 INSTDS .EQ $F803F94A- 0160 PRBLANK .EQ $F94AF953- 0165 PCAOJ .EQ $F953FC58- 0170 HOME .EQ $FC58FC62- 0175 CR. LF .EQ $FC62FOOA- 0180 PRHEX .EQ $FOOAFOEO- 0185 COUT .EQ $FOEO

    0190 * -------------------------------CHARACTER CODES0080- 0195 CTRL.AT .EQ $800081- 0200 CTRL.A .EQ $810082- 0205 CTRL.B .EQ $820084- 0210 CTRL.0 .EQ $840086- 0215 CTRL.F .EQ $860088- 0220 CTRL.H .EQ $880089- 0225 CTRL. I .EQ $89008C- 0230 CTRL.L .EQ $8C0080- 0235 RETURN .EQ $80008E- 0240 CTRL.N .EQ $8E0091- 0245 CTRL.Q .EQ $910095- 0250 CTRL.U .EQ $95009A- 0255 CTRL.Z .EQ $9A009B- 0260 ESCAPE .EQ $9BOOAO- 0265 SPACE .EQ $AOOOAA- 0270 STAR .EQ $AAOOAE- 0275 PER I00 .EQ $AE00B5- 0280 FIVE .EQ $B500C9- 0285 LTR. I .EQ $C9OOCA- 0290 LTR.J .EQ $CAOOCB- 0295 LTR.K .EQ $CBOOCO- 0300 LTR.M .EQ $CO

    0305

    57 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    62/162

    TYPE CODEPHASES/TRKTIME COUNT

    COMMANDERROR CODEVOLUME #PREVo SLOTPREVo DRIVE

    SLOT * 16DRIVE #REQ. VOLUMETRACK #SECTOR #

    .HS 36373AAB31303AB2

    .HS 000000JMP INITDOS

    .HS 00

    .HS 01

    .HS EFD8

    .HS 01

    .HS 60

    .HS 01

    .HS 00

    .HS 00

    .HS 00.DA OCT.DA BUFFER

    .HS 0000

    .HS 01

    .HS 00

    .HS 00

    .HS 60

    .HS 01

    0310 * ---------------------IST LINE OF BASIC PROGRAM0315

    0800- 00 11 080803- 00 00 8C0806- 32 30 0320 START .HS 00110800008C32300808- 36 37 3A080B- AB 31 30 .080E- 3A B2 03250810- 00 00 00 03300813- 4C 73 08 0335

    03400345 * ---------------------------- INPUT/OUTPUT BLOCK03500355 10BIND0360 SLOT0365 DRIVE0370 EXPVOL0375 TRACK0380 SECTOR0385039003950400 CMND0405 ERCODE0410 VOLUME0415 OLDSLOT0420 OLDRIVE04250827- 00 0430 OCT

    0828- 01 0435 PHASES0829- EF D8 0440

    04450450 * -------------------------------BASIC variables04550460 BYTE .HS 00 NM0465 OLDTRK .HS 00 OT0470 OLDSCT .HS 00 OS0475 ERRFLG .HS 00 EF0480 HEX.OR.DEC.FLG .HS 00 HF0485 ON.OFF .HS 01 ST0490 CFLG .HS 01 PF0495 .HS 000500 USE.CTRL.CHARS .HS 00 TH0505 CRSVAL .HS 00 CS0510 FLTNUM .HS 01 FL0515 .HS 000520 .DA /BUFFER BF0525 .HS 0000

    0816- 010817- 600818- 010819- 00081A- 00081B- 00081C- 27 08081E- 00 090820- 00 000822- 010823- 000824- 000825- 600826- 01

    082B- 00082C- 00082D- 00082E- 00082F- 000830- 010831- 010832- 000833- 000834- 000835- 010836- 000837- 090838- 00 00

    Book of Softkeys Vol. I 58

  • 8/14/2019 Book of Softkeys Volume 1

    63/162

    NO

    JMP CALLIO 10JMP PRINT.SCREEN.DATAJMP HXBYTEJMP EDIT EDJMP BINARY BIJMP CALC.FREE.SECTORS FRJMP PROMPT TTJMP PROMPTO T1JMP PARSE XCJMP FILTERO HCJMP HEXPRINT HPJMP ASCPRINT APJMP RIGHT UNUSED.HS 606060 UNUSED

    .DA FSTAT.HS 000000

    0869- 00086A- FF086B- 01086C- 000860- 00086E- 00086F- 010870- 100871- 230872- 00

    0887- A9 IF0889- 85 67088B- A9 12

    083A- 8B OC 0530083C- 00 00 00 053505400545 * ------------------------------ BAS ICCa II tab Ie0550083F- 4C 90 08 05550842- 4C 29 OA 05600845- 4C OE 12 05650848- 4C 7E OF 0570084B- 4C 00 OA 0575084E- 4C 6B OB 05800851- 4C C9 OC 05850854- 4C BD OC 05900857- 4C 50 OE 0595085A- 4C AE OB 06000850- 4C 03 12 06050860- 4C DA 11 06100863- 4C OA OE 06150866- 60 60 60 06200625

    0630 * ---------------------------- INTERNAL VARIABLES06350640 OFFSET .HS 000645 FIRST .HS FF0650 EDFLG .HS 010655 HCOUNT .HS 000660 SPACES .HS 000665 EDIT.MODE.FLAG .HS 000670 KEYFLG .HS 010675 MAXSCT .HS 100680 MAXTRK .HS 230685 SPECIAL.FUNCTION .HS 0006900695 * ------------------------------Get DOS pointers07000873- 20 E3 03 0705 INITDOS JSR GET lOB

    0876- 84 48 0710 STY IOBPL0878- 85 49 0715 STA IOBPLtl087A- AO 01 0720 LOY #1087C- B1 48 0725 LOA (I OBPL) ,Y087E- 80 17 08 0730 STA SLOT0881- C8 0735 INY0882- B1 48 0740 LOA (IOBPL),Y0884- 80 18 08 0745 STA DRIVE0750 * -------------------------Reset program pointer0755 LOA #STOP0760 STA PRGSTR0765 LOA /STOP

    59 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    64/162

    PRINT

    GET ERROR #

    Print dashand aspace.Oisassemcurrentinst r.&updateprg cntr.

    lOA FlTNUMASlASlTAXlOY #0lOA FlT.lOC,X

    lOA /IOBINOlOY #IOBINOJSR RWTSBCC .1lOA ERCOOESTA ERRFlGRTS

    lOA #RETURNJSR COUTlOA PClSTA BYTEJSR HXBYTElOA #4STA CHlOA #$AOJSR COUTlOX #1JSR PRBlANKJSR INSOSJSR INSTDSJSR PCAOJSTA PClSTY PCltlRTS

    STA PRGSTRtlRTS

    08AO0900-

    0880- 85 68 0770088F- 60 077507800785 * ------------------Call Read/Write Track Sector07900890- A9 08 0795 CAlllO0892- AO 16 08000894- 20 09 03 08050897- 90 06 08100899- AD 23 08 0815089C- 80 2E 08 0820089F- 60 0825 .108300835 * ------------------------------- Put buffer here08400845 .BS $900- *0850 BUFFER .BS $100 256 bytes08550860 * --------------------Oisassemble an instruction0865OAOO- A9 80 0870 BINARYOA02- 20 ED FO 0875OA05- A5 3A 0880OA07- 80 2B 08 0885OAOA- 20 OE 12 0890OAOO- A9 04 0895 STEPOAOF- 85 24 0900OA11- A9 AD 0905OA13- 20 ED FO 0910OA16- A2 01 0915OA18- 20 4A F9 0920OA1B- 20 8C F8 0925OA1E- 20 03 F8 0930OA21- 20 53 F9 0935OA24- 85 3A 0940OA26- 84 3B 0945OA28- 60 095009550960 * -------------------------------Select a fi Iter09650970 PRINT.SCREEN.OATA0975OA29- AD 35 08 0980OA2C- OA 0985OA20- OA 0990OA2E- AA 0995OA2F- AO 00 1000OA31- BO 95 OC 1005 .1

    Book of Softkeys Vol. I 60

  • 8/14/2019 Book of Softkeys Volume 1

    65/162

    Line 1

    Last line?No!

    STA DCHR,YINXINYCPY #4BCC .1

    LDA #0STA BUFFER. POINTERSTA CVJSR PRINT.OLD.LINEINC CVLDA CVCMP #20BNE .2LDA CVJSR FIND.BASE.ADDRLDY #39LDA #SPACESTA (BASE1),YDEYBPL .3JMP PROMPT

    .DA $400.DA $480.DA $500.DA $580.DA $600.DA $680.DA $700.DA $780.DA $428.DA $4A8.DA $528.DA $5A8.DA $628.DA $6A8.DA $728.DA $7A8.DA $450.DA $4DO.DA $550

    OA34- 99 E7 00 1010OA37- E8 1015OA38- C8 1020OA39- CO 04 1025OA3B- 90 F4 1030

    10351040 * ------------------- Pr int buffer data to screen1045OA3D- A9 00 1050OA3F- 85 E4 1055OA41- 85 25 1060OA43- 20 CF OA 1065 .2OA46- E6 25 1070OA48- A5 25 1075OA4A- C9 14 1080OA4C- DO F5 1085OA4E- A5 25 1090OA50- 20 8F OA 1095OA53- AO 27 1100OA55- A9 AO 1105OA57- 91 28 1110.3OA59- 88 1115OA5A- 10 FB 1120OA5C- 4C C9 OC 112511301135 * ----------------Memory locations for text scrn11401145 TEXT.SCREEN.BYTE1150115511601165117011751180

    1185119011951200120512101215122012251230123512401245

    OA5F- 00 04OA61- 80 04OA63- 00 05OA65- 80 05OA67- 00 06OA69- 80 06OA6B- 00 07OA6D- 80 07OA6F- 28 04OA71- A8 04OA73- 28 05OA75- A8 05OA77- 28 06OA79- A8 06OA7B- 28 07OA7D- A8 07OA7F- 50 04OA81- DO 04OA83- 50 0561 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    66/162

    Line 24

    LOX #20DEXLOA FIRST.CHAR.POSN,XCMP CRSVALBCC .2BEQ .2JMP .iSTX CVSTA BUFFER. POINTERRTS

    ASLTAXLOA TEXT.SCREEN.BYTE,XSTA BASElCLCADC #27STA BASE2LOA TEXT. SCREEN. BYTE+1 ,XSTA BASE1+1STA BASE2+1RTS

    .HS 5B6875828F9CA9

    .HS B6C3DODDEAF7

    .HS 00001A2734414E

    .OA $500.OA $650.OA $600.OA $750.OA $700

    12501255126012651270127512801285 * ----------------------Enter with Iine# in ACC.12901295 FINO.BASE.ADOR1300OA8F- OA 1305OA90- AA 1310OA91- BO SF OA 1315OA94- 85 28 1320OA96- 18 1325OA97- 69 1B 1330OA99- 85 26 1335OA9B- BO 60 OA 1340OA9E- 85 29 1345

    OAAO- 85 27 1350OAA2- 60 135513601365 * ----------------------- Convert CRSVAL to Ii ne#13701375 FINO.CURRENT.LINE1380OAA3- A2 14 1385OAA5- CA 1390 .1OAA6- BO B8 OA 1395OAA9- CO 34 08 1400OAAC- 90 05 1405OAAE- FO 03 1410OABO- 4CA50A 1415OAB3- 86 25 1420.2OAB5- 85 E4 1425OAB7- 60 143014351440 FIRST.CHAR.POSN1445OAB8- 00 00 1AOABB- 27 34 41OABE- 4E 1450OABF- 5B 68 75OAC2- 82 8F 9COAC5- A9 1455OAC6- B6 C3 00OAC9- DO EA F7 1460

    OA85- 00 050A87- 50 06OA89- 00 06OA8B- 50 07OA80- 00 07

    Book of Softkeys Vol. I 62

  • 8/14/2019 Book of Softkeys Volume 1

    67/162

    JSR FIND.CURRENT.lINE

    lOA CVJSR FIND.BASE.ADDRlOA #13STA HCOUNTlOX BUFFER. POINTERlOA BUFFER,XPHACPX CRSVAlBNE .3lOX KEVFlGBZR .4JSR FilTERlDV #0STA (BASE2),VINC BASE2PlAlOX KEVFlGBZR .9PHAlSRlSRlSRlSRlOX BUFFER. POINTERCPX CRSVAlBNE .5ORA #$30CUP #$3ABCC .6SBC #$39JUP .6ORA #$BOCUP #$BABCC .6ADC #$06STA (BASE1),VINC BASElPLAAND #$OFlOX BUFFER. POINTERCPX CRSVAl

    14651470 PRINT.NEW.lINE1475OACC- 20 A3 OA 148014851490 PRINT.OlD.lINE1495OACF- A5 25 1500OAD1- 20 8F OA 15050AD4- A9 00 1510OAD6- 80 6C 08 1515OAD9- A6 E4 1520OADB- BD 00 09 1525 .2OADE- 48 1530OADF- EC 34 08 1535OAE2- DO 05 1540OAE4- AE 6F 08 1545OAE7- FO 03 1550OAE9- 20 BlOB 1555 .3OAEC- AO 00 1560.4OAEE- 91 26 1565OAFO- E6 26 1570OAF2- 68 1575OAF3- AE 6F 08 1580OAF6- FO 44 1585OAF8- 48 1590OAF9- 4A 1595OAFA- 4A 1600OAFB- 4A 1605OAFC- 4A 1610OAFD- A6 E4 1615OAFF- EC 34 08 1620OB02- DO OB 1625OB04- 09 30 1630OB06- C9 3A 1635OB08- 90 00 1640OBOA- E9 39 1645OBOC- 4C 17 OS 1650OBOF- 09 BO 1655.5OB11- C9 BA 1660OB13- 90 02 1665OB15- 69 06 1670OB17- 91 28 1675.6OB19- E6 28 1680OB1B- 68 1685OB1C- 29 OF 1690OB1E- A6 E4 1695OB20- EC 34 08 17003 Book of Softkeys Vol. I

  • 8/14/2019 Book of Softkeys Volume 1

    68/162

    LOA #$00STA NUMSTA NUM+1LOY #$C8LOA VTOC,YBEQ .2ASLBCC NXTBIT

    BNE .7ORA #$30CUP #$3ABCC .8SBC #$39JUP .8ORA #$BOCUP #$BABCC .8ADC #$06STA (BASE1),YINC BASElINC BUFFER.POINTERLOX BUFFER.POINTERBZR .10DEC HCOUNTLOA HCOUNTBNE .2LOX KEYFLGBZR .12LOA #$AOSTA (BASE1),YLOX CVCPX #19BNE .12LOA #SPACESTA (BASE2),YSTA (BASE1),YINC BASElSTA (BASE1),YINYCPY #4BNE .11STA (BASE1),YRTS

    OB23- DO OB 1705OB25- 09 30 1710OB27- C9 3A 1715OB29- 90 00 1720OB2B- E9 39 1725OB20- 4C 38 OB 1730OB30- 09 BO 1735.7OB32- C9 BA 1740OB34- 90 02 1745OB36- 69 06 1750OB38- 91 28 1755.8OB3A- E6 28