我正在使用 DOS,我正在尝试将背景设为白色

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

当我在 DOS 下写作时

tcc filename.c filename.exe

没有任何反应。

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

void StartVidScreen (void){ //320x200
    }

    asm{

正在将视频模式屏幕设置为 320 x 200

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

我在这里尝试将背景设为白色,但它不起作用

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

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

由于我们处于 VGA 模式 13h,我将使用以下 int 10h 调用:

Function 10h, subfunction 10h:设置 DAC(数模转换器)寄存器之一的 RGB(红、绿、蓝)值。

输入

  • AX=1010h
  • BX = DAC 寄存器编号 (0-255),在我们的例子中为寄存器 0
  • DH = 红色值 (0-63)。
  • CH = 绿色值 (0-63)。
  • CL = 蓝色值 (0-63)

所以要设置背景

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

在真正的老式硬件上测试,有效。