
MASTERING TURBO ASSEMBLER
First Edition Files
Copyright (C) 1989,1995 by Tom Swan

================================================================

Note: The following text is from the original README file, now named
README.TXT, supplied with the disk for Mastering Turbo Assembler,
First Edition, sold separately by Swan Software. This disk is no
longer available, and all files, including the originals for Turbo
Assembler 1.0, are now supplied free of charge with the book.

See the end of this file for corrections to the first edition.

================================================================

To assemble the programs, follow the instructions printed just above
most listings in the book.  (In a few cases, the instructions come
after the listings.)  Or, to automate these steps, you can use the
supplied MAKE files.  First, be sure that your Turbo Assembler and
Turbo Debugger directories are listed in the PATH environment
variable. Either type the following command or place this line in
your AUTOEXEC.BAT file and reboot:

        PATH C:\DOS;C:\TASM;C:\TD

This assumes that you store your DOS utilities in C:\DOS and use the
standard directory names for Turbo Assembler and Turbo Debugger.  If
you also have Turbo Pascal or Turbo C, add these directories to the
PATH list:

        PATH C:\DOS;C:\TASM;C:\TD;C:\TP;C:\TC

Next, make sure your MTA directory is current and type the following
MAKE command to assemble and link all .ASM programs:

        C:
        CD \MTA
        MAKE -fMAKEASM.MAK

This will take from one to several minutes, depending on the speed of
your computer and disk drive.  Examine the MAKEASM.MAK text file for
additional details about how to specify a library file name and how
to save disk space by excluding debugging information from .OBJ and
.EXE files.  To compile the Turbo Pascal files, enter:

        MAKE -fMAKEPAS.MAK

To compile the Turbo C files, enter:

        MAKE -fMAKEC.MAK

You can enter these same MAKE commands to reassemble individual
programs after you make modifications.  In all cases, only the minimum
number of files required to bring everything up to date will be
assembled and linked.

================================================================

NEW PROGRAMS ON DISK

As a bonus to those who purchased the disk, I've added two programs,
DT.ASM and DATETIME.ASM.  These programs are not in the book. 
DATETIME contains six public procedures for reading and formatting
the date and time into ASCIIZ strings, which you can then display or
print using other modules, STRIO for example.  The six public
procedures are:

GetDate         Get the system date
GetTime         Get the system time
DateToStr       Convert date to an ASCIIZ string
TimeToStr       Convert time to an ASCIIZ string
GetDateStr      Calls GetDate and DateToStr
GetTimeStr      Calls GetTime and TimeToStr

For more details about how to use these procedures, examine the
listing in the file DATETIME.ASM.  As an example of how to use the
date and time routines, DT.ASM displays the date and time.  You'll
find DT more handy to use than the DOS DATE and TIME commands.  Hard
disk users may want to copy DT.EXE to their \DOS subdirectory or
another directory listed in a PATH command.  Floppy disk users can
copy DT.EXE to their boot disks.

If you followed the previous instructions for MAKEing the .OBJ and
.EXE files, just type DT to run the sample program.  DATETIME.OBJ is
already stored in MTA.LIB, ready for linking to your own programs. If
you are using floppy disks, or if you prefer to assemble the programs
yourself, use the following instructions to assemble DATETIME,
install DATETIME.OBJ in MTA.LIB, and to assemble and link DT:

tasm datetime
tlib mta /E -+datetime
tasm dt
tlink dt,,, mta

================================================================

MASTERING TURBO ASSEMBLER -- CORRECTIONS as of 09/08/1994

Following are corrections to Tom Swan's Mastering Turbo Assembler,
(1989), published by Howard W. Sams, Indianapolis. Depending on when
you purchased your copy, some or all of these changes may already
have been made.

Many thanks to readers who have written to point out some these
errors, and to make other helpful suggestions!

================================================================
UPDATING THE LISTINGS
================================================================

Depending on which version of TASM you have, some of the listings
will not assemble without making a simple modification. If you
receive errors for the ExitCode variable used in many of the book's
programs, change ExitCode to another name throughout the listing (use
your text editor's global search and replace command). For example,
you can rename ExitCode XCode, and the program should assemble.

Apparently, ExitCode is reserved by TASM (it wasn't in version 1.0).
This reserved word appears to be undocumented.

================================================================
CORRECTIONS SINCE THE FIRST EDITION
================================================================

Page xxi -- The page number for Table 2-1 should be 20, not 200.

Page 19 -- Near the bottom of the page, find the line that reads:
    "Next comes the MODEL directive, which must be preceded by DOSSEG."
Change that line to:
    "Next comes the MODEL directive, optionally preceded by DOSSEG."

Page 25 -- In the first paragraph under the note, find the line that ends:
    "...exitCode, which a later instruction initialized..."
Change that line to:
    "...exitCode, initialized..."

Page 25 -- Figure 2-2, change data to @data:
    ax, @data

Page 28 -- Line 16, Program 2-1 (FF.ASM), change data to @data:
    16:    mov     ax, @data     ;Initialize ds to address

Page 35 -- Change the example `td386 ff' to `td386 lf'

Page 40 -- Line 30, Program 2-3 (EXESHELL.ASM), change data to @data:
    30:    mov     ax, @data     ;Initialize ds to address

Page 43 -- Line 20, Program 2-4 (PR132.ASM), change data to @data:
    20:    mov     ax, @data     ;Initialize ds to address   

Page 69 -- A printing error caused one of the horizontal lines in 
Figure 4-1 to be double printed. This line has no special significance 
and should not be bold.

Page 76 -- Change `al' in the comment at the end of line 25 to `si'

Page 79 -- In Figure 4-4, the labels ss:sp1, ss:sp2, and ss:sp3 are
upside down. To fix the figure, swap labels ss:sp1 and ss:sp3.

Page 87 -- The comment in line 31 should be `;cx <- cx - 1'.

Page 101 -- The comment to the last sample instruction on the page
should be `; ax <- ax / 16'.

Page 110 -- In the example, move the popf instruction from its
present location to just above pop dx.

Page 126 -- Change the last two sentences in the second paragraph
(the one under the top example) to: "By changing only the value
assigned to cx, this same sequence can fill up to 65,535 bytes. Set
cx to 0ffffh to repeat a string instruction this maximum number of
times. To fill 65,536 bytes, add an additional stosb instruction
after rep stosb."

Page 166 -- Change the second to last line in the example from:
    mov di, OFFSET
to this:
    mov di, OFFSET welcome

Page 177 -- The second line of the example should be two lines:
    string    db    'Lions and tigers and bears, oh my!', 0
    CODESEG

Page 201 -- In the last sentence of the paragraph next to "Declaring
RECORD Types, change `anyByte' to `signedByte'.

Page 203 -- In Figure 6-4, change `male:1' to `sex:1'.

Page 210 -- Label @@20: at line 64 is not referenced and 
can be removed.

Page 221 -- Line 41 can be shortened to:
    db    cr,lf,'(C) 1989 by Tom Swan',cr,lf,lf,EOS

Page 225 -- Line 23 can be shortened to:
    prompt  db  cr,lf,lf,'Value to convert? ', EOS

Page 258 -- Change the comment at line 85 to:
    ;     Cursor in current page repositioned to (row, column)

Page 263 -- Change the comment at line 305 to:
    ; ScInit          Initialize SCREEN package

Page 266 -- Label @@99: at line 113 is not referenced and 
can be removed.

Page 266 -- Blank lines 116 and 117 should be separated:
    116:
    117:

Page 308 -- Line 204 is an extra blank line and can be removed.

Page 324 -- Change line 46 to:
    DW    err10, err11, err12, err13, err14, err15, err16, err17

Page 325 -- In Figure 9-1, the arrow at left should originate
from the number 288, not below that number as shown.

Page 339 -- Change the comment at line 168 to:
    ; Registers: ax, bx

Page 339 -- Change the comment at line 191 to:
    ; Registers: ax, cx (indirectly), di

Page 379 -- In line 23, change `%DISPLAY' to `DISPLAY'.

Page 391 -- At mid page, change `%DISPLAY' to `DISPLAY'.

Page 397 -- You can remove `BinToAscHex:proc,' from the EXTRN
directive at line 37. This procedure is never called.

Page 397 -- Add the following instruction between lines 46 and 47:
    int 21h        ; Call DOS
Also insert the following two instructions between lines 55 and 56:
    push ds        ; Reset es to ds's current value
    pop  es

Page 408 -- Change the first line of the unpacked example to:
    unpacked db 7,4,2,9,5,6,1,8,0,0

Page 427 -- Find the line (sixth from top of first paragraph) that ends:
    "...thus reducing the key values"
Change that line to:
    "...thus reducing the key value"

Page 427 -- Near the bottom of the page, change ASEG to DATASEG

Page 427 -- In the last paragraph, change `table[row, column]' to
`matrix[row, column]'.

Page 443 -- Near mid page, the line above ASSUME should be two lines:
    mov     ax, BlackerHole
    mov     es, ax
    ASSUME  ds:BlackHole, es:BlackerHole

Page 451 -- In the example near the bottom, remove the line that reads:
    "jz  short @@10         ; Skip shift if all bits = 0"
This instruction does no harm, but is not needed.

Page 568 -- Add this sentence to the description of lahf: "After
executing lahf, other bits in ah are undefined and may also change."

Page 580 -- The Processor list for the movzx instruction is not
correct. This instruction is available only on 80386 processors. It
is not available on 8086/88 and 80286 processors.

Page 596 -- In the last paragraph, change `zf = 1' to `zf = 0'.

Page 597 -- In the last paragraph, change `zf = 0' to `zf = 1'.

Page 643 -- In the answer to exercise 3-6, 27 should be 2^7 (2 to the
7th power). Change this sentence to: "2^7 is the power of column
number 7."

================================================================
CORRECTIONS OF 5/94 (FROM READERS; UNCONFIRMED)
================================================================

Page 85 -- "move [word sump],ax" should be "move[word,sum]"

Page 545 -- 808386 should be 80386

Page 602 -- "If of=0, then the new cf and MSD bits are different"
            should be "the same"

Page 123 -- "For exmple, to load into al the first byte of a string sl"
            sl is not used in following example

Page 96  -- "On 80186/286/386 systems, n may be an unsigned 
             8-bit constant"  Said to produce strange results in TASM
             when n <> 1. Maybe suggest always setting n to 1.

Page 183 -- "There are only eight basic forms of base-indexed 
             addressing, as listed earlier" 
             Does this refer to table 5-1 on page 134? if so
             table refers to seven forms


END OF FILE

