16 bit Assembly

Home   Feedback   Site Map   Instruction Index  


Text Display

There are three ways to display text on the screen

Direct to Screen

This is reasonably simple to do, but requires some care as you need to change the ES register to point to the screen segment. On most IBM compatible PC's the screen is located at B800h. You can access by setting ES to this address as shown in the code below.

The default colour mode is 16 colours foreground and background with the background shown first in AH. AL holds the character to display.

The display is mapped to the same column and rows as Teletype mode. However the character is written as 16bits, so an 80 column display is actually 160 bytes wide.

If you try to display a character in an odd numbered column it will produce unexpected results in different colours. This is due the character being interpreted as a colour attribute.

The full colour choices are shown on the image to above on the right.

Once you get use to using a colour display it can be made more interesting, be introducing highlighted text.




Last Update 27/12/2022