Use Newdos Disassem On Your

By M.C. Matthews

The Sep/Oct 1991 issue of TRSTimes brought you patches to convert Newdos/80 EDTASM to work flawlessly on Model 4 LS-DOS6. This installment will focus on converting another of the great NEWDOS/8O utilities, DISASSEM, so that it will work on Model 4.

DISASSEM/CMD was included on the NEWDOS/8O master disk and, for anyone interested in assembly language, it was a gem. As a matter of fact, it is still a gem.

In order to make DISASSEM/CMD work with Model 4, the first order of business is to copy the program to a disk that LS-DOS can read. This can be done in several ways, but the easiest is probably as follows:

1. Boot up you Model 4 in Model III mode with NEW-DOS/8O v2. (It is assumed that you have the Model III version of NEWDOS/8O. If you have the Model I version, you obviously cannot boot a Model 4 in III mode. Hopefully, in addition to your Mod 4, you will have a Model I. If so, boot the Mod I and follow the rest of the instructions.)

2. Configure drive :1 to read and write a standard 35 track, single-density diskette.

PDRIVE,0,1 ,TI = A,TD = A,TC = 35,SPT = 10.TSR = 3,

3. Insert a blank diskette in drive :1, then format it.

FORMAT, 1

4. Copy DISASSEM/CMD from the NEWDOS/8O disk in drive :0 to the data disk in drive :1.

COPY DISASSEM/CMD-.O :1

5. Remove the NEWDOS/8O disk from drive :0. Insert an LS-DOS6 boot disk and reboot. (The Mod I people need to remove the data disk created on the Mod I. Boot up the Mod 4 with LS-DOS6, then insert the data disk into drive :1).

6. Make sure your copy of DISASSEM/CMD is good.

Check the directory display carefully - this is very important - if the filename (DISASSEM/CMD) is followed by a question mark, it means that the file was not closed properly by LS-DOS6 standards during the copy procedure. As this will most likely happen, don't worry, simply issue the command to close the file properly:

RESET DISASSEM/CMD: 1

7. Check the status of the file again.

The question mark following the filename should now have disappeared, indicating that the file is OK. If the question mark is still there, go back to step 1 and do everything again.

When DISASSEM/CMD has been transferred successfully, it is recommended that you copy it to your LS-DOS disk in drive :0

Keep in mind that you should not attempt to execute DISASSEM now or at any time from LS-DOS. It is NOT a Model 4 program and it simply will not work. At best you'll get an error message - at worst your house blows up!

Makling any Model l/lli machine language program work on a Model 4 requires patching. There are two distinct ways of patching such a program. The first method is the 'direct patch'. This is the method we used to modify EDTASM/CMD in the last issue; that is, the program is altered once and for all, directly from the DOS command line.

The second method is the 'loader patch'. This is an interesting and effective way of doing things. In essence, the program is stored on the disk in its original format. It will not work as is, so a 'loader program' has to be written. The 'loader program' loads the original program into its normal memory locations and then proceeds to modify the incompatible code right in memory. Finally, the 'loader' will transfer control to the modified program.

Method #2 is what we'll use to get DISASSEM/CMD up and running on the Model 4. The 'loader' program is called DISSEM/CMD and it can be generated by typing in and assembling the listing to DISSEM/SRC shown below.

DISSEM/CMD actually begins with the MOD4EA routine in line 380. Here the stack pointer is saved to SPSAVE. Then IY is made to point to the FLAGS table and saved to FLAGS.

The HIGH routine finds HIGH$ and stores this value in MEMEND.

Line 500 contains the LOAD routine. DISASSEM/CMD is loaded to memory at its normal transfer address. Then (line 540) the transfer address is saved on the stack.

Once loaded, the PATCH routine in line 560 takes over. The address of the NEWDOS keyboard routine is altered to point to the KBD routine found in line 1080.

The address of the NEWDOS display routine is changed to point to the DSP routine found in line 1120.

The addresses of other vital NEWDOS routines are modified to point to their respective Model 4 routines found in lines 1190 through the end of the listing.

Finally, the RET in line 1060 transfers control to DISAS-SEM/CMD.

Type in and assemble DISSEM/SRC and enjoy a great disassembler on your Model 4.

DISSEM/SRC

00100 ;DISSEM/CMD. Program to run 00110 ;DISASSEM/CMD on Mod 4. 00120 ;M.C.Matthews 00130 ;
0 0

Post a comment