执行TASM程序时DOSBox中更改控制台的背景颜色 [英] Change the background color of dosbox console when executing a tasm program

查看:826
本文介绍了执行TASM程序时DOSBox中更改控制台的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示 X 在屏幕的中央,然后更改控制台的背景色为蓝色。我有以下的code,它完成除了改变背景颜色的一切:

I am trying to display x in the center of the screen and then change the background color of the console to blue. I have the following code that accomplishes everything except for changing the background color:

    TITLE screen1.ASM
.MODEL SMALL

.STACK 0100h
.DATA

.CODE
start:
MOV AX,@DATA
MOV DS,AX


MOV AX,0600h
MOV BH,07h
MOV CX,0000h
MOV DX,184Fh
INT 10h

MOV AH,02h
MOV BH,00h
MOV DH,0Ch
MOV DL,28h
INT 10h

MOV AH,02h
MOV DL,'x'
INT 21h

MOV AX,4C00h
INT 21h
END start

在code清屏,显示 X 在DOSBox中窗口的中心和控制权给DOS。我试图找出我只是需要更新窗口(而非文本),以蓝色的背景颜色怎样的改变。

The code clears the screen, displays x at the center of the dosbox window and gives control back to DOS. I'm trying to find out what change I would need to just update the background color of the window (not the text) to blue.

推荐答案

在清除屏幕移动 BH = 17H 而不是07H

When clearing the screen move bh=17h instead of 07h

 TITLE screen1.ASM
.MODEL SMALL

.STACK 0100h
.DATA

.CODE
start:
MOV AX,@DATA
MOV DS,AX



MOV AX,0600h 
MOV BH,17h   
MOV CX,0000h  
MOV DX,184Fh  
INT 10h

MOV AH,02h   ;settin cursor position 
MOV BH,00h   ;page number
MOV DH,0Ch    ;row
MOV DL,28h   ;column
INT 10h

MOV AH,02h
MOV DL,'x'
INT 21h

MOV AX,4C00h
INT 21h
END start

在这里输入的形象描述

这篇关于执行TASM程序时DOSBox中更改控制台的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆