CS: APP 官方的勘误

第三版的CS:APP有很多细节问题。特别日前看到的第三章。

不过国内的出版社有进行勘误,尽管还是没有完全地查出来。

(尽管都是细节问题,但也是应该检查正确才行。)

Despite our best efforts to create a book with zero defects, our vigilant readers have pointed out some bugs. Please report any new errata to Randy Bryant and Dave O’Hallaron. Note that some of these errors have been corrected in more recent printings.

There are a number of mistakes made by the authors in CS: APP. Here is the link to official errata webside:

CMU勘误的地址

抽取其中的一部分(第三章):

  • p. 171, second-to-last line. 248 is 256 terabytes, not 64 terabytes.
    Posted 09/09/2016. Don Bagert

  • p. 174, code annotation at top of page. It should read “Disassembly of function multstorein binary file mstore.o.”
    Posted 10/25/2015. Shoeb Mohammed

  • p. 175, code annotation in middle of page. It should read “Disassembly of function multstore in binary file prog.”
    Posted 10/25/2015. Shoeb Mohammed

  • p. 177, aside “ATT versus Intel assembly-code formats,” last sentence of first paragraph. The assembly code shown is for the function multstore, not sum.
    Posted 11/09/2015. Shoeb Mohammed

  • p. 179, Section 3.4, first paragraph. The ranges given for the eight named registers for the three different instruction sets are incorrect. They should be:

    • For 8086: %ax through %sp.
    • For IA32: %eax through %esp.
    • For x86-64: %rax through %rsp.

    Posted 07/19/2017. Yili Gong

  • p. 183, sample code near bottom of page, line 4. The code should be “movb $-17, (%rsp).”
    Posted 10/24/2015. Jason Waterman

  • p. 188, aside “Some examples of pointers,” call to printf. The format string should be “a = %ld, b = %ld\n”.
    Posted 11/09/2015. Shoeb Mohammed

  • p. 191, second full paragraph. The first sentence should state: “The third column of Figure 3.9 illustrates the effect of executing the instruction popq %rdx …”
    Posted 09/28/2015. Max Ma

  • p. 191, fourth line of paragraph that begins “The third column of Figure 3 …” It should state that the value 0x123 remains at memory location 0x100.
    Posted 11/09/2015. Carlos Galdino

  • p. 198, first line of first full paragraph. There should be a period after the word “forms”.
    Posted 09/19/2016. Anise Ghorbani

  • p. 199, third full paragraph. The reference to instruction idivl should be to idivqinstead.
    Posted 02/21/2017. Changan Wang

  • p. 199, fourth full paragraph. The paragraph should start with “For most applications of 64-bit division …”
    Posted 09/19/2015. Xingda Zhai

  • p. 200, first line of text. It should state “In this code, argument qp must first be saved in a different register (line 2), …”
    Posted 08/16/2015. Dmitry Neverov

  • p. 204, Practice Problem 3.13, second paragraph. It should state “Suppose a is in some portion of %rdi while …”
    Posted 10/15/2015. Ronald Greenberg

  • p. 205, Practice Problem 3.13, code for D. The second instruction should be “setne %al.”
    Posted 11/09/2015. Carlos Galdino

  • p. 214, third paragraph. The second sentence should be “The function computes the absolute value of the difference of its two arguments x and y, …”
    Posted 11/11/2015. Yili Gong

  • p. 214, Figure 3.17(c). The comment on line 8 of the code should state “Return rval”.
    Posted 03/18/2017.

  • p. 218, assembly code for cread. In the annotations for lines 3 and 5, “x” should be “xp”.
    Posted 11/19/2015. Vlad Buslov

  • p. 226, last sentence before Practice Problem 3.25. It should state “The compiler has determined that the loop can only be entered when n > 1, and that, as n is decremented, it will reach value 1 before reaching a value less than 1.”
    Posted 06/11/2017. Daniel O’Brien

  • p. 234, first and second lines of text. They should state “ … indexed by register %rsi, which holds … ”
    Posted 09/02/2015. Dmitry Neverov

  • p. 235, Figure 3.23, annotation for line 5 of code. It should state “Goto *jt[index].”
    Posted 12/25/2015. Xinzhen Chen

  • p. 238, Problem 3.31, Comments in assembly code at top of page. The register allocation is listed incorrectly. It should state “a in %rdi, b in %rsi, c in %rdx, dest in %rcx.”
    Posted 07/25/2015. Yu Zhong and Carlos Galdino

  • p. 241, fourth and fifth lines. They should state “Procedure P can pass up to six integral values (i.e., pointers and integers) in registers … ”
    Posted 09/02/2015. Dmitry Neverov

  • p. 243, Figure 3.27a, line 2. The annotation should state “L1: y+2.”
    Posted 02/15/2016. Xinzhen Chen

  • p. 244, first full paragraph. The value 0x400054e should be 0x40054e.
    Posted 07/26/2017. Daniel O’Brien

  • p. 244, second full paragraph. The value 0x4000560 should be 0x400560.
    Posted 07/26/2017. Daniel O’Brien

  • p. 244, Comment after line 4. It should state “Disassembly of first(long x)”
    Posted 09/02/2015. Dmitry Neverov

  • p. 249, Fourth line from bottom. Sentence ending “… and 17 (s3).” should be “… and 17 (x4).”
    Posted 11/29/2016. Hyun Chun

  • p. 252, Practice Problem 3.34. The first two sentences should state “Consider a function P, which generates local values, named a0–a7. It then calls function Q, which has no arguments.”
    Posted 11/23/2015. Vlad Buslov

  • p. 257, Table near the bottom of the page. The assembly code for the first entry should be “movq %rdx,%rax.”
    Posted 10/03/2015. Zhiwei Xin

  • p. 259, Figure 3.36 The fourth block from the bottom should have the label A[3][2].
    Posted 04/04/2017. Dean Kajmakci

  • p. 259, assembly code in middle of page, line 3. The annotation should state: “Read from M[xA + 12i + 4j].”
    Posted 10/25/2015. Karan Dwivedi

  • p. 263, assembly code in middle of page, line 3. There is a missing ‘)’ at the end of the annotation.
    Posted 02/11/2016. Elizabeth White

  • p. 264, Annotations of last block of assembly code. It should state that j is in register %rdx.
    Posted 07/26/2017. Daniel O’Brien

  • p. 266, middle of page. The declaration and initialization of r should be:
    struct rect r = { 0, 0, 10, 20, 0xFF00FF };
    Posted 08/04/2015. Yu Zhong

  • p. 277, first bullet, second and third lines after declarations. They should state “… if the object has type T, then the pointer has type T *.”
    Posted 09/02/2015. Dmitry Neverov

  • p. 281, Figure 3.40. The first sentence of the caption should read “Character array buf is just below part of the saved state.”
    Posted 12/01/2015. Yili Gong

  • p. 282, Practice Problem 3.46, second paragraph. It should state that get_line is called with return address 0x400076.
    Posted 11/23/2015. Vlad Buslov

  • p. 284, Practice Problem 3.46, part E. The question for ask for three things wrong with the code.
    Posted 07/26/2017. Daniel O’Brien

  • p. 293, Practice Problem 3.49, second paragraph. The text should state: “… there may be an offset of e2 bytes between the values of s2 and p.”
    Posted 11/09/2015. Shoeb Mohammed

  • p. 295, Figure 3.45. The lower 128 bits of register %ymm13 should be labeled %xmm13.
    Posted 10/28/2015. David Hirschv

  • p. 300, Problem 3.51, second line. The return value has type “dest_t.”
    Posted 10/13/2016. Anise Ghorbani

  • p. 313, Problem 3.60, first line of code. Argument n should be declared as being of type int.
    Posted 07/21/2015. Lauren Cooper

  • p. 326, Solution to Problem 3.3, fifth line of code. The code should be movq %rax, $0x123to be consistent with the problem statement, although both versions have the same error.
    Posted 06/02/2015. Zhi Li

  • p. 326, Solution to Problem 3.3, sixth line of code. The code should be movl %eax, %rdxto be consistent with the problem statement, although both versions have the same error.
    Posted 09/02/2015. Elizabeth White

  • p. 330, Solution to Problem 3.14D. The comparison is for <=.
    Posted 08/16/2015. Dmitry Neverov

  • p. 331, Solutions to Problems 3.15B and 3.15D. The values starting with “0x0x” should start with “0x” instead.
    Posted 12/04/2015. Carlos Galdino and Yili Gong

  • p. 333, Solution to Problem 3.20. The comment on the third line of code should read “Test x”.
    Posted 06/02/2015. Curtis Gagliardi

  • p. 338, Solution to Problem 3.30, third bullet. The final sentence should say “Thus, case labels 3 and 6 are missing in the switch statement body.”
    Posted 09/27/2015. Xinyun Zhao

  • p. 339, Solution to Problem 3.32, line labeled “F4”. The instruction should be “repz retq.”
    Posted 10/13/2016. Wenjun Huang

  • p. 346, Solution to Problem 3.46C. The program is attempting to return to address 0x400034, not 0x040034.
    Posted 10/24/2016. Wenjun Huang

  • p. 347, Solution to Problem 3.47E. In addition, the program should test the value returned by gets to make sure it’s not NULL.
    Posted 07/26/2017. Daniel O’Brien

  • p. 348, Solution to Problem 3.51. In the third entry of the table, the conversion is from double to float, as is requested in the problem statement.
    Posted 08/09/2015. Yu Zhong

  • p. 349, Solution to Problem 3.53, last paragraph of text. The ambiguity arises from the commutativity of addition, not multiplication.
    Posted 11/09/2015. Shoeb Mohammed

评论

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×