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
35
11-04.md
35
11-04.md
|
|
@ -15,12 +15,13 @@ AT clone to verify the basic functionality of the timer by measuring the
|
|||
performance of simple instruction sequences. I was cruising along with
|
||||
no problems until I timed the following code:
|
||||
|
||||
|
||||
mov cx,1000
|
||||
call ZTimerOn
|
||||
LoopTop:
|
||||
loop LoopTop
|
||||
call ZTimerOff
|
||||
```nasm
|
||||
mov cx,1000
|
||||
call ZTimerOn
|
||||
LoopTop:
|
||||
loop LoopTop
|
||||
call ZTimerOff
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
|
@ -39,12 +40,14 @@ resided at the start of the next word-aligned word.
|
|||
One simple change brought the execution time down to a reasonable 12.5
|
||||
cycles per loop:
|
||||
|
||||
mov cx,1000
|
||||
call ZTimerOn
|
||||
even
|
||||
LoopTop:
|
||||
loop LoopTop
|
||||
call ZTimerOff
|
||||
```nasm
|
||||
mov cx,1000
|
||||
call ZTimerOn
|
||||
even
|
||||
LoopTop:
|
||||
loop LoopTop
|
||||
call ZTimerOff
|
||||
```
|
||||
|
||||
While word-aligning branch destinations can improve branching
|
||||
performance, it's a nuisance and can increase code size a good deal, so
|
||||
|
|
@ -60,9 +63,11 @@ branch destination.
|
|||
I recommend that you only go out of your way to word-align the start
|
||||
offsets of your subroutines, as in:
|
||||
|
||||
even
|
||||
FindChar proc near
|
||||
:
|
||||
```nasm
|
||||
even
|
||||
FindChar proc near
|
||||
:
|
||||
```
|
||||
|
||||
In my experience, this simple practice is the one form of code alignment
|
||||
that consistently provides a reasonable return for bytes and effort
|
||||
|
|
|
|||
Loading…
Reference in a new issue