16 bit Assembly
Using Register Addressing
Instructions and Op Codes
Overview of my Compiler
16 bit Date Extraction
FAT12 Floppy Disk Access
32 bit to 16 bit File Size
Finding Free Disk Space
16bit Memory Routines
Mouse Callback
Floppy Disk Parameters
Registers
The Root Directory
Using the Stack
Creating a Boot Disk
Direct To Screen Output
16 bit Time Extraction
Basic Display Code
There are three ways to display text on the screen
- Teletype Mode - This is the default light grey text on a black background.
- Graphics Mode - This enables the use of colours, depending on the mode available.
- Direct to Screen - This is like writing your own screen driver. You can control text and background colours.
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.