Mods to QL Assembly Language Programming book
Posted: Mon Aug 03, 2020 9:02 pm
I recently got a new bound copy of Norm's "QL Today ... Book One" masterpiece. Being very familiar with 68000 code but not fluent
in QL niceties I intended skipping the first section "Introduction to Assembly Language" but found myself having a peek. I
PM'd Norm with suggestions for a couple of corrections. He in turn suggested, among other things (all polite), an
approach of opening this thread to which he could reply as he incorporated or ignored them.
I then felt, if I were to do that, I'd better read the section properly. The list has therefore grown. I've intentionally
not been a punctuation/grammar pedant and kept any such things to an absolute minimum. [ There are good books by
Truss (Eats, Shoots & Leaves) and Brandreth (Have You Eaten Grandma?) on that subject - even though linguists probably argue about both]
Anyway, here are some suggestions (working from his latest PDF release which fixes Bigendian problem). I can now settle down to a more relaxing read of the rest of the book.
Alan
1. General
Throughout the book 'compliment' is used when meaning 'complement'.
It's stated in section 5.1.5 that all the 68008 instructions have been covered; most have but some haven't. The following don't appear
in the index. Many of them don't have a dedicated entry (arguably RTS & BRA have) or are only mentioned in passing and some only appear
in code fragments.
BRA, CLR, EXG, EXT, JMP, JSR, NOP, ROL, ROR, ROXL, ROXR, RTS, SWAP, TRAP
The most noticeable omissions are the rotates, given that the book states that there are 4 of them and leaves it at that.
2. Specific
Section 1.3:
"will be a hexadecimal" -> "it will be a hexadecimal"
Section 1.3.1:
"are registers either" -> "are registers; either"
Section 1.3.2:
I haven't used GWASL (does it automatically treat $1000 as short absolute?), but the usual way (for me anyway) to be clear when defining short absolute is by:
MOVE.L $1000.W,D1
MOVE.L $9000.W,D1
If the compiler seeks to use the 'shortest' instruction by default then you ought to be
able to force long absolute using (e.g.)
MOVE.L $9000.L,D1
i.e. it might make things clearer by being explicit.
Section 1.3.7:
"id incremented" -> "is incremented"
Section 2.2:
"This instruction copied" -> "This instruction copies"
"This instruction will be most often used in its Post decrement and pre-increment forms:"
I think you mean pre-decrement and post-increment.
Section 2.4:
"with converts to" -> "which converts to"
"In an unsigned nibble the most significant bit (2|3) is used to hold the sign, so all numbers below unsigned 7 are positive while those
'above' 7 are actually negative and so are below 0."
The above would be more accurate if you say "In a signed nibble..." and "all numbers from 0 to 7 are positive..."
(The '2|3' is my lazy way of representing superscript using only the ASCII character set!).
Section 3.2:
"It is very simply" -> "It is very simple"
"Put simply. The code" -> "Put simply the code"
Section 3.3:
Divs example shows 100/9 as 9r1 rather than 11r1
Section 4.1:
"and in the instruction set," -> "and, in the instruction set,"
"family of instruction" -> "family of instructions"
"opposite to zeros" -> "opposite of zeros"
You say you've previously described doing negation by flipping and incrementing; not so.
Section 4.3
"similar job" -> "similar job,"
"To exit from supervisor mode ANDI #$07FF,SR would need to be done."
To be consistent with the rest of the text that should be #$D7FF (used elsewhere).
Listing 4.3:
"Now it is 0100 0010 and" -> "Now it is 0100 0000 and"
Section 4.4:
I'm unsure whether 'corrupying' is an intentional joke.
"And can be" -> "ANDI can be"
"But the actual" -> "but the actual"
The formatting here (at least with Acrobat and the PDF) makes it tricky to work out which code sections the "These are:" refers to.
It may be best to leave out "These are:" for clarity, in which case the above "And can be" can be replaced by
"and can be" instead.
Listing 4.4: 'Multlication'
Section 4.5:
"D1.W contains $6543 the instruction" -> "D1.W contains $6543. The instruction:"
"Will result in" -> "will result in"
"extremely bad for of" -> "extremely bad form of"
Trace & supervisor are changed if the bits are a '1', not '0' as written.
Section 5.1.1
"cleared is Dn.W is" -> "cleared if Dn.W is"
"... instruction and is the processor is in user mode, and a privilege..." ->
"... instruction and, if the processor is in user mode, a privilege..."
Section 5.1.2
"is adjusted to be 0 to 8" -> "is adjusted to be 0 to 7"
"Z flag which takes the state" -> "Z flag which reflects the state"
"Sets the Z flag to the value of the bit specified." -> "Sets the Z flag according to the value of
the bit specified"
"character was read" -> "character is read"
in QL niceties I intended skipping the first section "Introduction to Assembly Language" but found myself having a peek. I
PM'd Norm with suggestions for a couple of corrections. He in turn suggested, among other things (all polite), an
approach of opening this thread to which he could reply as he incorporated or ignored them.
I then felt, if I were to do that, I'd better read the section properly. The list has therefore grown. I've intentionally
not been a punctuation/grammar pedant and kept any such things to an absolute minimum. [ There are good books by
Truss (Eats, Shoots & Leaves) and Brandreth (Have You Eaten Grandma?) on that subject - even though linguists probably argue about both]
Anyway, here are some suggestions (working from his latest PDF release which fixes Bigendian problem). I can now settle down to a more relaxing read of the rest of the book.
Alan
1. General
Throughout the book 'compliment' is used when meaning 'complement'.
It's stated in section 5.1.5 that all the 68008 instructions have been covered; most have but some haven't. The following don't appear
in the index. Many of them don't have a dedicated entry (arguably RTS & BRA have) or are only mentioned in passing and some only appear
in code fragments.
BRA, CLR, EXG, EXT, JMP, JSR, NOP, ROL, ROR, ROXL, ROXR, RTS, SWAP, TRAP
The most noticeable omissions are the rotates, given that the book states that there are 4 of them and leaves it at that.
2. Specific
Section 1.3:
"will be a hexadecimal" -> "it will be a hexadecimal"
Section 1.3.1:
"are registers either" -> "are registers; either"
Section 1.3.2:
I haven't used GWASL (does it automatically treat $1000 as short absolute?), but the usual way (for me anyway) to be clear when defining short absolute is by:
MOVE.L $1000.W,D1
MOVE.L $9000.W,D1
If the compiler seeks to use the 'shortest' instruction by default then you ought to be
able to force long absolute using (e.g.)
MOVE.L $9000.L,D1
i.e. it might make things clearer by being explicit.
Section 1.3.7:
"id incremented" -> "is incremented"
Section 2.2:
"This instruction copied" -> "This instruction copies"
"This instruction will be most often used in its Post decrement and pre-increment forms:"
I think you mean pre-decrement and post-increment.
Section 2.4:
"with converts to" -> "which converts to"
"In an unsigned nibble the most significant bit (2|3) is used to hold the sign, so all numbers below unsigned 7 are positive while those
'above' 7 are actually negative and so are below 0."
The above would be more accurate if you say "In a signed nibble..." and "all numbers from 0 to 7 are positive..."
(The '2|3' is my lazy way of representing superscript using only the ASCII character set!).
Section 3.2:
"It is very simply" -> "It is very simple"
"Put simply. The code" -> "Put simply the code"
Section 3.3:
Divs example shows 100/9 as 9r1 rather than 11r1
Section 4.1:
"and in the instruction set," -> "and, in the instruction set,"
"family of instruction" -> "family of instructions"
"opposite to zeros" -> "opposite of zeros"
You say you've previously described doing negation by flipping and incrementing; not so.
Section 4.3
"similar job" -> "similar job,"
"To exit from supervisor mode ANDI #$07FF,SR would need to be done."
To be consistent with the rest of the text that should be #$D7FF (used elsewhere).
Listing 4.3:
"Now it is 0100 0010 and" -> "Now it is 0100 0000 and"
Section 4.4:
I'm unsure whether 'corrupying' is an intentional joke.
"And can be" -> "ANDI can be"
"But the actual" -> "but the actual"
The formatting here (at least with Acrobat and the PDF) makes it tricky to work out which code sections the "These are:" refers to.
It may be best to leave out "These are:" for clarity, in which case the above "And can be" can be replaced by
"and can be" instead.
Listing 4.4: 'Multlication'
Section 4.5:
"D1.W contains $6543 the instruction" -> "D1.W contains $6543. The instruction:"
"Will result in" -> "will result in"
"extremely bad for of" -> "extremely bad form of"
Trace & supervisor are changed if the bits are a '1', not '0' as written.
Section 5.1.1
"cleared is Dn.W is" -> "cleared if Dn.W is"
"... instruction and is the processor is in user mode, and a privilege..." ->
"... instruction and, if the processor is in user mode, a privilege..."
Section 5.1.2
"is adjusted to be 0 to 8" -> "is adjusted to be 0 to 7"
"Z flag which takes the state" -> "Z flag which reflects the state"
"Sets the Z flag to the value of the bit specified." -> "Sets the Z flag according to the value of
the bit specified"
"character was read" -> "character is read"