Corrections to Chapter 5 of Java Secrets, Java Byte Code

p. 228: Figure 5-26 is an incorrect duplicate of Figure 5-27. It should instead look like this:


Figure 5-26: 5 / 10 = 0

p. 230: The caption for Figure 5-29 should read "2 % 10 = 2". The caption for Figure 5-30 should read "10 % 2 = 0".

p. 232: Both ishl and lshl shift their arguments by an int, not a long. Thus change "When an ishl instruction has completed, the stack is one word shorter. When an lshl instruction has completed, the stack is two words shorter." to "When a left shift instruction has completed, the stack is one word shorter." and replace Figure 5-35 with the following

p. 233: Both ishr and lshr shift their arguments by an int, not a long. Thus change "When an ishr instruction has completed, the stack is one word shorter. When an lshr instruction has completed, the stack is two words shorter." to "When a right shift instruction has completed, the stack is one word shorter." and replace Figure 5-37 with the following

Figure 5-37 -32L >> 8
Figure 5-37 -32L >> 8

Finally, note that the caption of Figure 5-37 shows an unsigned shift right (>>>) when what's needed is a signed shift right (>>).

p. 234: Both iushr and lushr shift their arguments by an int, not a long. Thus change "When an iushr instruction has completed, the stack is one word shorter. When an lushr instruction has completed, the stack is two words shorter." to "When an unsigned right shift instruction has completed, the stack is one word shorter." There should also be a figure for lushr like this one:

long unsigned shift right

p. 262-263: Figures 5-44, 5-45, and 5-46 are all missing box contents which are indended to show stack elements before and after the bytecodes under discussion. The correct figures are below


Figure 5-44: The stack before and after a daload instruction


Figure 5-45: a[7] = 57


Figure 5-46: The stack before and after an lastore instruction


[ Java Secrets Corrections | Java Secrets Home Page | Table of Contents | Examples | About the CD | Order ]

Copyright 1997, 1998 Elliotte Rusty Harold
elharo@sunsite.unc.edu
Last Modified September 16, 1998