Change bold code snippets to inline code blocks

This commit is contained in:
James Gregory 2013-12-31 17:12:29 +11:00
commit 3c76d884ef
185 changed files with 1772 additions and 1772 deletions

View file

@ -45,8 +45,8 @@ The ports used to control the VGA are shown in Table 23.1. The CRTC, SC,
and GC Data registers are located at the addresses of their respective
Index registers plus one. However, the AC Index and Data registers are
located at the same address, 3C0H. The function of this port toggles on
every **OUT** to 3C0H, and resets to Index mode (in which the Index
register is programmed by the next **OUT** to 3C0H) on every read from
every `OUT` to 3C0H, and resets to Index mode (in which the Index
register is programmed by the next `OUT` to 3C0H) on every read from
the Input Status 1 register (3DAH when the VGA is in a color mode,
| Register | Address |
@ -76,27 +76,27 @@ addressing of the now-vanished Color/Graphics Adapter and Monochrome
Display Adapter.
The method used in the VGA BIOS to set registers is to point DX to the
desired Index register, load AL with the index, perform a byte **OUT**,
desired Index register, load AL with the index, perform a byte `OUT`,
increment DX to point to the Data register (except in the case of the
AC, where DX remains the same), load AL with the desired data, and
perform a byte **OUT**. A handy shortcut is to point DX to the desired
perform a byte `OUT`. A handy shortcut is to point DX to the desired
Index register, load AL with the index, load AH with the data, and
perform a word **OUT**. Since the high byte of the **OUT** value goes to
perform a word `OUT`. Since the high byte of the `OUT` value goes to
port DX+1, this is equivalent to the first method but is faster.
However, this technique does not work for programming the AC Index and
Data registers; both AC registers are addressed at 3C0H, so two separate
byte **OUT**s must be used to program the AC. (Actually, word **OUT**s
byte `OUT`s must be used to program the AC. (Actually, word `OUT`s
to the AC do work in the EGA, but not in the VGA, so they shouldn't be
used.) As mentioned above, you must be sure which mode—Index or Data—the
AC is in before you do an **OUT** to 3C0H; you can read the Input Status
AC is in before you do an `OUT` to 3C0H; you can read the Input Status
1 register at any time to force the AC to Index mode.
How safe is the word-**OUT** method of addressing VGA registers? I have,
How safe is the word-`OUT` method of addressing VGA registers? I have,
in the past, run into adapter/computer combinations that had trouble
with word **OUT**s; however, all such problems I am aware of have been
with word `OUT`s; however, all such problems I am aware of have been
fixed. Moreover, a great deal of graphics software now uses word
**OUT**s, so any computer or VGA that doesn't properly support word
**OUT**s could scarcely be considered a clone at all.
`OUT`s, so any computer or VGA that doesn't properly support word
`OUT`s could scarcely be considered a clone at all.
> ![](images/i.jpg)
> A speed tip: The setting of each chip's Index register remains the same
@ -120,11 +120,11 @@ fixed. Moreover, a great deal of graphics software now uses word
> INC DX ;point to GC Data register>
>
> and then the Bit Mask register could be set repeatedly with the
> byte-size **OUT** instruction
> byte-size `OUT` instruction
>
> OUT DX,AL ;AL contains Bit Mask register setting
>
> which is generally faster (and never slower) than a word-sized **OUT**,
> which is generally faster (and never slower) than a word-sized `OUT`,
> and which does not require AH to be set, freeing up a register. Of
> course, this method only works if the GC Index register remains
> unchanged throughout the loop.