Documentation for Model 4 Edtasm.
Modified by M.C.Matthews.

1.   This is the version of Edtasm modified by APPARAT for use with NEWDOS 80-2.It had certain disadvantages, the principal one being that the switches which   controlled the line printer and stoppage on errors, among other things, did not work in Model 4.   These weaknesses have been rectified.

2.   Operation is exactly as the NEWDOS version except that if an error is foundduring assembly it will stop, displaying the error message and the offending    line.If BREAK is pressed it will exit from the assembly to the command mode for editing, while pressing any other key will continue the assembly.

3.   When assembly is complete it will display the total errors and free memory,and again wait.   Pressing BREAK will exit to command mode, while any other key will continue.

4.   The amendments have been made by patching, the space used being that       devoted to Tape routines.   Accordingly the program cannot be used with Tape.

5.   The following summary of operations is recorded for the benefit of anyone  wishing to make further amendments.   All addresses are in HEX.

6.   Program entry is at 6F00.   This uses a small piece of code which appears  to put a flag at 4478, which is changed at exit.   It probably does nothing now,but I have left it.   The true start is at 588A, where the program is set up.

588A    True start.   Set start of source code at 7700, and put in 5815.
589C    Get MEMEND and put in 5313 and set various stores.
58BB    CLS.
58BE    Home cursor.
58C6    Turn on cursor.
58D1    Display opening message.
58D7    Do CRLF.

At this point we are ready to start entry.

7.   Assembly.

The following is a summary of the assembly process so far as I understand it,   with references to the points at which various steps are taken.

There are three stages.

7.1 The label table is constructed.   This is stored at the top of memory, and  works down from there.

7.2 The first assembly is done and displayed on the screen.

7.3 The second assembly is done and is written to the disk file.

The procedures used are basically the same, to run through the program getting  the required information on a line by line basis.

Assembly starts at 63E3.

6410   Get filespec and open file.
643D   Check how many passes done (3 in all).   If less then go on else do totalerrors and label table.
6496   is the start of each round.   It comes back here after every line is     displayed, and at 64A2 tested for the WE flag.   This test has now been removed,so that if there is an error it always stops.
64F1   61D6 finds the start and end of each line in turn.   It returns with the start in DE and the end in HL.   This is a key routine.
It then runs through each line in turn, finding Labels, and putting them in the label table.   After this it starts on a second round, this time assembling the program on the screen and indicating errors.

6563   Check for valid opcode.
6DDF   This assembles the line and displays it.
6E14-6E30 display the address, opcode and operand during assembly.
6E38   Displays the whole line.
6445   Displays the total errors.
644E   Displays free memory.

At this stage there is no record of the assembly in memory.

Round 3 repeats round 2, but nothing is displayed.   Instead each line is first entered in a buffer at 5324.
6DDF  This is the main subroutine. It evaluates the opcode, putting the result  into 53B1.
6EA5 on  This gets the byte (opcode or operand), puts it in a temporary buffer  at 5324+.
6ED3-6ED8  When the line is finished this moves it from 5324+ to 72D4+.
This buffer ends at 73D3.   I have not yet discovered what happens when it is   full, but I think it is immediately filed on disk.
6BBB-6BC3  Add the end instruction (0202) and the transfer address if there is  one.

I do not know where the sector addresses are created, but presumably as soon as the sector is filled to 252 bytes the necessary address is put in.   It may do  it by counting bytes from the start.

550C   Starts the display of the label table.
5529   actually displays the label.
52B2   Exit from label table.

The label table is built up by a complete run-through of the source code for    each label in turn.   Since it is in alphabetical order it presumably does two  runs, the first to find the next label and the second for the addresses.

5E3A   is the line counter for P. (Display a screen-full.)

There are two further patches which can be inserted.   The first removes the    need for the rather awkward syntax for L(oad) and W(rite).   The commands then  become simply L filename and W filename.   It is a 1-byte patch as follows:-

Patch Edtasm/cmd (D1B,FB=2B:F1B,FB=05)

The second makes it possible to use lower case for comments, but you need to    remember to use upper case for commands and operational matters:-

Patch Edtasm/cmd (D04,68=00 00 00:F04,68=CD 5E 70)

EDTASM/TXT 05.05.91
