Color text-mode memory lies at segment 0xb800 and is 4000 bytes
in length 80*25*2 cuz each visible character on the screen
is accompanied by a text attribute byte.
00000000 Text Attribute Byte
XXBGxxFG
The low-nibble defines the foreground and the high-nibble
the background, and there is a way to disable the blink
bit.
Function 9 - Output Char And Attribute At Hardware Cursor
CX-Repeat
BH-Display Page
BL-Attribute
AL-Character
AH-9
INT 0x10
To clear the screen to one f/b color try this code:
clrscr:
mov dx, 0 ; Set cursor to top left-most corner of screen
mov bh, 0
mov ah, 0x2
int 0x10
mov cx, 2000 ; print 2000 chars
mov bh, 0
mov bl, 0x21 ; green bg/blue fg
mov al, 0x20 ; blank char
mov ah, 0x9
int 0x10
ret
This code writes a blue 'A' char to 0,0:
mov cx, 0xb800
mov es, cx
mov ax, 0x141
mov [es:0], ax
waitkey:
mov ah, 0x6
mov dl, 0xff
int 0x21
jz waitkey
ret