Use backtick code blocks for syntax highlighting
This commit is contained in:
parent
8ed9dea394
commit
f658bfbb40
203 changed files with 26546 additions and 25801 deletions
40
11-07.md
40
11-07.md
|
|
@ -12,25 +12,27 @@ pages: 224-226
|
|||
|
||||
**LISTING 11.5 L11-5.ASM**
|
||||
|
||||
;
|
||||
; *** Listing 11.5 ***
|
||||
;
|
||||
; Measures the performance of adding an immediate value
|
||||
; to a memory variable, for comparison with Listing 11.4,
|
||||
; which adds an immediate value to a register.
|
||||
;
|
||||
jmp Skip
|
||||
;
|
||||
even ;always make sure word-sized memory
|
||||
; variables are word-aligned!
|
||||
WordVar dw 0
|
||||
;
|
||||
Skip:
|
||||
call ZTimerOn
|
||||
rept 1000
|
||||
add [WordVar]100h
|
||||
endm
|
||||
call ZTimerOff
|
||||
```nasm
|
||||
;
|
||||
; *** Listing 11.5 ***
|
||||
;
|
||||
; Measures the performance of adding an immediate value
|
||||
; to a memory variable, for comparison with Listing 11.4,
|
||||
; which adds an immediate value to a register.
|
||||
;
|
||||
jmp Skip
|
||||
;
|
||||
even ;always make sure word-sized memory
|
||||
; variables are word-aligned!
|
||||
WordVar dw 0
|
||||
;
|
||||
Skip:
|
||||
call ZTimerOn
|
||||
rept 1000
|
||||
add [WordVar]100h
|
||||
endm
|
||||
call ZTimerOff
|
||||
```
|
||||
|
||||
What's going on? Simply this: Instruction fetching is controlling
|
||||
overall execution time on *both* processors. Both the 8088 in a PC and
|
||||
|
|
|
|||
Loading…
Reference in a new issue