MediaWiki:Sitenotice:
2024-03-02: The wiki ran out of disk space, so things were not working. This has been resolved by adding another 5GB of quota ;-) Thanks to Tim Lindner for reporting the issues. 2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)

Patch EDTASM+ To Disk

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Revision as of 05:41, 13 October 2015 by Luis46coco (talk | contribs)
Jump to navigation Jump to search

Patch EDTASM+ To Disk - To End Those Cassette Blues - By Roger Schrag

From: The Raimbow Magazine DIC 1982, Pag 29.

Radio Shack's EDTASM+ package is a powerful, well-written programming tool. But for people with disk drives, it is very agonizing to have to go back to using cassettes to store source code files. There are editor assemblers on the market that do support disk drives, but they are usually much more expensive, and sometimes require the Flex Operating System, or something else that not everyone owns.

What I have put together here is a series of patches that make EDTASM+ use the disk drive instead of the tape recorder for mass storage. The finished product requires only 16K Extended Basic and one drive.

Patching EDTASM+ to use disks is relatively easy to do. The first thing is to move it into RAM so that we can alter bytes of code and thus alter its operation. The move can be accomplished by typing in U C000 1000 27FF from Zbug. To save a copy of it on tape, enter P EDTASM 1000 37FE 1000. Since it was written entirely in position independent code, it can reside anywhere in memory, and function without modification.

The next step is to enter the source code shown in the listing. Assemble it onto tape directly after the copy of EDTASM+ you made from Zbug. You'll probably also want to save the source code for future use.

Now you are ready to load in the files you have saved on the tape. First, you will want to insert your disk cartridge so that the finished product can be saved on disk. Type CLOADM to load the RAM version of EDTASM+, but don't execute it yet. Next, load in the patches you keyed in by typing CLOADM again. Parts of EDTASM+ will now be overwritten with new code, and a block of additional subroutines will be added on.

You may save the finished program onto disk by typing in SAVEM "EDTASM+",&HE80, &H37FF, &HE80. Now whenever you want to use your editor assembler, just enter LOADM "EDTASM+": EXEC. with the disk version of EDTASM+, the L,W,A, and V commands will work differently than they used to. To load source code, simply press L and enter. The computer will ask for a filename. Type in a standard filename as you would in Basic. If you don't specify an extension, none will be assumed. The file will then be loaded. The W command works in the same way.

To assemble a program, type in A and any assembly switches you would like to use. Unless you choose the IM or NO options, you will be asked for the filename. As the listing scrolls across the screen, the computer will stop from time to time to write a sector to the disk. If you press Break, you may have to wait a moment for the computer to close the file.

The V command will merely open a file and close it again. This verifies that a file is listed in the directory and that there are no problems with its structure.

On a 16K machine, you will have 1.5K for your text buffer. A 32K machine will offer 17.5K. For those of you who have source code files on tape, you may transfer them to diskette with the Basic program I have included. EDTASM+ uses ASCII codes that Basic doesn't recognize.Therefore INPUT#-I can't be used to read the source code file from the cassette. A machine language routine is necessary.

Listing I:

00001 *************************
00002 * EDTASM+ HITS THE DISK *
00003 *************************
00004 *
00005 *BY ROGER SCHRAG
00006 * 10/15/82
00007 *
00008 *
00009 *HAKE SURE INTERRUPTS ARE ENABLED
00010 *SO THAT THE DISK DRIVE WILL
00011 *SHUT OFF PROPERLY
00012         ORG    $1516
00013         LBSR   INTRPT
00014 *
00015 *
00016 *CHANGE FILENAME HANDLING SYSTEM
00017 *TO ALLOW THE USER TO ENTER FULL
00018 *DISK FILE NAMES: FILENAME/EXT:D
00019         ORG    $15E0
00020         LBRA   FNAME
00021 *
00022 *
00023 *CHANGE REFERENCES TO DEVICE #-1
00024 *(TAPE) TO DEVICE #1 (DISK)
0002S         ORG    $1547
00026         LDB    #1
00027         ORG    $1574
00028         LDB    #1
00029         ORG    #15AD
00030         LDA    #1
00031         ORG    #15CD
00032         LDA    #1
00033 *
00034 *
00035 *HAKE SURE THE DISK FILE HAS BEEN
00036 *CLOSED WHEN ACCESS TO IT IS COMPLETE
00037         ORG    $1B52
00038         LBSR   CLOSE
00039 *
00040 *
00041 *AT THE RIGHT TIME, CALL A ROUTINE
00042 *TO OPEN THE DISK FILE, INSTEAD OF
00043 *A ROUTINE TO OPEN THE TAPE FILE
00044         ORG    #15BA   PATCHES INTO
00045         LDU    #ASSEM  "A" COMMAND
00046         ORG    $15BF   PATCHES INTO 
00047         LDU    #LOAD   "L" COMMAND 
00048         ORG    $15C4   PATCHES INTO 
00049         LDU    WRITE   "W" COMMAND 
00050         ORG    $163A   PATCHES INTO 
00051         LDU    #LOAD   "V" COMMAND 
00052 * 
00053 * 
00054 *ALTER ERROR HANDLIN6 SYSTEM TO 
00055 *ACCOUNT FOR NEW ERROR MESSAGES 
00056         ORG    #1721 
00057         LBSR   ERROR1 
00058         CLR    <$1 
00059         CLR    <$4 
00060         LBSR   ERR0R2 
00061         LBRA   $172F 
00062 *
00063 *
00064         ORG    $E80 
00065 *
00066 *
00067 *NEW ENTRY AREA TO EDTASM 
00068 START   LDX    #$1E00   HE MUST FIRST 
00069         LDA    l$AF     FIX THE THREE 
00070         STA    ,X+      BYTES THAT 
00071         LDA    #$5A     BASIC CLOBBERS 
00072         STA    ,X+      WHILE LOADING 
00073         LDA    #$26     EDTASN+ INTO 
00074         STA    ,X       MEMORY
00075         LDA    #$38     NEXT SET THE 
00076         STA    >$FF     LOW MEM POINTER 
00077         LBRA   $1005    ENTER PROGRAM 
00078 *
00079 *
00080 *SUBROUTINES CALLED BY THE PR06RAM 
00081 *PATCHES TO ENABLE THE NEW FEATURES 
00082 *
00083 *
00084 *ENABLE ALL INTERRUPTS SO THAT THE 
00085 *DISK DRIVE WILL SHUT OFF CORRECTLY 
00086 *AFTER TWO SECONDS OF NOT BEIN6 USED 
00087 INTRPT  CLRB            CLEAR B 
00088         TFR    B,DP     CLEAR DP 
00089         ANDCC  #0       ENABLE INTERRUPTS 
00090         RTS             RETURN TO PROGRAM 
00093 *CLOSE FILES & RETURN TO PROGRAM 
00094 CLOSE   JSR    $CA3B    CLOSE FILES 
00095         LBRA   $1377    RETURN TO PROGRAM 
00096 * 
00097 * 
00098 *ROUTINE TO ALLOW YOU TO ENTER A 
00099 *NAME FOR THE DISK FILE 
00100 FNAKE   PSHS   U        SAVE U 
00101         LEAX   PROMPT,PCR "FILENAME?" 
00102         LBSR   $1221   PRINT PROMPT 
00103         LBSR   $1EC6   GET USER INPUT 
00104         LDB    <$12    GET LEN6TH OF INPUT 
00105         LDX    <$13    GET ADDRESS OF INPUT 
00106         PSHS   DP      SAVE DP 
00107         CLRA           CLEAR A 
00108         TFR    A, DP   CLEAR DP 
00109         LEAY   BACK,PCR SAVE A RETURN 
00110         PSHS   Y       ADDRESS ON STACK 
00111         CLR    ,-S     LOWER STACK 
00112         LDA    $95A    SET DEFAULT 
00113         STA    $EB     DRIVE NUMBER 
00114         LDY    #$94C   NAME STORAGE AREA 
00115         LDA    #$20    ASCII SPACE 
00116 ERASE   STA    ,Y+     ERASE FILENAME 
00117         CMPY   #$957   STORAGE AREA 
00118         BNE    ERASE
00119         JMP    $C8A4   GO GET FILENAME 
00120 BACK    PULS   DP      RETRIEVE DP 
00121         PULS   U       RETRIEVE U 
00122         RTS            RETURN TO PROGRAM 
00123 PROMPT  FCC    *FILENAME?*
00124         FCB    $A0     TERMINATOR 
00125 *
00126 *
00127 *ROUTINES TO OPEN A DISK FILE 
00128 *NOTE THAT THERE ARE SLIGHT DIFFERENCES 
00129 *FOR LOAD, WRITE, AND ASSEMBLE 
00130 LOAD    LDA    #$49    (I)NPUT MODE 
00131         LDX    #$1FF   ASCII FORMAT 
00132         BRA    OPEN    GO OPEN FILE 
00133 WRITE   LDA    #$4F    (O)UTPUT MODE 
00134         LDX    #$1FF   ASCII FORMAT 
10135         BRA    OPEN    GO OPEN FILE 
00136 ASSEH   LDA    #$4F    (O)UTPUT MODE 
00137         LDX    #$200   BINARY FORMAT 
00138 OPEN    STX    $957    STORE FORMAT 
00139         LDX    #$100   RECORD LENGTH 
00140         STX    #97C    IS 256 BYTES 
00141         LDB    #l      USE DEVICE #1 
00142         JMP    $C468   GO OPEN FILE 
00143 *
00144 *
00145 *ALTER ERROR HANDLING ROUTINE TO 
00146 *HANDLE NEN DISK RELATED ERRORS: 
00147 * DF VF NE MP FN FH 
00148 *IF NOT ONE OF THOSE, 
00149 *IS ASSUMED TO BE 10 
00150 ERROR1  EXG    A,B     CODE INTO A 
00151         CLRB           CLEAR B 
00152         LDX    #CODES  LIST OF ERRORS 
00153 GETERR  CMPA   B,X     COMPARE CODES 
00154         BEQ    RET     RETURN IF MATCH 
00155         TST    B,X     SEE IF AT END 
00156         BEQ    RET     RETURN IF SO 
00157         INCB           GET NEXT CODE 
00158         BRA    GETERR  LOOP BACK 
00159 RET     RTS            RETURN TO PROGRAM 
00160 ERR0R2  LEAX   ERRS,PCR MESSAGE TABLE
00161         LBRA   $121E   GO PRINT MESSAGE  
00162 *
00163 *
00164 *LIST OF ERROR CODES 
00165 CODES   FCB    $38     DF 
00166         FCB    $32     VF 
00167         FCB    $34     NE 
00168         FCB    $3C     WP
00169         HUB    $3E     FN 
00170         FCB    $2A     FM 
00171         FCB    $0 
00172 *
00173 *
00174 *LIST OF ERROR MESSAGES 
00175 ERRS    FCC    *DISK FULL* 
00176         FCB    $A0     TERMINATOR 
00177         FCC    *VERIFICATION ERROR* 
00178         FCB    $A0     TERMINATOR 
00179         FCC    *FILE NOT FOUND* 
00180         FCB    $A0     TERMINATOR 
00181         FCC    *HRITE PROTECT* 
00182         FCB    $A0     TERMINATOR 
00183         FCC    *BAD FILENAME* 
00184         FCB    $A0     TERMINATOR 
00185         FCC    *BAD FILE MODE* 
00186         FCB    $A0     TERMINATOR 
00187         FCC    *I/O ERROR* 
00188         FCB    $A0     TERMINATOR 
00189         END    START