【问题标题】:Cannot change color for the character in TASM无法更改 TASM 中角色的颜色
【发布时间】:2021-11-10 18:35:06
【问题描述】:

TASM code

我在mov dl,42下添加了指令mov bl,178,但是不能改变字符的颜色。如果我想改变字符的颜色应该怎么做? the output

【问题讨论】:

  • @fuz 这是新问题。感谢您的帮助
  • 请勿发布代码图片。反正 int21/02 不带颜色。
  • 请提供不带图片的代码

标签: assembly colors x86-16 tasm


【解决方案1】:

DOS 不做颜色,但 BIOS 做。

您可以使用 BIOS.WriteCharacterAndAttribute 函数 09h。

mov cx, 1       ; ReplicationCount
mov bx, 00B2h   ; BH DisplayPage 0, BL Attribute 178
mov ax, 092Ah   ; AH Function 09h, AL Character 42
int 10h

与DOS功能02h不同的是光标不前进。为此,您可以附加 BIOS.Teletype 函数 0Eh

mov cx, 1       ; ReplicationCount
mov bx, 00B2h   ; BH DisplayPage 0, BL Attribute 178
mov ax, 092Ah   ; AH Function 09h, AL Character 42
int 10h
mov ah, 0Eh
int 10h

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-02
    • 1970-01-01
    • 2017-08-24
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多