Change bold code snippets to inline code blocks
This commit is contained in:
parent
f658bfbb40
commit
3c76d884ef
185 changed files with 1772 additions and 1772 deletions
20
11-04.md
20
11-04.md
|
|
@ -33,7 +33,7 @@ not explain in any way. After rolling it around in my head for a while,
|
|||
I took a look at the code under a debugger...and the answer leaped out
|
||||
at me. *The loop began at an odd address!* That meant that two
|
||||
instruction fetches were required each time through the loop; one to get
|
||||
the opcode byte of the **LOOP** instruction, which resided at the end of
|
||||
the opcode byte of the `LOOP` instruction, which resided at the end of
|
||||
one word-aligned word, and another to get the displacement byte, which
|
||||
resided at the start of the next word-aligned word.
|
||||
|
||||
|
|
@ -51,8 +51,8 @@ LoopTop:
|
|||
|
||||
While word-aligning branch destinations can improve branching
|
||||
performance, it's a nuisance and can increase code size a good deal, so
|
||||
it's not worth doing in most code. Besides, **EVEN** inserts a **NOP**
|
||||
instruction if necessary, and the time required to execute a **NOP** can
|
||||
it's not worth doing in most code. Besides, `EVEN` inserts a `NOP`
|
||||
instruction if necessary, and the time required to execute a `NOP` can
|
||||
sometimes cancel the performance advantage of having a word-aligned
|
||||
branch destination.
|
||||
|
||||
|
|
@ -103,19 +103,19 @@ make the stack pointer odd by adding an odd value to it or subtracting
|
|||
an odd value from it, or by loading it with an odd value.) An odd stack
|
||||
pointer on the 286 or 386 (or a non-doubleword-aligned stack in 32-bit
|
||||
protected mode on the 386, 486, or Pentium) will significantly reduce
|
||||
the performance of **PUSH,** **POP,** **CALL**, and **RET**, as well as
|
||||
**INT** and **IRET**, which are executed to invoke DOS and BIOS
|
||||
the performance of `PUSH`, `POP`, `CALL`, and `RET`, as well as
|
||||
`INT` and `IRET`, which are executed to invoke DOS and BIOS
|
||||
functions, handle keystrokes and incoming serial characters, and manage
|
||||
the mouse. I know of a Forth programmer who vastly improved the
|
||||
performance of a complex application on the AT simply by forcing the
|
||||
Forth interpreter to maintain an even stack pointer at all times.
|
||||
|
||||
An interesting corollary to this rule is that you shouldn't **INC SP**
|
||||
twice to add 2, even though that takes fewer bytes than **ADD SP,2**.
|
||||
The stack pointer is odd between the first and second **INC**, so any
|
||||
An interesting corollary to this rule is that you shouldn't `INC SP`
|
||||
twice to add 2, even though that takes fewer bytes than `ADD SP,2`.
|
||||
The stack pointer is odd between the first and second `INC`, so any
|
||||
interrupt occurring between the two instructions will be serviced more
|
||||
slowly than it normally would. The same goes for decrementing twice; use
|
||||
**SUB SP,2** instead.
|
||||
`SUB SP,2` instead.
|
||||
|
||||
> 
|
||||
> Keep the stack pointer aligned at all times.
|
||||
|
|
@ -163,7 +163,7 @@ computers are actually the same. As you'll recall from my earlier
|
|||
discussion of the matter in Chapter 4, display adapters offer only a
|
||||
limited number of accesses to display memory during any given period of
|
||||
time. The 8088 is capable of making use of most but not all of those
|
||||
slots with **REP MOVSW**, so the number of memory accesses allowed by a
|
||||
slots with `REP MOVSW`, so the number of memory accesses allowed by a
|
||||
display adapter such as a standard VGA is reasonably well-matched to an
|
||||
8088's memory access speed. Granted, access to a VGA slows the 8088 down
|
||||
considerably—but, as we're about to find out, "considerably" is a
|
||||
|
|
|
|||
Loading…
Reference in a new issue