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
14
04-02.md
14
04-02.md
|
|
@ -57,13 +57,13 @@ required for every word-sized access to a memory operand. For instance,
|
|||
mov ax,word ptr [MemVar]
|
||||
```
|
||||
|
||||
takes 4 cycles longer to read the word at address **MemVar** than
|
||||
takes 4 cycles longer to read the word at address `MemVar` than
|
||||
|
||||
```nasm
|
||||
mov al,byte ptr [MemVar]
|
||||
```
|
||||
|
||||
takes to read the byte at address **MemVar.** (Actually, the difference
|
||||
takes to read the byte at address `MemVar`. (Actually, the difference
|
||||
between the two isn't very likely to be exactly 4 cycles, for reasons
|
||||
that will become clear once we discuss the prefetch queue and dynamic
|
||||
RAM refresh cycle-eaters later in this chapter.)
|
||||
|
|
@ -88,7 +88,7 @@ add byte ptr [MemVar],al
|
|||
|
||||
String instructions can suffer from the 8-bit bus cycle-eater to a
|
||||
greater extent than other instructions. Believe it or not, a single
|
||||
**REP MOVSW** instruction can lose as much as 131,070 word-sized memory
|
||||
`REP MOVSW` instruction can lose as much as 131,070 word-sized memory
|
||||
accesses x 4 cycles, or *524,280 cycles* to the 8-bit bus cycle-eater!
|
||||
In other words, one 8088 instruction (admittedly, an instruction that
|
||||
does a great deal) can take over one-tenth of a second longer on an 8088
|
||||
|
|
@ -115,9 +115,9 @@ instance, Listing 4.1, which uses a byte-sized memory variable as a loop
|
|||
counter, runs in 10.03 s per loop. That's 20 percent faster than the
|
||||
12.05 µs per loop execution time of Listing 4.2, which uses a word-sized
|
||||
counter. Why the difference in execution times? Simply because each
|
||||
word-sized **DEC** performs 4 byte-sized memory accesses (two to read
|
||||
word-sized `DEC` performs 4 byte-sized memory accesses (two to read
|
||||
the word-sized operand and two to write the result back to memory),
|
||||
while each byte-sized **DEC** performs only 2 byte-sized memory accesses
|
||||
while each byte-sized `DEC` performs only 2 byte-sized memory accesses
|
||||
in all.
|
||||
|
||||
**LISTING 4.1 LST4-1.ASM**
|
||||
|
|
@ -161,8 +161,8 @@ listings in this book. Throughout this book I've modeled the sample code
|
|||
after working code so that the timing results are applicable to
|
||||
real-world programming. In Listings 4.1 and 4.2, for example, I could
|
||||
have shown a still greater advantage for byte-sized operands simply by
|
||||
performing 1,000 **DEC** instructions in a row, with no branching at
|
||||
all. However, **DEC** instructions don't exist in a vacuum, so in the
|
||||
performing 1,000 `DEC` instructions in a row, with no branching at
|
||||
all. However, `DEC` instructions don't exist in a vacuum, so in the
|
||||
listings I used code that both decremented the counter and tested the
|
||||
result. The difference is that between decrementing a memory location
|
||||
(simply an instruction) and using a loop counter (a functional
|
||||
|
|
|
|||
Loading…
Reference in a new issue