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
11
24-03.md
11
24-03.md
|
|
@ -90,16 +90,19 @@ program code and a few cycles of execution time. DX is being loaded with
|
|||
a word value that's composed of two independent immediate byte values.
|
||||
The obvious way to implement this would be with
|
||||
|
||||
MOV DL,VALUE1
|
||||
MOV DH,VALUE2
|
||||
|
||||
```nasm
|
||||
MOV DL,VALUE1
|
||||
MOV DH,VALUE2
|
||||
```
|
||||
which requires four instruction bytes. By shifting the value destined
|
||||
for the high byte into the high byte with MASM's shift-left operator,
|
||||
**SHL** (\*100H would work also), and then logically combining the
|
||||
values with MASM's **OR** operator (or the **ADD** operator), both
|
||||
halves of DX can be loaded with a single instruction, as in
|
||||
|
||||
MOV DX,(VALUE2 SHL 8) OR VALUE1
|
||||
```nasm
|
||||
MOV DX,(VALUE2 SHL 8) OR VALUE1
|
||||
```
|
||||
|
||||
which takes only three bytes and is faster, being a single instruction.
|
||||
(Note, though, that in 32-bit protected mode, there's a size and
|
||||
|
|
|
|||
Loading…
Reference in a new issue