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
50
04-04.md
50
04-04.md
|
|
@ -104,32 +104,36 @@ that the "true" execution time of **SHR** is 8.64 cycles.
|
|||
|
||||
**LISTING 4.5 LST4-5.ASM**
|
||||
|
||||
; Measures the performance of 1,000 SHR instructions
|
||||
; in a row. Since SHR executes in 2 cycles but is
|
||||
; 2 bytes long, the prefetch queue is always empty,
|
||||
; and prefetching time determines the overall
|
||||
; performance of the code.
|
||||
;
|
||||
call ZTimerOn
|
||||
rept 1000
|
||||
shr ax,1
|
||||
endm
|
||||
call ZTimerOff
|
||||
```nasm
|
||||
; Measures the performance of 1,000 SHR instructions
|
||||
; in a row. Since SHR executes in 2 cycles but is
|
||||
; 2 bytes long, the prefetch queue is always empty,
|
||||
; and prefetching time determines the overall
|
||||
; performance of the code.
|
||||
;
|
||||
call ZTimerOn
|
||||
rept 1000
|
||||
shr ax,1
|
||||
endm
|
||||
call ZTimerOff
|
||||
```
|
||||
|
||||
**LISTING 4.6 LST4-6.ASM**
|
||||
|
||||
; Measures the performance of 1,000 MUL/SHR instruction
|
||||
; pairs in a row. The lengthy execution time of MUL
|
||||
; should keep the prefetch queue from ever emptying.
|
||||
;
|
||||
mov cx,1000
|
||||
sub ax,ax
|
||||
call ZTimerOn
|
||||
rept 1000
|
||||
mul ax
|
||||
shr ax,1
|
||||
endm
|
||||
call ZTimerOff
|
||||
```nasm
|
||||
; Measures the performance of 1,000 MUL/SHR instruction
|
||||
; pairs in a row. The lengthy execution time of MUL
|
||||
; should keep the prefetch queue from ever emptying.
|
||||
;
|
||||
mov cx,1000
|
||||
sub ax,ax
|
||||
call ZTimerOn
|
||||
rept 1000
|
||||
mul ax
|
||||
shr ax,1
|
||||
endm
|
||||
call ZTimerOff
|
||||
```
|
||||
|
||||

|
||||
|
|
|
|||
Loading…
Reference in a new issue