How to change or set background color in 8086 assembly?

Viewed 33426

I am learning 8086 assembly. I need to change the background colour of the screen using 8086 assembly. I saw a few tutorials where they could set only a portion of the screen. I don't want to do this by DOS Interrupts whereas all the tutorials are in DOS Interrupts. It would be good if anyone show me the code to set the whole portion of the screen(background colour) using BIOS Interrupts.

2 Answers

This is blue screen:

mov ah, 09h
mov cx, 1000h
mov al, 20h
mov bl, 17  ; This is Blue & White.

You can change 17 to other color numbers;

  • 0 = Black
  • 1 = Blue
  • 2 = Green
  • 3 = Aqua
  • 4 = Red
  • 5 = Purple
  • 6 = Yellow
  • 7 = White
  • 8 = Gray,
  • 9 = Light Blue.

Example:

mov bl, 47

This is Red & White.

Related