The current active edition of this book is: Third Edition July 2016 . Please check the folio / copyright page at the start of your book to ascertain which edition you have.
Chapter 3, page 36. The top of the page gives the command: ld -o prog3 prog3.o
The command should be: ld -o prog3a prog3a.o
The start of Chapter 7 mentions use of the SVR, Supervisor Call. This should be be SVC – also referred to as SWI.
Tony Palmer has written to say how much he enjoyed the book, and as a long-time developer he had noted any errors, inconsistency’s and typos as he went. Above and beyond the call of duty I am indebted to Tony for providing these a text file. Rather than print his (comprehensive) list here Tony has agreed to let me make it available as a simple text file to download. So click the ‘Tony’s Errata V2’ link below and save the file.
Tony has tested all the programs on Pi 1 Model B and a Pi 2 Model B. Tony has also included some updated program files for the Chapter 25 (floating point processor) as these need a slight modification to run on the Pi 2 – the code in the book for this chapter only works for a Pi 1 as printed. The “Pi 2” uses the BCM2836 which has a different GPIO Base (0x20200000 for the Pi 1 versus 0x3F200000 for the Pi 2). More details in Tony’s file which shows the changes needed. Here are the links – note the program files are saved as text files so you will need to reserve them as source files using the ‘.s’ postfix:
The first paragraph has ‘CPN (ComPare Negative)’ it should read ‘CMN (CoMpare Negative). This also needs correcting a few paragraphs on (CPN to read CMN). Thanks to Steve for finding this one.
The penultimate example reads: CMN R0,#0 and should read: CMN R0,#1
In the text towards the end of the chapter it states: “123345 having overwritten ‘Hello’”. It should be ‘12345’ – the ‘3’ has been repeated.
Reads Z- 1, should be Z=1 in the minor title. Thanks to Grimble Gromble for pointing these out. (GG : I have replied several times to you but I don’ think my emails are getting past your spam filter…)
The comment in the read: section of Program 7b should read: “stdin is keyboard” and not “stdout is monitor”. And in the comment for LDR R1,=string it should read: “string is located at string:”
The comment in the read: section of Program 8a should read: “stdin is keyboard” and not “stdout is monitor”. The comments also suggest that the action is toggling the character case, probably poor choice of word on my behalf – the case is being changed would be more correct. Thanks to Dave Woodcock for pointing these out.
The code reads: UMULL R3, R4, R1, R1 It should read: UMULL R3, R4, R1, R2. Thanks to Peter Gostanian for pointing this out.
VSUB.F64 D0,D2,D4 @Sub D0=D4- D2, the comment should read: @Sub D0=D2- D4
VMUL.F32 S2,S4,S1 @Multiply S2- S4*D1, the comment should read: @Multiply S2=S4*S1
Thanks to Jim Deering for pointing these out.
If you are running Debian then the Vim text editor I suggest you install in Chapter 3 is already packaged as part of the Debian distro so there is no need to go through that process.
Thanks to the spell check feature on the typesetting software one error has been noted in Programs 25a and 25b (Chapter 25). The label: ‘open:’ near the start of both program listings, should read: ‘openfile:’
The labels are not required and can be deleted if you prefer, they are in place to break the listing up into its component parts. As is the program will just enter a continuous loop. The files that you can download from here work correctly.
In the same chapter the listing segments in the ‘Building The Code’ (pages 222 and 223 in the print version) section contain: MOV R2, R4, LSR #21
In two places. The LSR should be LSL in both places: MOV R2, R4, LSL #21
The line: .global part2
Should read: .global _part2
Thanks to John Willis for spotting that missing underscore.
There are three examples of the MVN instruction. The middle instruction in the book reads MNV and should be MVN.
The example given for TEQ near the top of the page is wrong. It should read:
TEQ R0, R1 @ Test is R0 and R1 are the same.
Use the TEQ instruction to test if two values are equal, without affecting the V or C flags (as CMP does)
The disassembly of the first instruction line should read:
0x8054 <_start>: add r0, pc, #8
Thanks to Ron Saunders for pointing these out.
(Print version of book, page 170>): Prog 20a. The text talks about line numbers that are not provided in the program list. Easiest thing to do is load the program into Vim and turn line numbering on if you don’t want to mark them lightly in pencil on the page. Thanks to Rick Comeau for spotting that.
Thanks to Don Wunz for pointing out that the super scripts are not showing properly with the text in some places. For example, the text following Figure 4b shows 27 rather than 2 to the 7th power.
Last Updated: Sept 11 2015