pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pgubook-readers] Book really needs an Update


From: Mark Schmid
Subject: [Pgubook-readers] Book really needs an Update
Date: Thu, 27 Sep 2007 11:30:54 +0200

Hi Linux Assembly fans!

I just wanted to state my opinion that I feel
this great book *REALLY* needs an update!
There really are a LOT of typos, errors and mistakes
which should be addressed and corrected in an grand
overworked edition.
Besides the errors others have already found and
those I've mentioned, I found even more:

Obviously the two listings in the beginning of chapter 6,
starting on page 97 (of the print 2004 version) and 99,
should be titled and saved as "read-record.s" and
"write-record.s" (I just typed in both functions into
one file and called it "recordfunctions.s").
- You'll find this out in the end of chapter 7...
Then on page 104 where you assemble "write-records.s",
there is a typo, it says, quote:
-------------------------------
as write-records.s -o write-record.o
as write-record.s -o write-record.o
ld write-record.so write-records.o -o write-records
-------------------------------
Here you would be creating the file "write-record.o"
(WITHOUT the s before the point) twice, overwriting
the previous one. Of course, write-records.s should
be assembled to "write-records.o", not "write-record.o".
(I already told this to Jon.)

With all the different files and sources in the chapters
6 and 7, even with all the files made and used in this
book I would like to stress one point very much:
*PLEASE* write a single line BEFORE EVERY listing,
(or even as a comment INSIDE the listing!)
stating the name of the program/file which is listed,
so the reader knows exactly and at a glance which listing
and which file we are talking about, and under which
name the file needs to be saved, etc.
This will make working with the book and all the files
and source listings *A LOT* easier for the reader!
*PLEASE*! - And it will make it a lot easier for maintaining
the book with all its different versions, PDF, letter, etc.
as one can state the listing name instead of page number!
;-)

I don't know if this one has been mentioned before:
On page 106, at the end of the "count-chars.s" listing
there is a "movl %ebp, %esp" missing before the second
last line ("popl %ebp").


Chapter 7:

Then on page 124, in the "error-exit.s" code, there seems
to be a "addl $4, %esp" line missing after calling the
"write-newline" function, NOT needed for the correct 
functioning of the program, but for cleaning up
the stack after having called a function (good practice!).

Someone else already mentioned this, on page 125, in the
code snipped adding lines to the previous program "add-year.s",
it says "jl continue_processing" after "cmpl $0, %eax" where
it tests if LINUX returns a negative number as an error code.
Of course if it does, processing should NOT continue at
"continue_processing", but should work out the code following
after the conditional branch, so it should really read
"jge continue_processing"!

Then, when I added those lines to "add-year.s", I got a 
"segmentation fault" after assembling and linking all the
files mentioned on page 126 and running the executable 
"add-year" WITHOUT the test.dat file being around in order 
to test the newly added error-routine.
The only thing I could do to remove that "segmentation fault"
error and get the wanted error message to display correctly
was to move the following lines on page 125 up into the
previously existing .section .data of "add-year.s":
----------------------------
no_open_file_code:
.ascii "0001: \0"
no_open_file_msg:
.ascii "Can't Open Input File\0"
----------------------------
(and NOT having a second instance of .section .data and
.section .text).
It seems that having multiple .section .data and
.section. .text mixed arbitrarily in one and the
same program does not work.

Sorry for reporting all this, I just really think
you need to work those out and make a new edition 
of the book!

Working through this book could be much more fun
if these little but important things were fixed!

... Well, on to the next chapters (8+)! ;-) ...

Greetings,
Mark

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]