I am using DOS and I am trying to make the background white

100 views Asked by At

When I am write at DOS

tcc filename.c filename.exe

nothing happens.

#include <stdio.h>
#include <dos.h>
#include <stdlib.h>

void StartVidScreen (void){ //320x200
    }

    asm{

seting the video mode screen to 320 x 200

        mov ah,0
        mov al,13h
        int 10h

here i am trying to make the background white but its not working

        mov ah,0ffh
        mov al,' '
        int 10h
    }

void main(void)
 {
    StartVidScreen(); // Start Video Screen
}
1

There are 1 answers

0
Cebe On BEST ANSWER

As we're in VGA mode 13h, I would use the following int 10h call:

Function 10h, subfunction 10h: Sets the RGB (Red, Green, Blue) values for one of the DAC (Digital-to-Analog Converter) registers.

Inputs

  • AX = 1010h
  • BX = DAC register number (0-255), in our case register 0
  • DH = Red value (0-63).
  • CH = Green value (0-63).
  • CL = Blue value (0-63)

So to set the background

mov ax,1010h
mov bx,0
mov dh,03fh
mov ch,03fh
mov cl,03fh
int 10h

Tested on real vintage hardware, works.