Corrections

 

Updated 1/3/2005

Instructions: For each item in the following list, it is relevant if your copy's printing number is less than or equal to the number appearing in the Prt# column. If you would like to send a correction, send it to the book's discussion group.
Page Prt#

Description

7 9 The first code example should be: mov al,5.
43 7

The next to last paragraph should read "SIMM memory is now somewhat obsolete, and DIMM memory modules are more common."

75 9 First paragraph in 3.7.4, the second sentence should begin with: "In the following example, line 2...".
76 9 In the Figure at the bottom of the page, the sum is 01111110.
107 9 The second paragraph should read: "Similarly, if you want to use BP or EBP to access data pointed to by any segment other than SS, a segment override is needed:".
123 7 Question 10 should read: "What is the meaning of the SIZE operator?"
141 7 In Section 5.2.5, the fourth sentence should read: "The assembler will automatically generate a far Call to any procedure assembled under these models.
144 7 In Example 6, assume that DS has already been initialized to the data segment.
156 6 In Table 3, INT 16h accepts either AH=00h or 10h when waiting for a key. It accepts either AH=01h or 11h when checking the keyboard buffer, and it accepts either 02h or 12h when getting the keyboard flags. The only difference is that the higher numbers work with Function keys F11 and F12.
168 9 The second sentence under 0Fh:Get Video Mode should read: "A list of the more common video modes was shown earlier in Table 8."
174 7 In the code for Question 15, insert the following statement before the int 21h instruction:  mov dx,offset label1
193 9 In Table 5, the flags (right column) for JAE and JNB should be: CF = 0 or ZF = 1.
208 9

In Example 7, 3rd line from the bottom should be:

    jnz  endup             ; exit if either is true
209 7 In Example 8, lines 9 and 10 should be changed to:
 9:  cmp  op1,op3    ;  if op1 <= op3 then
10:  jng  repeat     ;     repeat the loop
212 7 The caption for Figure 3 should be: "FSM for String x(a..y)*z." The figure has also been moved to the top of page 213.
213 6

The second bulleted item following paragraph 1 should end with: "...zero or more letters in "a".."y". Also, in paragraph 2, the transition from state A to state B can only be accomplished if the letter "x" is read from the input stream.

221 7 Exercise 5 refers to Figure 4, not Figure 1.
222 9 In Exercise 14, BACKSPACE should equal 8 (rather than 9).
231 9

In the first code example the SHLD instruction should be replaced by the following two instructions:

    mov  eax,dval 
    shld ebx,eax,1 

By the way, CodeView does not display the registers correctly when you test the SHLD instruction (!). But you can call WriteLong or WriteLongHex to display the values of the EAX and EBX registers after the SHLD executes.

232 6 The first sentence should read: "The SHR instruction can be used to divide an unsigned integer by 2."
246 7 In Example 2, the 32-bit product is 00200000h.
247 7 The first sentence of the third paragraph should read: For both MUL and IMUL, both CF and OF are set if the high-order result contains significant digits; otherwise, CF and OF are both cleared.
269 7 Insert the following line at the beginning of STRUC.ASM:
    OPTION M510
282 6 The mWriteint macro example should be as follows:
    mWriteint macro value, radix:=<10>
292 7 Insert the following line at the beginning of LIST.ASM:
    OPTION M510

This directs ML.EXE to be compatibility with MASM 5.10, the version of MASM used when the book was written. When dealing with structures, there are some differences between MASM versions 5 and 6, documented on the FAQ page (#Q6).

302 9 remove the push ax and pop ax instructions from the mMult16 macro.
315 9 In Table 1, the Writelong procedure receives the radix in EBX, not BX.
329 9

In the AddSome procedure, at label L1, a segment override should be used: L1: add ax,ss:[si]

357 9 The second paragraph of Section 10.2, second sentence should begin with: "The instructions require us to use SI and DI, ...
361 6 In the second paragraph, note that MOVSD uses 32-bit operands.
363 6 In the last paragraph, note that CMPSD uses 32-bit operands.
366 7 In the middle of the page, the second line in the .code segment should be "mov es,di" rather than "mov ds,di".
368 6 In the second paragraph, note that STOSD uses 32-bit operands.
369 9 The second sentence in Section 10.3 should read: "Similar procedures are in the irvine.lib link library."
373 9 In the program example at the beginning of Section 10.3.3, the first MOV instruction after .code should be: mov di, seg myString
375 7 Insert the following line at the top of Str_getline in Example 6:
     DOS_READ_HANDLE = 3Fh
Also, the mov [si],0 instruction should be changed to:
     mov byte ptr [si],0
413 9

Insert the following line at the top of the page:

   OPTION M510
421 9 In the code example, delete the duplicated "call Write_errorstr" instruction 6 lines from the top.
423 6 In Example 8, insert the following instruction at the beginning of Get_Commandtail: 
    push es
Similarly, insert the following instruction just before the ret instruction:
    pop es
429 9

Insert the following on the line after the .386 directive in Example 11:

   OPTION M510
439 7 In the first sentence, change "this chapter" to "Section 11.1.4." 
442 9 In the first code example, change "mov dx,filespec" to "mov dx,offset filespec". In the second to last sentence on the page, change "AX equals either 2" to "AX equals either 3".
446 9 At the end of the decodeDate procedure, change the ADD instruction to: ADD AX,1980. This will permit the program to display 4-digit dates correctly.
451 7 In the last paragraph, second sentence, change "less than or equal to" to just "less than."
452 7 The last instruction in the code example at the top of the page should be: jb Exit rather than jbe Exit.
463 9 Questions 8, 9, and 10: change "3Eh" to "3Fh".
466 6 In 12.7.1, Exercise 1, subdirectory names have an attribute of 10h, not 08h.
520 6 The first sentence in the last paragraph should read: "Let's look at the HELLO.ASM program from Chapter 3, rewritten in COM format (see Example 7)."
541 6 The following entries in Table 9 should be corrected:
  Instruction         Machine Code
  mov [0120],bx       89 1E 20 01
  mov ax,bx           89 D8
  mov [bx+si],ax      89 00
546 7 In the second code excerpt, the first line should be:
    mov   ax,seg kybd_rtn
548 7 In the last paragraph before Section 15.3.4, change INT 25h to INT 23h.
550 7 Note: You must boot from DOS before running the Reset-Disabling program.
559 6 In Section 15.5.3, the postfix arithmetic example should be: 6 2 * 5 + .
559 7 Under the Register subheading, the FIMUL instruction should be changed to FMUL. All three examples, in other words, use real number operands. (Note: integer instructions such as FIADD and FIMUL can have only a single memory operand).
579 9

Insert the following numbers between the last two paragraphs:

00001010   (+10)
10001010 (-??)
582 7 Insert a heading at the top of the page: A.3.4 Hexadecimal Addition and Subtraction.
626 9 In the Gotoxy procedure specifications, the input row value should be 0-24 and the column value should be 0-79. Also, in the Get_Commandtail procedure, DS:DX points to the buffer.
628 9 When calling the Writelong procedure, EBX must contain the radix.
635 9 The BSWAP instruction should be called Byte Swap, rather than Check array bounds.
636 9 For the BT,BTC,BTR,BTS instruction, 32-bit register and memory operands are also permitted. Also, a * should be displayed in the Carry flag box, rather than a 1.
652 9 The instruction formats for PUSHW and PUSHD should PUSHW for 16-bit operands and PUSHD for 32-bit operands.
666 9 In Section G.3, Function 1 should begin on a new line (it was mistakenly embedded in the Function 0 paragraph).